Welcome to iraf.net Tuesday, May 21 2024 @ 11:08 PM GMT
lpetras |
04/20/2009 01:41AM (Read 2538 times)
|
|
|
Status: offline
Registered: 08/12/2006
Posts: 16
|
I have some FITS image files that have their RA and DEC keywords in a format that IRAF tasks do recognize as being in sexagesimal format and wondered if their was a task that would take the string and convert it back to one that is understood by IRAF.I could do this with HEDIT I suppose (reading and converting by hand) but I was after something that I could run for a script..The format is "HH MM SS.SSS" for RA and "+/-DD MM SS.SS" for DEC .Any suggestions welcome..Linas
|
|
|
|
fitz |
04/20/2009 01:41AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The good news is that changes have already been made for the next release to allow sexagesimal formats such as you describe to be recognized automatically. Since this is in a core procedure you'd need a complete set of new binaries to take advantage of it so I haven't got a quick patch you could use.Until then, all the pieces you need to script a fix are already in place: HSELECT to get the value, the trim() and TR to edit the string and HEDIT to replace the value. For example,[code:1:29f5eb4615]
hselect ("foo.fits", "RA", yes) | scan (line)
print (trim(line)) | tr ("STDIN", " ", ":") | scan (s1)
hedit ("foo.fits", "RA", s1)
[/code:1:29f5eb4615]The 'line' and 's1' are builtin script variables, trim() removes leading/trailing whitespace and so the TR will replace the spaces only within the sexagesimal value. A quick procedure script could be writen to loop over a list of images and automatically change the RA/DEC keywords.-Mike
|
|
|
|
lpetras |
04/20/2009 01:41AM
|
|
|
Status: offline
Registered: 08/12/2006
Posts: 16
|
Hi Mike,Many thanks for the tip and looking forward to the new release Linas
|
|
|
|
| |
|
Content generated in: 0.09 seconds |
|