Example #1
0
 def __init__(self, frac_total, survey_name=''):
     super(Fraction_of_obs_basis_function, self).__init__()
     self.survey_name = survey_name
     self.frac_total = frac_total
     self.survey_features['Ntot'] = features.N_obs_survey()
     self.survey_features['N_survey'] = features.N_obs_survey(
         note=self.survey_name)
Example #2
0
 def __init__(self, fractions=[0.000, 0.009, 0.017], delays=[0., 0.5, 1.5], survey_name=None):
     if len(fractions) != len(delays):
         raise ValueError('fractions and delays must be same length')
     super(Soft_delay_basis_function, self).__init__()
     self.delays = delays
     self.survey_name = survey_name
     self.survey_features['last_obs_self'] = features.Last_observation(survey_name=self.survey_name)
     self.fractions = fractions
     self.survey_features['Ntot'] = features.N_obs_survey()
     self.survey_features['N_survey'] = features.N_obs_survey(note=self.survey_name)
    def __init__(self, basis_functions, RA, dec, sequence='rgizy',
                 nvis=[20, 10, 20, 26, 20],
                 exptime=30., u_exptime=30., nexp=2, ignore_obs=None, survey_name='DD',
                 reward_value=None, readtime=2., filter_change_time=120.,
                 nside=None, flush_pad=30., seed=42, detailers=None):
        super(Deep_drilling_survey, self).__init__(nside=nside, basis_functions=basis_functions,
                                                   detailers=detailers, ignore_obs=ignore_obs)
        random.seed(a=seed)

        self.ra = np.radians(RA)
        self.ra_hours = RA/360.*24.
        self.dec = np.radians(dec)
        self.survey_name = survey_name
        self.reward_value = reward_value
        self.flush_pad = flush_pad/60./24.  # To days
        self.filter_sequence = []
        if type(sequence) == str:
            self.observations = []
            for num, filtername in zip(nvis, sequence):
                for j in range(num):
                    obs = empty_observation()
                    obs['filter'] = filtername
                    if filtername == 'u':
                        obs['exptime'] = u_exptime
                    else:
                        obs['exptime'] = exptime
                    obs['RA'] = self.ra
                    obs['dec'] = self.dec
                    obs['nexp'] = nexp
                    obs['note'] = survey_name
                    self.observations.append(obs)
        else:
            self.observations = sequence

        # Let's just make this an array for ease of use
        self.observations = np.concatenate(self.observations)
        order = np.argsort(self.observations['filter'])
        self.observations = self.observations[order]

        n_filter_change = np.size(np.unique(self.observations['filter']))

        # Make an estimate of how long a seqeunce will take. Assumes no major rotational or spatial
        # dithering slowing things down.
        self.approx_time = np.sum(self.observations['exptime']+readtime*self.observations['nexp'])/3600./24. \
                           + filter_change_time*n_filter_change/3600./24.  # to days

        if self.reward_value is None:
            self.extra_features['Ntot'] = features.N_obs_survey()
            self.extra_features['N_survey'] = features.N_obs_survey(note=self.survey_name)
Example #4
0
 def __init__(self, frac_total, aggressive_fraction, time_needed=30., RA=0.,
              ha_limits=None, survey_name='', time_jump=44., sun_alt_limit=-18.):
     super(Look_ahead_ddf_basis_function, self).__init__()
     if aggressive_fraction > frac_total:
         raise ValueError('aggressive_fraction should be less than frac_total')
     self.survey_name = survey_name
     self.frac_total = frac_total
     self.ra_hours = RA/360.*24.
     self.HA_limits = np.array(ha_limits)
     self.sun_alt_limit = str(int(sun_alt_limit)).replace('-', 'n')
     self.time_jump = time_jump / 60. / 24.  # To days
     self.time_needed = time_needed / 60. / 24.  # To days
     self.aggressive_fraction = aggressive_fraction
     self.survey_features['Ntot'] = features.N_obs_survey()
     self.survey_features['N_survey'] = features.N_obs_survey(note=self.survey_name)