Exemple #1
0
def gen_greedy_surveys(nside, nexp=1):
    """
    Make a quick set of greedy surveys
    """
    target_map = standard_goals(nside=nside)
    norm_factor = calc_norm_factor(target_map)
    wfd_halves = wfd_half()
    # Let's remove the bluer filters since this should only be near twilight
    filters = ['r', 'i', 'z', 'y']
    surveys = []

    detailer = detailers.Camera_rot_detailer(min_rot=-87., max_rot=87.)

    for filtername in filters:
        bfs = []
        bfs.append(
            bf.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            bf.Target_map_basis_function(filtername=filtername,
                                         target_map=target_map[filtername],
                                         out_of_bounds_val=np.nan,
                                         nside=nside,
                                         norm_factor=norm_factor))
        bfs.append(
            bf.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(bf.Strict_filter_basis_function(filtername=filtername))
        bfs.append(bf.Map_modulo_basis_function(wfd_halves))
        # Masks, give these 0 weight
        bfs.append(
            bf.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=60.,
                                                 max_alt=76.))
        bfs.append(
            bf.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))

        bfs.append(bf.Filter_loaded_basis_function(filternames=filtername))
        bfs.append(bf.Planet_mask_basis_function(nside=nside))

        weights = np.array([3.0, 0.3, 3., 3., 3., 0., 0., 0., 0.])
        surveys.append(
            Greedy_survey(bfs,
                          weights,
                          block_size=1,
                          filtername=filtername,
                          dither=True,
                          nside=nside,
                          ignore_obs='DD',
                          nexp=nexp,
                          detailers=[detailer]))

    return surveys
