dr.michi |
02/28/2007 05:06PM (Read 8427 times)
|
|
|
Status: offline
Registered: 01/16/2007
Posts: 14
|
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
|
|
|
|
fitz |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
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
|
|
|
|
dr.michi |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 01/16/2007
Posts: 14
|
Mike, thanks for the quick help. I somehow overlooked the epoch function in there...Michael
|
|
|
|
jhargis |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 02/19/2007
Posts: 28
|
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
|
|
|
|
fitz |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Jonathan,Try something like:[code:1:332564c4b4]
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+
[/code:1:332564c4b4]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 |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 02/19/2007
Posts: 28
|
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
|
|
|
|
fitz |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
[quote:242e687780]I am trying to do this an an "asthedit" script. Is there no "substr" command in asthedit?[/quote:242e687780]The 'substr' is a CL function, no equivalent in ASTHEDIT.[quote:242e687780]
Is there an easier way to do this, other than running these three commands manually? [/quote:242e687780]You can wrap it up in a procedure script and make it a single command along with the asthedit (see https://iraf.net/docs/script).-Mike
|
|
|
|
jhargis |
02/28/2007 05:06PM
|
|
|
Status: offline
Registered: 02/19/2007
Posts: 28
|
I finally figured out an easier way to do all this: just use "setairmass", which actually calculated UTMIDDLE.- Jonathan
|
|
|
|