oracle.custom_datasets.BTS
Custom dataset class for the ZTF Bright Transient Survey light curve dataset.
Functions
|
Collate function for batching BTS dataset samples. This function takes a list of sample dictionaries and collates them into a single batch dictionary suitable for training or inference. It pads the time-series data, concatenates static and meta features, and properly stacks optional image data (postage_stamp and lc_plot) if they are present in the sample dictionaries. :param batch: A list where each element is a dictionary containing the following keys: Required keys: - 'ts' (numpy.ndarray): Time-series data for the sample. - 'label': Label corresponding to the sample. - 'ZTFID': Identifier for the sample. - 'bts_class': Raw label or class of the sample. - 'meta' (numpy.ndarray): Meta features array from which the last row is used. - 'static' (numpy.ndarray): Static features for the sample. Optional keys: - 'postage_stamp': Tensor representing the postage stamp image. - 'lc_plot': Tensor representing the light curve plot image. :type batch: list of dict. |
|
Display a grid of images with corresponding labels. |
Truncate the BTS light curve based on the number of days since the first trigger. |
Classes
|
A custom PyTorch Dataset class for handling BTS light curve data stored in a parquet file. |