Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhandberg committed Jun 29, 2021
2 parents c6f8617 + 27a184e commit 5199951
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master-v0.7.7
master-v0.7.8
13 changes: 8 additions & 5 deletions flows/load_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def load_image(FILENAME):
image.wcs = WCS(hdr)

# Values which will be filled out below, depending on the instrument:
image.exptime = None # Exposure time
image.exptime = hdr.get('EXPTIME', None) # Exposure time * u.second
image.peakmax = None # Maximum value above which data is not to be trusted

# Timestamp:
Expand Down Expand Up @@ -299,12 +299,15 @@ def load_image(FILENAME):

elif telescope == 'SAI-2.5' and instrument == 'ASTRONIRCAM':
image.site = api.get_site(13) # Hard-coded the siteid for Caucasus Mountain Observatory
image.obstime = Time(hdr['MJD-AVG'], format='mjd', scale='utc', location=image.site['EarthLocation'])
if 'MIDPOINT' in hdr:
image.obstime = Time(hdr['MIDPOINT'], format='mjd', scale='utc', location=image.site['EarthLocation'])
else:
image.obstime = Time(hdr['MJD-AVG'], format='mjd', scale='utc', location=image.site['EarthLocation'])
image.photfilter = {
'H_Open': 'H',
'K_Open': 'K',
}.get(hdr['FILTER'], hdr['FILTER'])
image.exptime = hdr.get('FULL_EXP', None)
image.exptime = hdr.get('FULL_EXP', image.exptime)

elif instrument == 'OMEGACAM' and (origin == 'ESO' or origin.startswith('NOAO-IRAF')):
image.site = api.get_site(18) # Hard-coded the siteid for ESO VLT Survey telescope
Expand Down Expand Up @@ -337,9 +340,9 @@ def load_image(FILENAME):
else:
raise RuntimeError("Could not determine origin of image")

# This is something most instruments can agree on:
# Sanity checks:
if image.exptime is None:
image.exptime = float(hdr['EXPTIME']) # * u.second
raise ValueError("Image exposure time could not be extracted")

# Create masked version of image:
image.image[image.mask] = np.NaN
Expand Down

0 comments on commit 5199951

Please sign in to comment.