hyrax.datasets.lsst_dataset#
Attributes#
Classes#
LSSTDataset: A dataset to access deep_coadd images from lsst pipelines |
Module Contents#
- class LSSTDataset(config, data_location=None)[source]#
Bases:
hyrax.datasets.dataset_registry.HyraxDataset,hyrax.datasets.dataset_registry.HyraxImageDataset,torch.utils.data.DatasetLSSTDataset: A dataset to access deep_coadd images from lsst pipelines via the butler. Must be run in an RSP.
Initialize the dataset with either a HATS catalog or astropy table.
Config can specify either: - config[“data_set”][“hats_catalog”]: path to HATS catalog - config[“data_set”][“astropy_table”]: path to any file readable by Astropy Table
- _get_butler_thread_safe()[source]#
Thread safe butler creation
This function ensures that there is one and only one butler created per thread and that threads always use their assigned butler.
This is necessary because child classes of this one use butlers, and butler objects are not safe for multithreaded access.
- Returns:
The butler assigned to the current thread.
- Return type:
butler
- _load_catalog(data_set_config)[source]#
Load the catalog from either a HATS catalog or an astropy table.
- _load_astropy_catalog(table_path)[source]#
Load catalog from astropy table format or pickled astropy table.
- get_image(idxs)[source]#
Get image cutouts for the given indices.
- Parameters:
idxs (int or list of int) – The index or indices of the cutouts to retrieve.
- Returns:
Single cutout tensor or list of cutout tensors.
- Return type:
list or torch.Tensor
- __getitem__(idxs)[source]#
Get default data fields for the this dataset.
- Parameters:
idxs (int or list of int) – The index or indices of the cutouts to retrieve.
- Returns:
A dictionary containing the default data fields.
- Return type:
dict
- _parse_box(patch, row)[source]#
Return a Box2I representing the desired cutout in pixel space, given a “row” of catalog data which includes the semi-height (sh) and semi-width (sw) in degrees desired for the cutout.
- _parse_sphere_point(row)[source]#
Return a SpherePoint with the ra and deck given in the “row” of catalog data. Row must include the RA and dec as “ra” and “dec” columns respectively
- _get_tract_patch(row)[source]#
Return (tractInfo, patchInfo) for a given row.
This function only returns the single principle tract and patch in the case of overlap.