View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Question!!

leocastaneda wrote on Jun 17, 2007

Good Morning!!!
I am using IRAF for surface photometry. I need to get photometry for some
slits directons on my fits files. For this task I have an IRAF script, but
I have a real problem:

The data that I have to use in some iraf task as imstat are storaged in
strings, they are real values but the format are strings, I need to recover the
REAL value from the string, in order to be able to use in different tasks.
Can you help me with it?

Best regards,

Leonardo
AIFA Bonn
Post generated using Mail2Forum (http://www.mail2forum.com)

Mike Fitzpatrick wrote on Jun 17, 2007

If I understand your question, you have a text file of values you want to convert to an image so you can use tasks like IMSTAT? If so, see the RTEXTIMAGE task to convert to a FITS file. If the values aren't really representative of an image but simply a table of values, you can use the TABLES external package (needs to be installed separately) to do the same, e.g. the TSTAT task in the TTOOLS package.

Cheers,
-Mike

Mike Fitzpatrick wrote on Jun 17, 2007

Thanks a lot for your answer. May be the question was not enough clear.
My question is as follows:
I have two arrays x[(i)],y[(i)] generated by a cl script. They are positions on m y fits files, actually I am fitting slits with it, it means x[(i)],y[(i)] are pairs as (200,500) for example, but after this fitting I need to use the coordinates in dome iraf tasks as
imstat (image=image//"[x:y,x[j]:y[(j)]]") and x[(i)],[y(i)] are formally STRINGS variables and the tasks need REAL values, the question is how I can go from strings to real vaues of my coordinates. </blockquote>

What you need to do in this case is to create an image section based on the values, e.g. "image[200:500,200:500]". Note this is different than simply the pixel value at location (200,500) but makes more sense for calling IMSTAT. In any case, you would use the '//' string concatenation operator as in

string sec = image // "[" // x[i] // ":" // y[i] // "," // x[i] // ":" // y[i] // "]"
imstat(images=sec, .....)


Let me know if I still don't understand the question.

Cheers,
-Mike </div> --- *Last post on Jun 17, 2007*