comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Comparing structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Comparing structures [message #87670] Fri, 21 February 2014 13:52 Go to previous message
cab581 is currently offline  cab581
Messages: 7
Registered: April 2013
Junior Member
Hi everyone,

I have two structures that are made up of several fields. The last field (5) is the array which contains the measurement itself and the others contain information about the measurement (much like the star example on the Exelis website http://www.exelisvis.com/docs/Creating_and_Defining_St.html).

The two structures that I have need to be compared, but I'll use the star example from Exelis to explain what I want to do. Say I have two structures, one contains the masses of the star and the other contains the volumes and I want to work out the density of each part of the star at altitude i (OK, the astronomy in the example is a bit off, but it works), but the list of stars is not the same (the measurements may have been incomplete), so the star id (given by letters) fields may be

strucA.(1) = [a, b, c, f, g, i, m, n, p, q, r, s, w, x, y, z]
strucB.(1) = [b, d, e, f, h, i, j, l, m, q, r, s, t, v, w, x, y, z]

I tried to use something like,

for i=0,50
match = where(strucA.(1) eq strucB.(1), count)
if count le 0.0 then strucA[match].(5)[i] = !values.f_nan
density[i]=strucA/strucB
endfor

What I'm trying to say is where I have a, b, c, etc in the first row, find the corresponding letter in the second row and do the calculation.

However when I do this all it does is compare the nth letter in the first row to the nth letter in the second row, so the only results I'm getting in the example above are from f, q, r and s so I'm missing out on b, m, w, x, y, z.

Any ideas would be greatly appreciated. If I haven't explained myself properly then I'd be glad to make it clearer.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Position, normal coordinates, and multiple images
Next Topic: IDL reading tiff files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:18:54 PDT 2025

Total time taken to generate the page: 0.00404 seconds