getting pixel values?
Arp wrote on Nov 13, 2009
Hi!
Is there an Iraf task which outputs a table containing values for each pixel in a given polygon or fits file?
thx.
Is there an Iraf task which outputs a table containing values for each pixel in a given polygon or fits file?
thx.
Mike Fitzpatrick wrote on Nov 13, 2009
The answer depends on the details of what you mean by 'table' a 'polygon'. In the simplest case, the LISTPIX task can output an ascii 'table' of the (x,y,value) tuples in a rectangular image section, e.g.
If 'table' means .tab file or a FITS binary table you'd need to convert the above output using one the TABLES.TTOOLS tasks; if 'polygon' means an arbitrary N-sided figure then perhaps one of the mask-making tasks could be used.
-Mike
cl> listpix dev$pix[100:120, 230:250]
If 'table' means .tab file or a FITS binary table you'd need to convert the above output using one the TABLES.TTOOLS tasks; if 'polygon' means an arbitrary N-sided figure then perhaps one of the mask-making tasks could be used.
-Mike
Arp wrote on Nov 13, 2009
Hello!
yes, with polygon I meant an n-sided figure, stored as an ascii file, e.g. like a polygon used for the task "polyphot".
I think this output of LISTPIX is exactly what I am looking for. It would just be a bit better if it would take such a polygon as input.
could you please elaborate a bit on those mask-making tasks?
thank you.
yes, with polygon I meant an n-sided figure, stored as an ascii file, e.g. like a polygon used for the task "polyphot".
I think this output of LISTPIX is exactly what I am looking for. It would just be a bit better if it would take such a polygon as input.
could you please elaborate a bit on those mask-making tasks?
thank you.
Mike Fitzpatrick wrote on Nov 13, 2009
I was thinking of something along the lines of using TEXT2MASK to create a pixel mask of the polygon, then use IMEXPR to mask the image such that things outside the polygon are set to zero (i.e. an expression like "(a ? b : 0)" where 'a' is the mask and 'b' in the input image), then you could LISTPIX and throw out the non-zero pixels (or leave them in for a rectangular table in (x,y).
-Mike
-Mike
Arp wrote on Nov 13, 2009
I see, thank you. I will try this out, as soon as I am back at my pc with all the data.
Thanks again!
Thanks again!
Last post on Nov 13, 2009