Skip to content

Commit

Permalink
load fits file without postcards available
Browse files Browse the repository at this point in the history
  • Loading branch information
afeinstein20 committed Aug 20, 2021
1 parent 2a11b36 commit fa3c024
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions eleanor/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,20 @@ def __init__(self, tic=None, gaia=None, coords=None, name=None, fn=None,
self.tic_version = hdr['TIC_V']
self.postcard = hdr['POSTCARD']

if self.tc is True:
post_dir = self.tesscut_dir()
self.postcard_path = os.path.join(post_dir, self.postcard)
# workaround to address #137
# - both self.postcard and tesscut_dir() contains tesscut, resulting in incorrect path
self.postcard_path = re.sub(r'tesscut[/\\]tesscut', 'tesscut', self.postcard_path)
self.cutout = fits.open(self.postcard_path)
# else:
#########

self.position_on_chip = (hdr['CHIPPOS1'], hdr['CHIPPOS2'])
# self.position_on_postcard = (hdr['POSTPOS1'], hdr['POSTPOS2'])
if local == True:

if self.tc is True:
post_dir = self.tesscut_dir()
self.postcard_path = os.path.join(post_dir, self.postcard)
# workaround to address #137
# - both self.postcard and tesscut_dir() contains tesscut, resulting in incorrect path
self.postcard_path = re.sub(r'tesscut[/\\]tesscut', 'tesscut', self.postcard_path)
self.cutout = fits.open(self.postcard_path)

self.position_on_chip = (hdr['CHIPPOS1'], hdr['CHIPPOS2'])

else:
self.cutout = None

else:
if self.coords is not None:
Expand Down

0 comments on commit fa3c024

Please sign in to comment.