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.
|