Skip to content

Commit

Permalink
Address PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoBektesevic committed Jul 31, 2024
1 parent d02cf91 commit faa6eea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/kbmod/image_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 = [], []
Expand All @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions src/kbmod/work_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"])

Expand Down

0 comments on commit faa6eea

Please sign in to comment.