def nes_light_footprints(nside=None):
    """
    A quick function to generate the "standard" goal maps. This is the traditional WFD/mini survey footprint.
    """

    NES_scaledown = 2.
    SCP_scaledown = 1.5

    result = {}
    result['u'] = generate_goal_map(nside=nside, NES_fraction=0./NES_scaledown,
                                    WFD_fraction=0.31, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    result['g'] = generate_goal_map(nside=nside, NES_fraction=0.2/NES_scaledown,
                                    WFD_fraction=0.44, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    result['r'] = generate_goal_map(nside=nside, NES_fraction=0.46/NES_scaledown,
                                    WFD_fraction=1.0, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    result['i'] = generate_goal_map(nside=nside, NES_fraction=0.46/NES_scaledown,
                                    WFD_fraction=1.0, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    result['z'] = generate_goal_map(nside=nside, NES_fraction=0.4/NES_scaledown,
                                    WFD_fraction=0.9, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    result['y'] = generate_goal_map(nside=nside, NES_fraction=0./NES_scaledown,
                                    WFD_fraction=0.9, SCP_fraction=0.15/SCP_scaledown,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5, wfd_dec_max=3.6)
    return result
def gp_smooth(nside=32):
    # Treat the galactic plane as just part of the WFD
    result = {}
    result['u'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.31,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.31)
    result['g'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.2,
                                    WFD_fraction=0.44,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.44)
    result['r'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=1.0)
    result['i'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=1.0)
    result['z'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.4,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.9)
    result['y'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.9)
    return result
Exemple #3
0
    def __init__(self, filtername='r', nside=default_nside, target_map=None,
                 survey_features=None, condition_features=None, norm_factor=0.00010519,
                 out_of_bounds_val=-10., mod_year=2, offset=0, mjd0=59580.035):
        """
        Parameters
        ----------
        filtername: (string 'r')
            The name of the filter for this target map.
        nside: int (default_nside)
            The healpix resolution.
        target_map : numpy array (None)
            A healpix map showing the ratio of observations desired for all points on the sky
        norm_factor : float (0.00010519)
            for converting target map to number of observations. Should be the area of the camera
            divided by the area of a healpixel divided by the sum of all your goal maps. Default
            value assumes LSST foV has 1.75 degree radius and the standard goal maps.
        out_of_bounds_val : float (-10.)
            Point value to give regions where there are no observations requested
        """
        if nside is None:
            nside = utils.set_default_nside()

        self.norm_factor = norm_factor
        if survey_features is None:
            survey_features = {}
            # Map of the number of observations in filter
            survey_features['N_obs'] = N_observations_mod(filtername=filtername,
                                                                        mod_year=mod_year,
                                                                        offset=offset,
                                                                        mjd0=mjd0, nside=nside)
            # Count of all the observations
            survey_features['N_obs_count_all'] = N_obs_count_mod(filtername=None,
                                                                               mod_year=mod_year,
                                                                               offset=offset,
                                                                               mjd0=mjd0)
        if condition_features is None:
            condition_features = {}
            condition_features['Current_mjd'] = features.Current_mjd()
        super(Target_map_modulo_basis_function, self).__init__(survey_features=survey_features,
                                                               condition_features=condition_features)
        self.nside = nside
        if target_map is None:
            self.target_map = utils.generate_goal_map(filtername=filtername)
        else:
            self.target_map = target_map
        self.out_of_bounds_area = np.where(self.target_map == 0)[0]
        self.out_of_bounds_val = out_of_bounds_val
        self.mjd0 = mjd0
        self.mod_year = mod_year
        self.offset = offset
def no_gp_north(nside=32):
    result = {}
    gl1 = 40.
    gl2 = 290.
    result['u'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.31,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)

    result['g'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.2,
                                    WFD_fraction=0.44,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)
    result['r'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)
    result['i'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)
    result['z'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.4,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)
    result['y'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.,
                                    gp_long1=gl1,
                                    gp_long2=gl2)
    return result
def big_wfd(nside=32):
    """
    A quick function to generate the "standard" goal maps. This is the traditional WFD/mini survey footprint.
    """
    wfd_dec_max = 20

    result = {}
    result['u'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.31,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    result['g'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.2,
                                    WFD_fraction=0.44,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    result['r'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    result['i'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    result['z'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.4,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    result['y'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=wfd_dec_max)
    return result
Exemple #6
0
def u_double_footprint(nside=None):
    """
    
    """

    result = {}
    result['u'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.67,
                                    SCP_fraction=0.30,
                                    GP_fraction=0.30,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    result['g'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.2,
                                    WFD_fraction=0.44,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    result['r'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    result['i'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    result['z'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.4,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    result['y'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    wfd_dec_min=-62.5,
                                    wfd_dec_max=3.6)
    return result
Exemple #7
0
def bluer_footprint(nside=32):
    """Try a bluer filter dist. May want to turn this into a larger parameter search.
    """

    result = {}
    result['u'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.31,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)
    # Turn up the g WFD
    result['g'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.2,
                                    WFD_fraction=0.9,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)
    result['r'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)
    result['i'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.46,
                                    WFD_fraction=1.0,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)
    # Turn down the z and y WFD
    result['z'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.4,
                                    WFD_fraction=0.7,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)
    result['y'] = generate_goal_map(nside=nside,
                                    NES_fraction=0.,
                                    WFD_fraction=0.7,
                                    SCP_fraction=0.15,
                                    GP_fraction=0.15,
                                    WFD_upper_edge_fraction=0.)

    return result
    def __init__(self,
                 day_offset=None,
                 filtername='r',
                 nside=None,
                 target_maps=None,
                 norm_factor=None,
                 out_of_bounds_val=-10.,
                 season_modulo=2,
                 max_season=None,
                 season_length=365.25):

        super(Target_map_modulo_basis_function,
              self).__init__(nside=nside, filtername=filtername)

        if norm_factor is None:
            warnings.warn(
                'No norm_factor set, use utils.calc_norm_factor if using multiple filters.'
            )
            self.norm_factor = 0.00010519
        else:
            self.norm_factor = norm_factor

        self.survey_features = {}
        # Map of the number of observations in filter

        for i, temp in enumerate(target_maps[0:-1]):
            self.survey_features['N_obs_%i' %
                                 i] = features.N_observations_season(
                                     i,
                                     filtername=filtername,
                                     nside=self.nside,
                                     modulo=season_modulo,
                                     offset=day_offset,
                                     max_season=max_season,
                                     season_length=season_length)
            # Count of all the observations taken in a season
            self.survey_features['N_obs_count_all_%i' %
                                 i] = features.N_obs_count_season(
                                     i,
                                     filtername=None,
                                     season_modulo=season_modulo,
                                     offset=day_offset,
                                     nside=self.nside,
                                     max_season=max_season,
                                     season_length=season_length)
        # Set the final one to be -1
        self.survey_features['N_obs_%i' % -1] = features.N_observations_season(
            -1,
            filtername=filtername,
            nside=self.nside,
            modulo=season_modulo,
            offset=day_offset,
            max_season=max_season,
            season_length=season_length)
        self.survey_features['N_obs_count_all_%i' %
                             -1] = features.N_obs_count_season(
                                 -1,
                                 filtername=None,
                                 season_modulo=season_modulo,
                                 offset=day_offset,
                                 nside=self.nside,
                                 max_season=max_season,
                                 season_length=season_length)
        if target_maps is None:
            self.target_maps = utils.generate_goal_map(filtername=filtername,
                                                       nside=self.nside)
        else:
            self.target_maps = target_maps
        # should probably actually loop over all the target maps?
        self.out_of_bounds_area = np.where(self.target_maps[0] == 0)[0]
        self.out_of_bounds_val = out_of_bounds_val
        self.result = np.zeros(hp.nside2npix(self.nside), dtype=float)
        self.all_indx = np.arange(self.result.size)

        # For computing what day each healpix is on
        if day_offset is None:
            self.day_offset = np.zeros(hp.nside2npix(self.nside), dtype=float)
        else:
            self.day_offset = day_offset

        self.season_modulo = season_modulo
        self.max_season = max_season
        self.season_length = season_length
Exemple #9
0
                           filtername1=filtername,
                           filtername2=filtername2,
                           survey_note=survey_name,
                           ignore_obs='DD',
                           dither=True))
    pair_surveys.append(surveys[-1])

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

greedy_target_map = standard_goals(nside=nside)
# Let's take out the NES area on the target maps. This way we won't
# take images in the NES that aren't paired.
temp_map = generate_goal_map(nside=nside,
                             NES_fraction=1.,
                             WFD_fraction=0,
                             SCP_fraction=0,
                             GP_fraction=0,
                             WFD_upper_edge_fraction=0.)
nes_pix = np.where(temp_map == 1)
for filtername in greedy_target_map:
    greedy_target_map[filtername][nes_pix] = 0

greedy_surveys = []
for filtername in filters:
    bfs = []
    bfs.append(
        basis_functions.M5_diff_basis_function(filtername=filtername,
                                               nside=nside))
    bfs.append(
        basis_functions.Target_map_basis_function(
            filtername=filtername,
Exemple #10
0
    for arg in sys.argv:
        exec_command += ' ' + arg
    extra_info['exec command'] = exec_command
    try:
        extra_info['git hash'] = subprocess.check_output(
            ['git', 'rev-parse', 'HEAD'])
    except subprocess.CalledProcessError:
        extra_info['git hash'] = 'Not in git repo'

    extra_info['file executed'] = os.path.realpath(__file__)

    fileroot = 'wfd_vary_fp%i' % fp
    file_end = 'v1.4_'

    gp_only = generate_goal_map(NES_fraction=.0,
                                WFD_fraction=0.,
                                SCP_fraction=0.0,
                                GP_fraction=0.2)

    nes_scp = generate_goal_map(NES_fraction=.1,
                                WFD_fraction=0.,
                                SCP_fraction=0.1,
                                GP_fraction=0.0)

    gp_pix = np.where(gp_only > 0)[0]
    nes_pix = np.where(nes_scp > 0)[0]

    # Baseline footprint
    if fp == 1:
        footprints = standard_goals()
    # Let's wipe out the GP
    if fp == 2: