Ejemplo n.º 1
0
    def __init__(self, passbands=('g', 'r'), contextual_info=('redshift',), nobs=50, mintime=-70, maxtime=80,
                 timestep=3.0, reread_data=False, bcut=True, zcut=None, ignore_classes=(), class_name_map=None,
                 nchunks=10000, training_set_dir='data/training_set_files', data_dir='data/ZTF_20190512/',
                 save_dir='data/saved_light_curves/', get_data_func=None, augment_data=False, redo_processing=False):
        PrepareArrays.__init__(self, passbands, contextual_info, nobs, mintime, maxtime, timestep)
        self.reread_data = reread_data
        self.redo_processing = redo_processing
        self.bcut = bcut
        self.zcut = zcut
        self.ignore_classes = ignore_classes
        self.nchunks = nchunks
        self.training_set_dir = training_set_dir
        self.data_dir = data_dir
        self.save_dir = save_dir
        self.light_curves = {}
        self.get_data_func = get_data_func
        self.augment_data = augment_data
        if 'redshift' in contextual_info:
            self.known_redshift = True
        else:
            self.known_redshift = False
        if class_name_map is None:
            self.class_name_map = helpers.get_sntypes()
        else:
            self.class_name_map = class_name_map

        if not os.path.exists(self.training_set_dir):
            os.makedirs(self.training_set_dir)
Ejemplo n.º 2
0
 def __init__(self,
              passbands=('g', 'r'),
              contextual_info=('redshift', ),
              bcut=True,
              zcut=None,
              nobs=50,
              mintime=-70,
              maxtime=80,
              timestep=3.0):
     PrepareArrays.__init__(self, passbands, contextual_info, nobs, mintime,
                            maxtime, timestep)
     self.bcut = bcut
     self.zcut = zcut
Ejemplo n.º 3
0
    def __init__(self,
                 passbands=('g', 'r'),
                 contextual_info=('redshift', ),
                 nobs=50,
                 mintime=-70,
                 maxtime=80,
                 timestep=3.0,
                 reread_data=False,
                 bcut=True,
                 zcut=None,
                 ignore_classes=(),
                 class_name_map=None,
                 nchunks=10000,
                 training_set_dir='data/training_set_files',
                 data_dir='data/ZTF_20190512/',
                 save_dir='data/saved_light_curves/',
                 get_data_func=None,
                 augment_data=False,
                 redo_processing=False,
                 spline_interp=True,
                 **kwargs):
        self.spline_interp = spline_interp
        PrepareArrays.__init__(self,
                               passbands,
                               contextual_info,
                               nobs,
                               mintime,
                               maxtime,
                               timestep,
                               spline_interp=self.spline_interp)
        self.reread_data = reread_data
        self.redo_processing = redo_processing
        self.bcut = bcut
        self.zcut = zcut
        self.ignore_classes = ignore_classes
        self.nchunks = nchunks
        self.training_set_dir = training_set_dir
        self.data_dir = data_dir
        self.save_dir = save_dir
        self.light_curves = {}
        self.get_data_func = get_data_func
        self.augment_data = augment_data
        self.calculate_t0 = True
        if 'redshift' in contextual_info:
            self.known_redshift = True
        else:
            self.known_redshift = False
        if kwargs['PLAsTiCC'] and class_name_map is None:
            self.class_name_map = helpers.get_sntypes_PLAsTiCC()
        elif class_name_map is None:
            self.class_name_map = helpers.get_sntypes()
        else:
            self.class_name_map = class_name_map

        if not os.path.exists(self.training_set_dir):
            os.makedirs(self.training_set_dir)
        if 'calculate_t0' in kwargs.keys():
            self.calculate_t0 = kwargs['calculate_t0']
        if 'single_class' in kwargs.keys():
            self.single_class = kwargs['single_class']
        else:
            self.single_class = False