From 3ca9efef9272e554149df571efb4b8f33d580742 Mon Sep 17 00:00:00 2001 From: Emir Date: Tue, 23 Nov 2021 16:18:02 +0100 Subject: [PATCH] Add OB type checking Checks whether it is FixedOffset or Autojitter. --- flows/load_image.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flows/load_image.py b/flows/load_image.py index 3693582..681272f 100644 --- a/flows/load_image.py +++ b/flows/load_image.py @@ -149,6 +149,14 @@ def load_image(FILENAME, target_coord=None): s = [hdul[k].header['NAXIS2'], hdul[k].header['NAXIS1']] pix = w.all_world2pix(target_radec, 0).flatten() if pix[0] >= -0.5 and pix[1] >= -0.5 and pix[0] <= s[1]-0.5 and pix[1] <= s[0]-0.5: + ob_type = hdul[k].header["HIERARCH ESO OCS DET1 IMGNAME"].split('_')[-1] + if "Auto" in ob_type: + image.ob_type = 'Autojitter' + elif "Fixed" in ob_type: + image.ob_type = 'FixedOffset' + # Should we use a default instead of raising? + else: + raise RuntimeError("Image OB Type not AutoJitter or FixedOffset") image.image = np.asarray(hdul[k].data, dtype='float64') image.shape = image.image.shape image.wcs = w