Date arithmetics
Michael Weber wrote on Feb 28, 2007
I want to use rvcorrect to do heliocentric velocity correction. Easiest would be, if I could get the DATE-OBS and EXPTIME keywords and add EXPTIME/2 to the DATE and then split up the date into the values rvcorrect needs.
How can I do the first part of that (e.g. date arithmetics) in a simple cl script?
--
Michael
How can I do the first part of that (e.g. date arithmetics) in a simple cl script?
--
Michael
Mike Fitzpatrick wrote on Feb 28, 2007
Michael,
See the examples for the ASTHEDIT task as a means to computing the midpoint UT. Otherwise, HSELECT can pull the values of keywords from headers and HEDIT can replace/add keywords and values.
Cheers,
-Mike
See the examples for the ASTHEDIT task as a means to computing the midpoint UT. Otherwise, HSELECT can pull the values of keywords from headers and HEDIT can replace/add keywords and values.
Cheers,
-Mike
Michael Weber wrote on Feb 28, 2007
Mike, thanks for the quick help. I somehow overlooked the epoch function in there...
Michael
Michael
jhargis wrote on Feb 28, 2007
Mike -
I am also trying to do this, but I have another problem. I do not have a "time-obs" keyword in my FITS header that has the time of the observation. I do have the "date-obs" keyword in the format YYYY-MM-DDTHH:MM:SS.
I am trying to figure out how to get the HH:MM:SS part out of the "date-obs" keyword, but without success.
How can I get his out for use in a calculation?
- Jonathan Hargis
I am also trying to do this, but I have another problem. I do not have a "time-obs" keyword in my FITS header that has the time of the observation. I do have the "date-obs" keyword in the format YYYY-MM-DDTHH:MM:SS.
I am trying to figure out how to get the HH:MM:SS part out of the "date-obs" keyword, but without success.
How can I get his out for use in a calculation?
- Jonathan Hargis
Mike Fitzpatrick wrote on Feb 28, 2007
Jonathan,
Try something like:
The first command pulls out the value of the DATE-OBS keyword to the 's1' variable, the second adds a new NEW-DATE keyword using the substring to pull out just the time. The last command is optional but converts the keyword value back to a sexagesimal string (it was added as a floating point number the first time).
Cheers,
-Mike
Try something like:
ecl> hselect wpix date-obs yes | scan (s1)
ecl> hedit wpix new-date substr(s1,12,19) add+
ecl> hedit wpix new-date str(substr(s1,12,19)) add+
The first command pulls out the value of the DATE-OBS keyword to the 's1' variable, the second adds a new NEW-DATE keyword using the substring to pull out just the time. The last command is optional but converts the keyword value back to a sexagesimal string (it was added as a floating point number the first time).
Cheers,
-Mike
jhargis wrote on Feb 28, 2007
Mike -
I am trying to do this an an "asthedit" script. Is there no "substr" command in asthedit?
Is there an easier way to do this, other than running these three commands manually?
Also, the above commands appear to truncate the fractional part of the second.
- Jonathan
I am trying to do this an an "asthedit" script. Is there no "substr" command in asthedit?
Is there an easier way to do this, other than running these three commands manually?
Also, the above commands appear to truncate the fractional part of the second.
- Jonathan
Mike Fitzpatrick wrote on Feb 28, 2007
I am trying to do this an an "asthedit" script. Is there no "substr" command in asthedit?
The 'substr' is a CL function, no equivalent in ASTHEDIT.
Is there an easier way to do this, other than running these three commands manually?
You can wrap it up in a procedure script and make it a single command along with the asthedit (see http://iraf.net/docs/script).
-Mike
jhargis wrote on Feb 28, 2007
I finally figured out an easier way to do all this: just use "setairmass", which actually calculated UTMIDDLE.
- Jonathan
- Jonathan
Last post on Feb 28, 2007