How to add current day/time in header file through HEDIT
smp wrote on Aug 25, 2009
Hi,
Through my procedure script, I want to add a field "day_time" to header files of fits files.
This field should show the day and time on which the fits file was updated last time, according to some IRAF task.
Also, this header line should show the comment: e.g. "This is time image was edited last time."
e.g.
I know that task HEDIT can be used to edit/add fields.
But how to access computer's current day and time, through HEDIT is not known to me.
Regards
smp
Through my procedure script, I want to add a field "day_time" to header files of fits files.
This field should show the day and time on which the fits file was updated last time, according to some IRAF task.
Also, this header line should show the comment: e.g. "This is time image was edited last time."
e.g.
CCDPROC = 'Aug 25 15:03 CCD processing done'
I know that task HEDIT can be used to edit/add fields.
But how to access computer's current day and time, through HEDIT is not known to me.
Regards
smp
Mike Fitzpatrick wrote on Aug 25, 2009
The FITS image kernel automatically inserts an IRAF-TLM (time last modified) keyword into the image, but if you want a specific keyword to indicate the task/operation you'll need to add that yourself. The 'date' command will get you the current day/time, you can simply pipe this into a string variable and HEDIT it in, e.g.
-Mike
date() | scan (s1)
hedit ("myimage.fits", "mytime", s1, add+)
-Mike
smp wrote on Aug 25, 2009
Hi,
---------------------------------------------------------------------------------------------------------
(1)
This did not create time. It only showed day.
while,
On cl> prompt, both time and date commands produce current day and time.
----------------------------------------------------------------------------------------------------------
(2)
In the help for "language", function "time" is mentioned. But function date() is not mentioned. (Is date() mentioned somewhere in the IRAF documentation?)
----------------------------------------------------------------------------------------------------------
(3)
What I want basically is , for examples,
i.e. How will I add fixed comment also to a field line like above ?
I tried
But I got following in header file:
i.e. The format of this is not same as that of field POL_MODE in above example; here single quote includes both value of the field and comment. In POL_MODE example, value of the field (yes / no) is separated from the fixed comment.
-----------------------------------------------------------------------------------------------------------
Regards
smp
---------------------------------------------------------------------------------------------------------
(1)
date() | scan (s1)
hedit ("myimage.fits", "mytime", s1, add+)
This did not create time. It only showed day.
while,
On cl> prompt, both time and date commands produce current day and time.
----------------------------------------------------------------------------------------------------------
(2)
In the help for "language", function "time" is mentioned. But function date() is not mentioned. (Is date() mentioned somewhere in the IRAF documentation?)
----------------------------------------------------------------------------------------------------------
(3)
What I want basically is , for examples,
GAIN = 1.5 / Indicative Numbers
POL_MODE= 'no ' / yes = POLARIMETER no = NON_POLARIMETER i.e. How will I add fixed comment also to a field line like above ?
I tried
date() | scan (s1)
hedit(images="myimage.fits", fields="mytime",
value=s1//" /File is modified on this day.",
add=yes, addonly=no, delete=no, verify=no, show=no, update=yes)
But I got following in header file:
MYTIME = ' Wed /File is modified on this day.'i.e. The format of this is not same as that of field POL_MODE in above example; here single quote includes both value of the field and comment. In POL_MODE example, value of the field (yes / no) is separated from the fixed comment.
-----------------------------------------------------------------------------------------------------------
Regards
smp
Mike Fitzpatrick wrote on Aug 25, 2009
Quick reply for now: My mistake, you need to use
instead of 's1' since 'line' is a struct variable that will hold to whole value. Also, you cannot use HEDIT to add a keyword with a specific comment, you need to use the new NHEDIT task for that.
date() | scan(line)instead of 's1' since 'line' is a struct variable that will hold to whole value. Also, you cannot use HEDIT to add a keyword with a specific comment, you need to use the new NHEDIT task for that.
smp wrote on Aug 25, 2009
Thanks.
It worked.
regards
smp
It worked.
regards
smp
Last post on Aug 25, 2009