Welcome to iraf.net Tuesday, May 21 2024 @ 10:08 PM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Converting new type DATE-OBS to UT
   
tonisee
 05/14/2008 08:57AM (Read 4163 times)  
+----
Newbie

Status: offline


Registered: 05/14/2008
Posts: 7
Hello!In the headers of my FITS files, only DATE-OBS keyword in the new format is presented, it is already in UTC, e.g.:
DATE-OBS = '2008-05-14T08:57:00'Since many tasks need keyword UT, it's probably most easiest to write small CL script which parses DATE-OBS from files in @list and creates needed UT-keyword by subtracting part of the string after character T.My question is: which would be the best way to do this?
I tried many combinations of imgets, hselect, substr and hedit but didn't get anything useful. I'll bet that the solution is something that simple that I just overlook it. Oops!Best regards
Tõnis

 
Profile Email
 Quote
fitz
 05/14/2008 08:57AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See the thread at https://iraf.net/phpBB2/viewtopic.php?t=86096&highlight=dateobs++script for a discussion of this. To give away the ending, the SETAIRMASS task may do what you want by setting the 'utmiddle' parameter to load the UT keyword.Cheers,
-Mike

 
Profile Email
 Quote
valdes
 05/14/2008 08:57AM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
You might also look at ASTHEDIT. I'm not sure if it has a specific operation for what you want but it can probably do what you want since it is an expression evaluator that has many built-in operators.Yours,
Frank Valdes

 
Profile Email
 Quote
tonisee
 05/14/2008 08:57AM  
+----
Newbie

Status: offline


Registered: 05/14/2008
Posts: 7
After digging in forum, re-re-..-reading scripting manual and testing different approaches, I found following solution:
---------------------------------------------------------
list = "a.lst"
while (fscan(list, s1) !=EOF) {
imgets(s1,"DATE-OBS")
hedit (s1,"UT",substr(imgets.value,12,19), add+, ver-)
}
---------------------------------------------------------I agree, that this solution is pretty limited (what happens when DATE-OBS contains fraction of seconds.. :winkSmile but it does what I need. Plain CL-script works now very well when using [i:64373f951a]cl < script[/i:64373f951a].Setairmass requires sidereal time keyword to be presented in the header. After creating this keyword, it is indeed possible to add UT or UTMIDDLE (default) keyword using setairmass. The problem is/was, that for computing ST, UT is needed ;-) In my case, only the DATE-keyword (containing both date and time) was in the FITS header and ST has to be computed more or less "manually", like:
[i:64373f951a]hedit @a.lst st '(6.6974-(2451543.5-@"ljd")/15.21842447+1.764417+@"UT"*1.002738)' add+ ver-
[/i:64373f951a]
Actually, I found that when my DATE-OBS keyword was in the form:
DATE-OBS= '2007-03-14T18:36:20' and i added UT-keyword manually as 18:36:20,
[i:64373f951a]setairmass file.fits ut=ut update+[/i:64373f951a] created UTMIDDLE as:
UTMIDDLE= '2007-03-14T18:41:20.00'
Seems that [i:64373f951a]setairmass[/i:64373f951a] creates UTMIDDLE always in such format (and it is totally fine for UTMIDDLE keyword).At the moment I would conclude: in similar situation, one can create UT keyword containing just time only with parsing strings.Also, thank you very much for your answers
Tõnis

 
Profile Email
 Quote
   
Content generated in: 0.17 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login