target_map=target_map[filtername], 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'))
if __name__ == "__main__": az_widths = [15., 30.] for az_width in az_widths: outdir = 'y_march_south_%i' % az_width survey_length = 366 # days # Define what we want the final visit ratio map to look like target_map = fs.standard_goals()['y'] bfs = [] # Target number of observations bfs.append( fs.Target_map_basis_function(filtername='y', target_map=target_map)) # Mask everything but the South bfs.append( fs.Quadrant_basis_function(quadrants=['S'], azWidth=az_width)) # throw in the depth percentile for good measure bfs.append(fs.Depth_percentile_basis_function()) weights = np.array([1., 1., 1.]) survey = fs.Marching_army_survey(bfs, weights, npick=40) scheduler = fs.Core_scheduler([survey]) observatory = Speed_observatory() observatory, scheduler, observations = fs.sim_runner( observatory, scheduler, survey_length=survey_length, filename=outdir + '/y_marching_south_%i.db' % az_width) title = 'az width %i' % az_width
import numpy as np import lsst.sims.featureScheduler as fs from lsst.sims.speedObservatory import Speed_observatory import healpy as hp if __name__ == "__main__": survey_length = 5 # days # Define what we want the final visit ratio map to look like target_map = fs.standard_goals()['r'] bfs = [] bfs.append(fs.Depth_percentile_basis_function()) bfs.append(fs.Target_map_basis_function(target_map=target_map)) bfs.append(fs.Quadrant_basis_function()) bfs.append(fs.Slewtime_basis_function()) weights = np.array([.5, 1., 1., 1.]) survey = fs.Simple_greedy_survey_fields(bfs, weights, block_size=1) scheduler = fs.Core_scheduler([survey]) observatory = Speed_observatory() observatory, scheduler, observations = fs.sim_runner( observatory, scheduler, survey_length=survey_length, filename='marching_d%i.db' % survey_length, delete_past=True) # block_size=10, surveylength of 365 had runtime of 163 min. and got 0.26e6 observations. So, 10 years would be 27 hours. # Going to block_size=1, runtime of 211 min, and 0.33e6 observations. So, 35 hours. Not too shabby!
# No pairs # Greedy selection of opsim fields if __name__ == "__main__": survey_length = 365.25 # days # Define what we want the final visit ratio map to look like target_map = fs.standard_goals()['r'] filtername = 'r' bfs = [] bfs.append(fs.M5_diff_basis_function(filtername=filtername, teff=False)) bfs.append(fs.Target_map_basis_function(target_map=target_map, filtername=filtername, out_of_bounds_val=hp.UNSEEN)) bfs.append(fs.Quadrant_basis_function(quadrants='N', azWidth=15.)) bfs.append(fs.Slewtime_basis_function(filtername=filtername)) weights = np.array([1., 0.2, 1., 2.]) survey = fs.Greedy_survey_fields(bfs, weights, block_size=1, filtername=filtername) scheduler = fs.Core_scheduler([survey]) observatory = Speed_observatory() observatory, scheduler, observations = fs.sim_runner(observatory, scheduler, survey_length=survey_length, filename='one_filter_north.db', delete_past=True) # real 438m51.454s # user 433m27.425s # sys 2m3.193s
if __name__ == "__main__": survey_length = 365.25 # days # Define what we want the final visit ratio map to look like target_map = fs.standard_goals()['r'] filtername = 'r' bfs = [] bfs.append(fs.M5_diff_basis_function(filtername=filtername, teff=False)) bfs.append( fs.Target_map_basis_function(target_map=target_map, filtername=filtername, out_of_bounds_val=hp.UNSEEN)) bfs.append( fs.Quadrant_basis_function(quadrants='S', azWidth=15., maxAlt=75.)) bfs.append(fs.Slewtime_basis_function(filtername=filtername)) weights = np.array([1., 0.2, 1., 4.]) survey = fs.Greedy_survey_fields(bfs, weights, block_size=1, filtername=filtername) scheduler = fs.Core_scheduler([survey]) observatory = Speed_observatory() observatory, scheduler, observations = fs.sim_runner( observatory, scheduler, survey_length=survey_length, filename='one_filter_south.db',