Example #1
0
    def testMeridianStripeBasisFunction(self):
        """Basic test for the MeridianStripeBasisFunction. Just make sure the default parameter returns a mask
        with observable regions.
        """

        bf = fs.MeridianStripeBasisFunction()

        mjd = 59000.
        altaz_feature = fs.AltAzFeature()

        site = fs.Site(name='LSST')
        lmst, last = fs.calcLmstLast(mjd, site.longitude_rad)
        lmst_feature = fs.Current_lmst()
        conditions = {'altaz': altaz_feature, 'lmst': lmst, 'mjd': mjd}

        lmst_feature.update_conditions(conditions)
        altaz_feature.update_conditions(conditions=conditions)

        bf.update_conditions(conditions)

        mask = bf()

        # Just check that the default mask has valid values. In the future could add a mask here and make sure they
        # are the same.
        self.assertTrue(np.any(mask == 1.))
Example #2
0
target_maps['y'] = fs.generate_goal_map(NES_fraction=0.,
                                        WFD_fraction=0.9, SCP_fraction=0.15,
                                        GP_fraction=0.15, nside=nside,
                                        generate_id_map=True)

filters = ['u', 'g', 'r', 'i', 'z', 'y']
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_maps[filtername][0],
                                            out_of_bounds_val=hp.UNSEEN, nside=nside))

    bfs.append(fs.MeridianStripeBasisFunction(nside=nside, width=(8.,)))
    bfs.append(fs.Slewtime_basis_function(filtername=filtername, nside=nside))
    bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
    bfs.append(fs.Avoid_Fast_Revists(filtername=filtername, gap_min=240., nside=nside))

    weights = np.array([3.0, 0.5, 1., 3., 3., 3.])
    # surveys.append(fs.Greedy_survey_fields(bfs, weights, block_size=1, filtername=filtername, dither=False,
    #                                        nside=nside, smoothing_kernel=9,
    #                                        tag_fields=True, tag_map=target_maps[filtername][1]))
    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]))

# Set up pairs