From 1faf705ee191cb129fbe0499c6c61c27f8020ad6 Mon Sep 17 00:00:00 2001 From: rudolffu Date: Wed, 2 Nov 2022 16:46:32 +0800 Subject: [PATCH] use ra,dec in degrees in the modified fits header --- src/addheaderinfo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/addheaderinfo.py b/src/addheaderinfo.py index d3628dd..50c506e 100755 --- a/src/addheaderinfo.py +++ b/src/addheaderinfo.py @@ -71,6 +71,7 @@ def UtcHours(utctime): coord = SkyCoord(otbl['hmsdms'].values, frame='icrs', unit=(u.hourangle, u.deg)) otbl['rah'] = coord.ra.to(u.hourangle).value +otbl['radeg'] = coord.ra.to(u.degree).value otbl['decdeg'] = coord.dec.to(u.degree).value notbl = otbl.merge(fitslist, on="filen") notbl['utctime'] = map(NewUtc, notbl['filen']) @@ -99,10 +100,6 @@ def UtcHours(utctime): iraf.hedit.delete = False iraf.hedit.update = True iraf.hedit.verify = False - iraf.hedit(images=notbl['filen'][i], - fields='ra', value=notbl['rah'][i]) - iraf.hedit(images=notbl['filen'][i], - fields='dec', value=notbl['decdeg'][i]) iraf.hedit(images=notbl['filen'][i], fields='object', value=notbl['Obj'][i]) iraf.hedit(images=notbl['filen'][i], fields='st', value=notbl['st'][i]) @@ -119,5 +116,9 @@ def UtcHours(utctime): st='st', ut='ut', date='UTDTIME') + iraf.hedit(images=notbl['filen'][i], + fields='ra', value=notbl['radeg'][i]) + iraf.hedit(images=notbl['filen'][i], + fields='dec', value=notbl['decdeg'][i]) except: pass