diff --git a/CHANGES.md b/CHANGES.md index 7af53bbf..90f0eaf3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,13 @@ Versions ======== +1.35.2 (2026-04-22) +------------------- + +- Add OBSGEO keywords to headers to suppress astropy warning +- Shortened comments in headers to prevent truncation +- Fixed path in alembic.ini + 1.35.1 (2026-04-20) ------------------- diff --git a/banzai/alembic.ini b/banzai/alembic.ini index 653cd033..f2951a9c 100644 --- a/banzai/alembic.ini +++ b/banzai/alembic.ini @@ -5,7 +5,7 @@ # this is typically a path given in POSIX (e.g. forward slashes) # format, relative to the token %(here)s which refers to the location of this # ini file -script_location = %(here)s +script_location = %(here)s/alembic # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the files to be prepended with date and time diff --git a/banzai/astrometry.py b/banzai/astrometry.py index b57434a5..7a5e7d4b 100755 --- a/banzai/astrometry.py +++ b/banzai/astrometry.py @@ -2,7 +2,7 @@ from requests import ConnectionError, HTTPError from astropy.wcs import WCS -from astropy.coordinates import SkyCoord +from astropy.coordinates import SkyCoord, EarthLocation from astropy import units import numpy as np @@ -95,6 +95,12 @@ def do_stage(self, image): def add_ra_dec_to_catalog(image): + if all(k in image.meta for k in ('OBSGEO-X', 'OBSGEO-Y', 'OBSGEO-Z')): + loc = EarthLocation.from_geocentric(image.meta['OBSGEO-X'], image.meta['OBSGEO-Y'], + image.meta['OBSGEO-Z'], unit=units.m) + image.meta['OBSGEO-L'] = loc.lon.deg, '[deg] Longitude of telescope, East positive' + image.meta['OBSGEO-B'] = loc.lat.deg, '[deg] Latitude or telescope, North positive' + image.meta['OBSGEO-H'] = loc.height.to(units.m).value, '[m] Height of telescope' image_wcs = WCS(image.meta) image_catalog = image['CAT'].data ras, decs = image_wcs.all_pix2world(image_catalog['x'], image_catalog['y'], 1) diff --git a/banzai/bpm.py b/banzai/bpm.py index 59d2ac14..a1600e5f 100644 --- a/banzai/bpm.py +++ b/banzai/bpm.py @@ -15,7 +15,7 @@ def apply_master_calibration(self, image, master_calibration_image): except: logger.error(f"Can't add BPM to image, stopping reduction: {format_exception()}", image=image) return None - image.meta['L1IDMASK'] = master_calibration_image.filename, 'Id. of mask file used' + image.meta['L1IDMASK'] = master_calibration_image.filename, 'ID of mask' return image def on_missing_master_calibration(self, image): diff --git a/banzai/readnoise.py b/banzai/readnoise.py index 00acd440..e8d5445e 100644 --- a/banzai/readnoise.py +++ b/banzai/readnoise.py @@ -13,7 +13,7 @@ def apply_master_calibration(self, image, master_calibration_image): except: logger.error(f"Can't add READNOISE to image, stopping reduction: {format_exception()}", image=image) return None - image.meta['L1IDRDN'] = master_calibration_image.filename, 'Id. of readnoise map file used' + image.meta['L1IDRDN'] = master_calibration_image.filename, 'Readnoise map' return image def on_missing_master_calibration(self, image): diff --git a/pyproject.toml b/pyproject.toml index e3eff30d..a124b58d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "lco-banzai" requires-python = ">=3.11,<4" -version = "1.35.1" +version = "1.35.2" description = "Python data reduction package for LCOGT data" authors = [ diff --git a/uv.lock b/uv.lock index 33b7ee2d..07477ce4 100644 --- a/uv.lock +++ b/uv.lock @@ -1164,7 +1164,7 @@ wheels = [ [[package]] name = "lco-banzai" -version = "1.35.1" +version = "1.35.2" source = { editable = "." } dependencies = [ { name = "alembic" },