Extracting from Strutures [message #73887] |
Mon, 06 December 2010 02:24 |
sirvival
Messages: 18 Registered: August 2010
|
Junior Member |
|
|
Hi,
I have 38 fits file (about 2000 to 4000 pixel) from which I cut out a
small part and add up all the pixel along one direction.
The result is written into a structure. A second input into the
structure is the exposure time.
Part of my code:
data = file_search('*.fits.gz',count=numfiles)
sx = 1176
ex = 1230
sy = 1732
ey = 1752
addupstr = {images:fltarr(ey-sy+1), expo:0.D}
alladdup = replicate(addupstr,numfiles)
Exo has 10 different values.
My question is now how can I write code that gives me e.g. a plot for
all images with the same expo without knowing the values of expo.
My first try:
for i = 0, numfiles-1 do begin
first = where(alladdup.expo eq alladdup[i].expo)
plot,alladdup[i].images,psym=10
for j = 0, n_elements(first)-1 do
oplot,alladdup[first[j]].images,psym=10,col=j+1
endfor
This gives me the plots but as expo repeats I get the same plot again
and again
Or how can I write code that for each expo a different structure gets
written?
Thanks
|
|
|