Exemple #2
0
def gen_greedy_surveys(nside,
                       nexp=1,
                       m5w=3.,
                       footprintw=0.3,
                       sleww=3.,
                       fcw=3.):
    """
    Make a quick set of greedy surveys
    """
    target_map = standard_goals(nside=nside)
    norm_factor = calc_norm_factor(target_map)
    # Let's remove the bluer filters since this should only be near twilight
    filters = ['r', 'i', 'z', 'y']
    surveys = []

    for filtername in filters:
        bfs = []
        bfs.append(
            bf.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            bf.Target_map_basis_function(filtername=filtername,
                                         target_map=target_map[filtername],
                                         out_of_bounds_val=np.nan,
                                         nside=nside,
                                         norm_factor=norm_factor))
        bfs.append(
            bf.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(bf.Strict_filter_basis_function(filtername=filtername))
        # Masks, give these 0 weight
        bfs.append(
            bf.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=60.,
                                                 max_alt=76.))
        bfs.append(
            bf.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        bfs.append(bf.Clouded_out_basis_function())

        bfs.append(bf.Filter_loaded_basis_function(filternames=filtername))

        weights = np.array([m5w, footprintw, sleww, fcw, 0., 0., 0., 0.])
        surveys.append(
            Greedy_survey(bfs,
                          weights,
                          block_size=1,
                          filtername=filtername,
                          dither=True,
                          nside=nside,
                          ignore_obs='DD',
                          nexp=nexp))

    return surveys
Exemple #3
0
def gen_greedy_surveys(nside, add_DD=True):
    """
    Make a quick set of greedy surveys
    """
    target_map = standard_goals(nside=nside)
    norm_factor = calc_norm_factor(target_map)
    filters = ['u', 'g', 'r', 'i', 'z', 'y']
    surveys = []

    for filtername in filters:
        bfs = []
        bfs.append(
            bf.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            bf.Target_map_basis_function(filtername=filtername,
                                         target_map=target_map[filtername],
                                         out_of_bounds_val=np.nan,
                                         nside=nside,
                                         norm_factor=norm_factor))
        bfs.append(
            bf.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(bf.Strict_filter_basis_function(filtername=filtername))
        # Masks, give these 0 weight
        bfs.append(
            bf.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=60.,
                                                 max_alt=76.))
        bfs.append(
            bf.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        bfs.append(bf.Clouded_out_basis_function())

        bfs.append(bf.Filter_loaded_basis_function(filternames=filtername))

        weights = np.array([3.0, 0.3, 3., 3., 0., 0., 0., 0.])
        surveys.append(
            Greedy_survey(bfs,
                          weights,
                          block_size=1,
                          filtername=filtername,
                          dither=True,
                          nside=nside,
                          ignore_obs='DD'))

    surveys.append(Pairs_survey_scripted(None, ignore_obs='DD'))
    if add_DD:
        dd_surveys = generate_dd_surveys(nside=nside)

    surveys.extend(dd_surveys)

    return surveys
Exemple #4
0
def gen_greedy_surveys(nside):
    """
    Make a quick set of greedy surveys
    """
    target_map = standard_goals(nside=nside)
    filters = ['g', 'r', 'i', 'z', 'y']
    surveys = []
    cloud_map = target_map['r'][0] * 0 + 0.7

    for filtername in filters:
        bfs = []
        bfs.append(
            bf.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            bf.Target_map_basis_function(filtername=filtername,
                                         target_map=target_map[filtername],
                                         out_of_bounds_val=np.nan,
                                         nside=nside))
        bfs.append(
            bf.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(bf.Strict_filter_basis_function(filtername=filtername))
        # Masks, give these 0 weight
        bfs.append(
            bf.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=60.,
                                                 max_alt=76.))
        bfs.append(
            bf.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        bfs.append(
            bf.Bulk_cloud_basis_function(max_cloud_map=cloud_map, nside=nside))

        bfs.append(bf.Filter_loaded_basis_function(filternames=filtername))

        weights = np.array([3.0, 0.3, 3., 3., 0., 0., 0., 0.])
        surveys.append(
            Greedy_survey(bfs,
                          weights,
                          block_size=1,
                          filtername=filtername,
                          dither=True,
                          nside=nside))
    return surveys
Exemple #5
0
def gen_greedy_surveys(nside=32,
                       nexp=1,
                       exptime=30.,
                       filters=['r', 'i', 'z', 'y'],
                       camera_rot_limits=[-80., 80.],
                       shadow_minutes=60.,
                       max_alt=76.,
                       moon_distance=30.,
                       ignore_obs='DD',
                       m5_weight=3.,
                       footprint_weight=0.3,
                       slewtime_weight=3.,
                       stayfilter_weight=3.,
                       footprints=None):
    """
    Make a quick set of greedy surveys

    This is a convienence function to generate a list of survey objects that can be used with
    lsst.sims.featureScheduler.schedulers.Core_scheduler.
    To ensure we are robust against changes in the sims_featureScheduler codebase, all kwargs are
    explicitly set.

    Parameters
    ----------
    nside : int (32)
        The HEALpix nside to use
    nexp : int (1)
        The number of exposures to use in a visit.
    exptime : float (30.)
        The exposure time to use per visit (seconds)
    filters : list of str (['r', 'i', 'z', 'y'])
        Which filters to generate surveys for.
    camera_rot_limits : list of float ([-80., 80.])
        The limits to impose when rotationally dithering the camera (degrees).
    shadow_minutes : float (60.)
        Used to mask regions around zenith (minutes)
    max_alt : float (76.
        The maximium altitude to use when masking zenith (degrees)
    moon_distance : float (30.)
        The mask radius to apply around the moon (degrees)
    ignore_obs : str or list of str ('DD')
        Ignore observations by surveys that include the given substring(s).
    m5_weight : float (3.)
        The weight for the 5-sigma depth difference basis function
    footprint_weight : float (0.3)
        The weight on the survey footprint basis function.
    slewtime_weight : float (3.)
        The weight on the slewtime basis function
    stayfilter_weight : float (3.)
        The weight on basis function that tries to stay avoid filter changes.
    """
    # Define the extra parameters that are used in the greedy survey. I
    # think these are fairly set, so no need to promote to utility func kwargs
    greed_survey_params = {
        'block_size': 1,
        'smoothing_kernel': None,
        'seed': 42,
        'camera': 'LSST',
        'dither': True,
        'survey_name': 'greedy'
    }

    surveys = []
    detailer = detailers.Camera_rot_detailer(min_rot=np.min(camera_rot_limits),
                                             max_rot=np.max(camera_rot_limits))

    for filtername in filters:
        bfs = []
        bfs.append((bf.M5_diff_basis_function(filtername=filtername,
                                              nside=nside), m5_weight))
        bfs.append(
            (bf.Footprint_basis_function(filtername=filtername,
                                         footprint=footprints,
                                         out_of_bounds_val=np.nan,
                                         nside=nside), footprint_weight))
        bfs.append((bf.Slewtime_basis_function(filtername=filtername,
                                               nside=nside), slewtime_weight))
        bfs.append((bf.Strict_filter_basis_function(filtername=filtername),
                    stayfilter_weight))
        # Masks, give these 0 weight
        bfs.append((bf.Zenith_shadow_mask_basis_function(
            nside=nside, shadow_minutes=shadow_minutes, max_alt=max_alt), 0))
        bfs.append(
            (bf.Moon_avoidance_basis_function(nside=nside,
                                              moon_distance=moon_distance), 0))

        bfs.append(
            (bf.Filter_loaded_basis_function(filternames=filtername), 0))
        bfs.append((bf.Planet_mask_basis_function(nside=nside), 0))

        weights = [val[1] for val in bfs]
        basis_functions = [val[0] for val in bfs]
        surveys.append(
            Greedy_survey(basis_functions,
                          weights,
                          exptime=exptime,
                          filtername=filtername,
                          nside=nside,
                          ignore_obs=ignore_obs,
                          nexp=nexp,
                          detailers=[detailer],
                          **greed_survey_params))

    return surveys