Skip to content
Snippets Groups Projects
Commit 82d03525 authored by David Rafferty's avatar David Rafferty
Browse files

Task #3743: Removed pyrap-specific calls to find equinox.

parent 2c8b1c4a
No related branches found
No related tags found
No related merge requests found
...@@ -234,26 +234,6 @@ class Op_readimage(Op): ...@@ -234,26 +234,6 @@ class Op_readimage(Op):
if img.opts.beam is not None: if img.opts.beam is not None:
beam = img.opts.beam beam = img.opts.beam
else: else:
# if img.use_io == 'rap':
# iminfo = hdr['imageinfo']
# if iminfo.has_key('restoringbeam'):
# beaminfo = iminfo['restoringbeam']
# if beaminfo.has_key('major') and beaminfo.has_key('minor') and beaminfo.has_key('major'):
# bmaj = beaminfo['major']['value']
# bmin = beaminfo['minor']['value']
# bpa = beaminfo['positionangle']['value']
# # make sure all values are in degrees
# if beaminfo['major']['unit'] == 'arcsec':
# bmaj = bmaj / 3600.0
# if beaminfo['minor']['unit'] == 'arcsec':
# bmin = bmin / 3600.0
# if beaminfo['major']['unit'] == 'rad':
# bmaj = bmaj * 180.0 / N.pi
# if beaminfo['minor']['unit'] == 'rad':
# bmin = bmin * 180.0 / N.pi
# beam = (bmaj, bmin, bpa) # all degrees
# found = True
# if img.use_io == 'fits':
try: try:
beam = (hdr['BMAJ'], hdr['BMIN'], hdr['BPA']) beam = (hdr['BMAJ'], hdr['BMIN'], hdr['BPA'])
found = True found = True
...@@ -371,43 +351,28 @@ class Op_readimage(Op): ...@@ -371,43 +351,28 @@ class Op_readimage(Op):
""" """
code = -1 code = -1
year = None year = None
if img.use_io == 'rap': hdr = img.header
hdr = img.header['coordinates']['direction0'] if 'EQUINOX' in hdr:
code = -1 year = hdr['EQUINOX']
year = None if isinstance(year, str): # Check for 'J2000' or 'B1950' values
if hdr.has_key('system'): tst = year[:1]
year = hdr['system'] if (tst == 'J') or (tst == 'B'):
if isinstance(year, str): # Check for 'J2000' or 'B1950' values year = float(year[1:])
tst = year[:1] if tst == 'J': code = 3
if (tst == 'J') or (tst == 'B'): if tst == 'B': code = 2
year = float(year[1:])
if tst == 'J': code = 3
if tst == 'B': code = 2
else:
code = 0
if img.use_io == 'fits':
hdr = img.header
if 'EQUINOX' in hdr:
year = hdr['EQUINOX']
if isinstance(year, str): # Check for 'J2000' or 'B1950' values
tst = year[:1]
if (tst == 'J') or (tst == 'B'):
year = float(year[1:])
if tst == 'J': code = 3
if tst == 'B': code = 2
else:
code = 0
else: else:
if 'EPOCH' in hdr: # Check EPOCH if EQUINOX not found code = 0
year = hdr['EPOCH'] else:
code = 1 if 'EPOCH' in hdr: # Check EPOCH if EQUINOX not found
else: year = hdr['EPOCH']
if 'RADECSYS' in hdr: code = 1
sys = hdr['RADECSYS'] else:
code = 4 if 'RADECSYS' in hdr:
if sys[:3] == 'ICR': year = 2000.0 sys = hdr['RADECSYS']
if sys[:3] == 'FK5': year = 2000.0 code = 4
if sys[:3] == 'FK4': year = 1950.0 if sys[:3] == 'ICR': year = 2000.0
if sys[:3] == 'FK5': year = 2000.0
if sys[:3] == 'FK4': year = 1950.0
return year, code return year, code
def get_rot(self, img, location=None): def get_rot(self, img, location=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment