Skip to content

Commit 20fa7a7

Browse files
committed
starting year 1 survey
1 parent acb58a2 commit 20fa7a7

File tree

3 files changed

+120
-2
lines changed

3 files changed

+120
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LSST observing cadence experiments
1515
| tight_mask | use a restrictive alt-az mask to force merdian scanning, try to force cadence (didn't work well) |
1616
| tight_mask_simple | Use a tight alt-az mask, only y in twilight. No 5-sigma depth used for filter selection |
1717
| tms_drive | tight mask, only y in twilight, no 5-sigma depth used for filter, added basis function to reward 2.1-5 day cadence in g,r,i |
18-
18+
| tms_roll | Like tight_mask_simple, adding rolling cadence |
19+
| year_1 | Work on a survey that does a good job in year 1 closing sky and gathering templates |
1920

2021
Results at: https://lsst-web.ncsa.illinois.edu/sim-data/beta_slair_surveys/

runs/tms_drive/tms_drive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
norm_factor=norm_factor))
4444
bfs.append(fs.Slewtime_basis_function(filtername=filtername, nside=nside))
4545
bfs.append(fs.Strict_filter_basis_function(filtername=filtername))
46-
bfs.append(fs.Cadence_enhance_basis_function(enhance_window=[2.1, 5.], nside=nside))
46+
bfs.append(fs.Cadence_enhance_basis_function(enhance_window=[2.1, 5.], apply_area=cadence_area,
47+
nside=nside))
4748
bfs.append(fs.Zenith_shadow_mask_basis_function(nside=nside, shadow_minutes=60., max_alt=76.))
4849
bfs.append(fs.North_south_patch_basis_function(zenith_min_alt=50., zenith_pad=20.,
4950
nside=nside))

runs/year_1/year1_surveys.py

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import numpy as np
2+
import lsst.sims.featureScheduler as fs
3+
from lsst.sims.speedObservatory import Speed_observatory
4+
import matplotlib.pylab as plt
5+
import healpy as hp
6+
from lsst.sims.skybrightness_pre import M5percentiles
7+
8+
9+
class Time_limit_basis_function(fs.Base_basis_function):
10+
"""Limit how long a survey can run with a basis function
11+
"""
12+
def __init__(self, mjd_start=None, day_max=365.25, day_min=0,
13+
survey_features=None, condition_features=None, **kwargs):
14+
"""
15+
Parameters
16+
----------
17+
day_max : float (365.25)
18+
19+
"""
20+
21+
self.mjd_start = mjd_start
22+
self.day_max = day_max
23+
self.day_min = day_min
24+
25+
if condition_features is None:
26+
self.condition_features = {}
27+
self.condition_features['Current_mjd'] = fs.features.Current_mjd()
28+
29+
def update_conditions(self, conditions):
30+
for feature in self.condition_features:
31+
self.condition_features[feature].update_conditions(conditions)
32+
# if we haven't set a start date, use the current conditions.
33+
# XXX-This might not be cold start compatible
34+
if self.mjd_start is None:
35+
self.mjd_start = self.condition_features['Current_mjd'].feature
36+
37+
def check_feasibility(self):
38+
39+
day = self.condition_features['Current_mjd'].feature - self.mjd_start
40+
if (day > self.day_max) | (day < self.day_min):
41+
result = False
42+
else:
43+
result = True
44+
return result
45+
46+
def __call__(self):
47+
return 0
48+
49+
50+
class Seeing_limit_basis_function(fs.Base_basis_function):
51+
def __init__(self, max_seeing=1.2, filtername='r', nside=None,
52+
survey_features=None, condition_features=None, **kwargs):
53+
"""
54+
Parameters
55+
----------
56+
max_seeing : float (365.25)
57+
58+
"""
59+
if nside is None:
60+
nside = fs.utils.set_default_nside()
61+
self.max_seeing = max_seeing
62+
self.filtername = filtername
63+
64+
if condition_features is None:
65+
self.condition_features = {}
66+
self.condition_features['Current_seeing'] = fs.features.Current_seeing(filtername=filtername,
67+
nside=nside)
68+
self.result_map = np.zeros(hp.nside2npix(self.nside))
69+
70+
def check_feasibility(self):
71+
if np.max(self()) == hp.UNSEEN:
72+
return False
73+
else:
74+
return True
75+
76+
def __call__(self):
77+
result = self.result_map.copy()
78+
poor_seeing = np.where(self.condition_features['Current_seeing'] > self.max_seeing)
79+
result[poor_seeing] = hp.UNSEEN
80+
return result
81+
82+
83+
class Nvis_limit_basis_function(fs.Seeing_limit_basis_function):
84+
"""Shut off observations after a given number of visits
85+
"""
86+
def __init__(self, ):
87+
pass
88+
89+
90+
class Limit_m5_percentile_basis_function(fs.Seeing_limit_basis_function):
91+
"""
92+
"""
93+
def __init__(self, percentile_limit=60., nside=None,
94+
survey_features=None, condition_features=None, **kwargs):
95+
96+
self.m5p = M5percentiles()
97+
98+
def __call__(self):
99+
pass
100+
101+
102+
103+
104+
def year_1_surveys(nside=32, mjd0=None):
105+
"""
106+
Generate a list of surveys for executing in year 1
107+
"""
108+
109+
filters = ['u', 'g', 'r', 'i', 'z', 'y']
110+
111+
112+
# Don't let observations be taken in the same night--maybe just set to 13 hours or something.
113+
fs.Avoid_Fast_Revists
114+
115+
# Maybe this would be a good time to invoke the percentile limit again! That way we won't take
116+
# images in really poor depth conditions.

0 commit comments

Comments
 (0)