Ejemplo n.º 1
0
def generate_greedy(nside):
    target_maps, norm_factor = generate_target_maps(nside)

    cloud_map = fs.generate_cloud_map(target_maps,
                                      filtername='i',
                                      wfd_cloud_max=0.7,
                                      scp_cloud_max=0.7,
                                      gp_cloud_max=0.7,
                                      nes_cloud_max=0.7)

    # filters = ['u', 'g', 'r', 'i', 'z', 'y']
    filters = ['g', 'r', 'i', 'z', 'y']
    surveys = []

    for filtername in filters:
        bfs = list()
        bfs.append(
            fs.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            fs.Target_map_basis_function(filtername=filtername,
                                         target_map=target_maps[filtername][0],
                                         out_of_bounds_val=hp.UNSEEN,
                                         nside=nside,
                                         norm_factor=norm_factor))
        bfs.append(
            fs.Aggressive_Slewtime_basis_function(filtername=filtername,
                                                  nside=nside,
                                                  order=6.,
                                                  hard_max=120.))
        bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
        bfs.append(
            fs.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=0.,
                                                 max_alt=76.))
        bfs.append(
            fs.Bulk_cloud_basis_function(max_cloud_map=cloud_map, nside=nside))
        bfs.append(
            fs.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        weights = np.array([3., 1., 3., 3., 0., 0, 0])
        surveys.append(
            fs.Greedy_survey_fields(bfs,
                                    weights,
                                    block_size=1,
                                    filtername=filtername,
                                    dither=True,
                                    nside=nside,
                                    tag_fields=True,
                                    tag_map=target_maps[filtername][1],
                                    tag_names=target_maps[filtername][2],
                                    ignore_obs='DD'))
    return surveys
Ejemplo n.º 2
0
                                            out_of_bounds_val=hp.UNSEEN, nside=nside,
                                            norm_factor=norm_factor))
    if filtername2 is not None:
        bfs.append(fs.Target_map_basis_function(filtername=filtername2,
                                                target_map=target_map[filtername2],
                                                out_of_bounds_val=hp.UNSEEN, nside=nside,
                                                norm_factor=norm_factor))
    bfs.append(fs.Slewtime_basis_function(filtername=filtername, nside=nside))
    bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
    bfs.append(fs.Cadence_enhance_basis_function(enhance_window=[2.1, 5.], apply_area=cadence_area,
                                                 nside=nside))
    bfs.append(fs.Zenith_shadow_mask_basis_function(nside=nside, shadow_minutes=60., max_alt=76.))
    bfs.append(fs.North_south_patch_basis_function(zenith_min_alt=50., zenith_pad=20.,
                                                   nside=nside))
    bfs.append(fs.Quadrant_basis_function(quadrants=['N', 'E', 'S'], azWidth=90.))
    bfs.append(fs.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
    bfs.append(fs.Bulk_cloud_basis_function(max_cloud_map=cloud_map, nside=nside))
    weights = np.array([0., 0.3, 0.3, 3., 1., 1., 0., 0., 0., 0., 0.])
    if filtername2 is None:
        # Need to scale weights up so filter balancing still works properly.
        weights = np.array([0., 0.6, 3., 1., 1., 0., 0., 0., 0., 0.])

    if filtername2 is None:
        survey_name = 'blob, %s' % filtername
    else:
        survey_name = 'blob, %s%s' % (filtername, filtername2)
    surveys.append(fs.Blob_survey(bfs, weights, filtername=filtername,
                                  filter2=filtername2,
                                  survey_note=survey_name, az_range=180.,
                                  search_radius=90, ignore_obs='DD'))
    pair_surveys.append(surveys[-1])
Ejemplo n.º 3
0
def generate_blob_surveys(nside):
    # Define what we want the final visit ratio map to look like

    target_maps, norm_factor = generate_target_maps(nside)

    # set up a cloud map
    cloud_map = target_maps['r'][0] * 0 + 0.7

    # Set up observations to be taken in blocks
    filter1s = ['u', 'g', 'r', 'i', 'z', 'y']
    filter2s = [None, 'g', 'r', 'i', None, None]

    pair_surveys = []
    for filtername, filtername2 in zip(filter1s, filter2s):
        bfs = []
        bfs.append(
            fs.M5_diff_basis_function(filtername=filtername, nside=nside))
        if filtername2 is not None:
            bfs.append(
                fs.M5_diff_basis_function(filtername=filtername2, nside=nside))
        bfs.append(
            fs.Target_map_basis_function(filtername=filtername,
                                         target_map=target_maps[filtername][0],
                                         out_of_bounds_val=hp.UNSEEN,
                                         nside=nside,
                                         norm_factor=norm_factor))
        if filtername2 is not None:
            bfs.append(
                fs.Target_map_basis_function(
                    filtername=filtername2,
                    target_map=target_maps[filtername2][0],
                    out_of_bounds_val=hp.UNSEEN,
                    nside=nside,
                    norm_factor=norm_factor))
        bfs.append(
            fs.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
        # Masks, give these 0 weight
        bfs.append(
            fs.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=60.,
                                                 max_alt=76.))
        bfs.append(
            fs.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        bfs.append(
            fs.Bulk_cloud_basis_function(max_cloud_map=cloud_map, nside=nside))
        weights = np.array([3.0, 3.0, .3, .3, 3., 3., 0., 0., 0.])
        if filtername2 is None:
            # Need to scale weights up so filter balancing still works properly.
            weights = np.array([6.0, 0.6, 3., 3., 0., 0., 0.])
        if filtername2 is None:
            survey_name = 'blob, %s' % filtername
        else:
            survey_name = 'blob, %s%s' % (filtername, filtername2)
        pair_surveys.append(
            fs.Blob_survey(bfs,
                           weights,
                           filtername=filtername,
                           filter2=filtername2,
                           survey_note=survey_name,
                           ignore_obs='DD',
                           tag_fields=True,
                           tag_map=target_maps[filtername][1],
                           tag_names=target_maps[filtername][2]))

    return pair_surveys
Ejemplo n.º 4
0
def year_1_surveys(nside=32, mjd0=None):
    """
    Generate a list of surveys for executing in year 1
    """

    nside = nside
    filters = ['u', 'g', 'r', 'i', 'z', 'y']

    target_map = large_target_map(nside, dec_max=34.3)
    norm_factor = fs.calc_norm_factor({'r': target_map})

    # set up a cloud map
    cloud_map = target_map * 0 + 0.7

    # Set up map m5-depth limits:
    m5_limits = {}
    percentile_cut = 0.7
    m52per = sb.M5percentiles()
    for filtername in filters:
        m5_limits[filtername] = m52per.percentile2m5map(percentile_cut,
                                                        filtername=filtername,
                                                        nside=nside)

    surveys = []

    for filtername in filters:
        bfs = []
        bfs.append(
            fs.M5_diff_basis_function(filtername=filtername, nside=nside))
        bfs.append(
            fs.Target_map_basis_function(filtername=filtername,
                                         target_map=target_map,
                                         out_of_bounds_val=hp.UNSEEN,
                                         nside=nside,
                                         norm_factor=norm_factor))

        bfs.append(
            fs.Slewtime_basis_function(filtername=filtername, nside=nside))
        bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
        bfs.append(
            fs.Zenith_shadow_mask_basis_function(nside=nside,
                                                 shadow_minutes=0.,
                                                 max_alt=76.))
        bfs.append(
            fs.Moon_avoidance_basis_function(nside=nside, moon_distance=40.))
        bfs.append(
            fs.Bulk_cloud_basis_function(max_cloud_map=cloud_map, nside=nside))
        weights = [3.0, 0.3, 3., 3., 0, 0., 0.]
        # add in some constriants to make sure we only observe in good conditions and shut off after 3 good ones
        bfs.append(
            Limit_m5_map_basis_function(m5_limits[filtername],
                                        nside=nside,
                                        filtername=filtername))
        bfs.append(
            Seeing_limit_basis_function(nside=nside, filtername=filtername))
        bfs.append(Time_limit_basis_function(day_max=365.25))
        # XXX--Do I need a m5-depth limit on here too?
        bfs.append(
            Nvis_limit_basis_function(nside=nside,
                                      filtername=filtername,
                                      n_limit=3,
                                      seeing_limit=1.2,
                                      time_lag=0.45,
                                      m5_limit_map=m5_limits[filtername]))
        weights.extend([0, 0, 0, 0])
        #weights.extend([0., 0., 0.])

        weights = np.array(weights)
        # Might want to try ignoring DD observations here, so the DD area gets covered normally--DONE
        surveys.append(
            fs.Greedy_survey_fields(bfs,
                                    weights,
                                    block_size=1,
                                    filtername=filtername,
                                    dither=True,
                                    nside=nside,
                                    ignore_obs='DD',
                                    survey_name='templates'))

    # Do we want to cover all the potential area LSST could observe? In case a GW goes off
    # in the north not in the NES.
    return surveys