From faa6eea9707e91913cd645303fdfe6d4375be03c Mon Sep 17 00:00:00 2001 From: DinoBektesevic Date: Wed, 31 Jul 2024 12:34:29 -0700 Subject: [PATCH] Address PR comments. --- src/kbmod/image_collection.py | 17 +++++++---------- src/kbmod/work_unit.py | 4 ++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/kbmod/image_collection.py b/src/kbmod/image_collection.py index cfbadd75..ae245279 100644 --- a/src/kbmod/image_collection.py +++ b/src/kbmod/image_collection.py @@ -419,7 +419,8 @@ def __eq__(self, other): if len(self.data) != len(other.data): return False - # before we compare the entire tables (minus WCS, not comparable) + # before we compare the entire tables + # WCS not comparable, BBox not compared cols = [col for col in self.columns if col not in ("wcs", "bbox")] # I think it's a bug in AstropyTables, but this sometimes returns # a boolean instead of an array of booleans (only when False) @@ -608,14 +609,14 @@ def read( Parameters ---------- *args : tuple, optional - Positional arguments passed through to data writer. If supplied the - first argument is the output filename. + Positional arguments passed through to data reader. If supplied the + first argument is the input filename. format : `str` File format specified, one of AstroPy IO formats that must support comments. Default: `ascii.ecsv` units : `list` List or dict of units to apply to columns. - descriptions : `list``` + descriptions : `list` List or dict of descriptions to apply to columns unpack : `bool` If reading a packed image collection, unpack the shared values. @@ -783,6 +784,7 @@ def vstack(self, ics): ic : `ImageCollection` Extended image collection. """ + self.unpack() std_offset = self.meta["n_stds"] old_metas, old_offsets = [], [] @@ -798,12 +800,7 @@ def vstack(self, ics): if ic._standardizers is not None: self._standardizers.extend(ic._standardizers) else: - self._standardizers.extend( - [ - None, - ] - * n_stds - ) + self._standardizers.extend([None] * n_stds) std_offset += n_stds self.data = vstack([self.data, *data], metadata_conflicts="silent") diff --git a/src/kbmod/work_unit.py b/src/kbmod/work_unit.py index e21a639b..33d26f03 100644 --- a/src/kbmod/work_unit.py +++ b/src/kbmod/work_unit.py @@ -85,11 +85,13 @@ def __init__( per_image_indices=None, lazy=False, file_paths=None, + obstimes=None, ): self.im_stack = im_stack self.config = config self.lazy = lazy self.file_paths = file_paths + self._obstimes = obstimes # Handle WCS input. If both the global and per-image WCS are provided, # ensure they are consistent. @@ -249,6 +251,8 @@ def from_fits(cls, filename): if num_layers < 5: raise ValueError(f"WorkUnit file has too few extensions {len(hdul)}.") + # TODO - Read in provenance metadata from extension #1. + # Read in the search parameters from the 'kbmod_config' extension. config = SearchConfiguration.from_hdu(hdul["kbmod_config"])