Skip to content

Commit

Permalink
update tests for new start date
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Nov 22, 2024
1 parent f2b7618 commit c6b06a7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/scheduler/test_comcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_comcam(self):
# Specify the HEALpix resolution we want to do everything in.
# Need to turn up for comcam
nside = 512
mo = ModelObservatory(nside=nside)
mo = ModelObservatory(nside=nside, downtimes="ideal", cloud_data="ideal")
conditions = mo.return_conditions()

# Let's start out with a simple 2-band footprint where
Expand All @@ -34,7 +34,7 @@ def test_comcam(self):
fp.set_footprint(filtername, simple_fp[filtername])

footprint_weight = 1.0
m5_weight = 0.5
m5_weight = 0.0

detailers = []

Expand Down Expand Up @@ -70,7 +70,7 @@ def test_comcam(self):

scheduler = CoreScheduler([red_survey, blue_survey], nside=nside, camera="comcam")

mo, scheduler, observations = sim_runner(mo, scheduler, sim_duration=0.25, verbose=True)
mo, scheduler, observations = sim_runner(mo, scheduler, sim_duration=0.5, verbose=True)

assert len(observations) > 100
assert np.size(np.where(observations["filter"] == "r")[0]) > 0
Expand Down
2 changes: 1 addition & 1 deletion tests/scheduler/test_modelobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_ideal(self):
assert mo_default.fwhm_500 != 0.7

assert cond_ideal.bulk_cloud == 0
assert cond_default.bulk_cloud > 0
assert cond_default.bulk_cloud >= 0

mjd_down = mo_default.downtimes["start"][0] + 0.01

Expand Down
6 changes: 3 additions & 3 deletions tests/scheduler/test_simple_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_simple_greedy_survey(self):
# Current survey_start_mjd should produce ~1000 visits
# but changing this to a short night could reduce the total number
self.assertTrue(len(observations) > 650)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.4)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.35)
self.assertTrue(np.unique(observations["scheduler_note"]).size == 1)
self.assertTrue(np.unique(observations["scheduler_note"])[0] == "simple greedy r")
# Check that we tracked things appropriately
Expand All @@ -83,7 +83,7 @@ def test_simple_pairs_survey(self):
# Current survey_start_mjd should produce over ~950 visits
# but changing this to a short night could reduce the total number
self.assertTrue(len(observations) > 650)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.4)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.35)
self.assertTrue(np.unique(observations["scheduler_note"]).size == 2)
# Check that we tracked things appropriately
self.assertTrue(
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_simple_field_survey(self):
# Current survey_start_mjd should produce over ~950 visits
# but changing this to a short night could reduce the total number
self.assertTrue(len(observations) > 650)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.4)
self.assertTrue(observations["mjd"].max() - observations["mjd"].min() > 0.35)
# Check some information about the observation notes and names
self.assertTrue(np.unique(observations["scheduler_note"]).size == 2)
self.assertTrue("almost_pole" in observations["scheduler_note"])
Expand Down
8 changes: 7 additions & 1 deletion tests/scheduler/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ def test_altaz_limit(self):
alt_min = 40
alt_max = 70
km.setup_telescope(altitude_minpos=alt_min, altitude_maxpos=alt_max)
mo = ModelObservatory(mjd=observations[-1]["mjd"], mjd_start=mjd_start, kinem_model=km)
mo = ModelObservatory(
mjd=observations[-1]["mjd"],
mjd_start=mjd_start,
kinem_model=km,
downtimes="ideal",
cloud_data="ideal",
)
scheduler.flush_queue()
try:
mo, scheduler, observations = sim_runner(
Expand Down

0 comments on commit c6b06a7

Please sign in to comment.