diff --git a/docs/fbs-output-schema.rst b/docs/fbs-output-schema.rst index e3e50918..dda195b7 100644 --- a/docs/fbs-output-schema.rst +++ b/docs/fbs-output-schema.rst @@ -38,9 +38,12 @@ All values are for the center of the field of view (e.g., airmass, altitude, etc * - visitExposureTime - seconds - Total on-sky exposure time. + * - band + - string + - The name of the bandpass in use for the observation, typically one of ugrizy. * - filter - string - - The name of the bandpass in use for the observation. + - The name of the physical filter in use for the observation. * - rotSkyPos - degrees - The orientation of the sky in the focal plane measured as the angle between ICRF North on the sky and the "up" direction in the focal plane. Corresponds to 'skyAngle'. diff --git a/rubin_scheduler/scheduler/detailers/detailer.py b/rubin_scheduler/scheduler/detailers/detailer.py index 690369ed..e15f7da4 100644 --- a/rubin_scheduler/scheduler/detailers/detailer.py +++ b/rubin_scheduler/scheduler/detailers/detailer.py @@ -101,7 +101,6 @@ def __init__(self, target_name=None, science_program=None, observation_reason=No self.keys = ["science_program", "target_name", "observation_reason"] def __call__(self, observation_array, conditions): - for key in self.keys: indx = np.where((observation_array[key] == "") | (observation_array[key] is None))[0] observation_array[key][indx] = getattr(self, key) @@ -133,7 +132,6 @@ class AltAz2RaDecDetailer(BaseDetailer): """Set RA,dec for an observation that only has alt,az""" def __call__(self, observation_array, conditions): - ra, dec = _approx_alt_az2_ra_dec( observation_array["alt"], observation_array["az"], @@ -177,7 +175,6 @@ def __init__(self, bands="riz", nights_to_prep=10000, seed=42, fallback_order="r self.band_dict[i] = bandname def __call__(self, observation_array, conditions): - band_to_use = self.band_dict[self.night2band_int[conditions.night]] # Band not available if band_to_use not in conditions.mounted_bands: @@ -237,7 +234,6 @@ def __init__(self, telescope="rubin"): self.survey_features = {} def __call__(self, obs_array, conditions): - alt, az = _approx_ra_dec2_alt_az( obs_array["RA"], obs_array["dec"], @@ -496,7 +492,6 @@ def __init__(self, bandname="u", nexp=1, exptime=None): self.exptime = exptime def __call__(self, observation_array, conditions): - indx = np.where(observation_array["band"] == self.bandname)[0] observation_array["nexp"][indx] = self.nexp if self.exptime is not None: @@ -542,7 +537,6 @@ def __init__(self, slew_estimate=5.0, n_repeat=3, update_note=True): self.update_note = update_note def __call__(self, obs_array, conditions): - # Estimate how much time is left in the twilgiht block potential_times = np.array( [ diff --git a/rubin_scheduler/scheduler/features/features.py b/rubin_scheduler/scheduler/features/features.py index ef10f864..551a6ea0 100644 --- a/rubin_scheduler/scheduler/features/features.py +++ b/rubin_scheduler/scheduler/features/features.py @@ -596,7 +596,6 @@ def __init__(self, ang_distance_match=None, science_program=None, scheduler_note self.ang_distance_match = None def add_observations_array(self, observations_array, observations_hpid): - if self.science_program is not None: good = np.where(observations_array["science_program"] == self.science_program)[0] observations_array = observations_array[good] diff --git a/rubin_scheduler/scheduler/model_observatory/generate_altitudes.py b/rubin_scheduler/scheduler/model_observatory/generate_altitudes.py index 199d4a10..5d0af892 100644 --- a/rubin_scheduler/scheduler/model_observatory/generate_altitudes.py +++ b/rubin_scheduler/scheduler/model_observatory/generate_altitudes.py @@ -204,7 +204,6 @@ def generate_nights(mjd_start, duration=3653.0, rough_step=2, verbose=False): def gen_altitudes(mjd_start=59853.5, duration=365.25 * 24 + 80, rough_step=2, filename="night_info.npz"): - rough_times, refined_mjds = generate_nights( mjd_start - 365.25 * 2 - 40.0, duration=duration, rough_step=rough_step ) @@ -213,5 +212,4 @@ def gen_altitudes(mjd_start=59853.5, duration=365.25 * 24 + 80, rough_step=2, fi if __name__ == "__main__": - gen_altitudes() diff --git a/rubin_scheduler/scheduler/model_observatory/model_observatory.py b/rubin_scheduler/scheduler/model_observatory/model_observatory.py index 49b41fa7..e66b6a64 100644 --- a/rubin_scheduler/scheduler/model_observatory/model_observatory.py +++ b/rubin_scheduler/scheduler/model_observatory/model_observatory.py @@ -142,7 +142,7 @@ class ModelObservatory: telescope : `str` Telescope name for rotation computations. Default "rubin". band2filter : `dict` - Dictionary for converting band names to filter names. + Dictionary for converting band names to filter names. Default of none will use band names for filter names. """ diff --git a/rubin_scheduler/scheduler/sim_runner.py b/rubin_scheduler/scheduler/sim_runner.py index 51992b27..b795fcef 100644 --- a/rubin_scheduler/scheduler/sim_runner.py +++ b/rubin_scheduler/scheduler/sim_runner.py @@ -162,7 +162,6 @@ def sim_runner( completed_obs, new_night = observatory.observe(desired_obs) if completed_obs is not None: - if anomalous_overhead_func is not None: observatory.mjd += ( anomalous_overhead_func(completed_obs["visittime"], completed_obs["slewtime"]) / 86400 diff --git a/rubin_scheduler/scheduler/surveys/field_survey.py b/rubin_scheduler/scheduler/surveys/field_survey.py index 392f7d73..ffed0dc9 100644 --- a/rubin_scheduler/scheduler/surveys/field_survey.py +++ b/rubin_scheduler/scheduler/surveys/field_survey.py @@ -338,7 +338,6 @@ def __init__( flush_pad=30.0, detailers=None, ): - if detailers is None: detailers = [AltAz2RaDecDetailer()] diff --git a/rubin_scheduler/scheduler/surveys/too_scripted_surveys.py b/rubin_scheduler/scheduler/surveys/too_scripted_surveys.py index 439d1ab5..560cdf69 100644 --- a/rubin_scheduler/scheduler/surveys/too_scripted_surveys.py +++ b/rubin_scheduler/scheduler/surveys/too_scripted_surveys.py @@ -100,7 +100,6 @@ def __init__( split_long_max=30.0, split_long_div=60.0, ): - # Make sure lists all match check = np.unique([len(bands_at_times), len(times), len(nvis), len(exptimes)]) if np.size(check) > 1: diff --git a/rubin_scheduler/scheduler/utils/footprints.py b/rubin_scheduler/scheduler/utils/footprints.py index c79880bb..e579548d 100644 --- a/rubin_scheduler/scheduler/utils/footprints.py +++ b/rubin_scheduler/scheduler/utils/footprints.py @@ -322,7 +322,6 @@ def __call__(self, mjd_in, phase): class StepLine(BasePixelEvolution): - def __call__(self, mjd_in, phase): t = mjd_in + phase - self.t_start n_periods = np.floor(t / (self.period)) diff --git a/rubin_scheduler/scheduler/utils/sky_area.py b/rubin_scheduler/scheduler/utils/sky_area.py index e29e8d14..d72d193f 100644 --- a/rubin_scheduler/scheduler/utils/sky_area.py +++ b/rubin_scheduler/scheduler/utils/sky_area.py @@ -1086,7 +1086,6 @@ def return_maps( class Phase3AreaMap(EuclidOverlapFootprint): - def __init__( self, nside=DEFAULT_NSIDE, @@ -1235,7 +1234,6 @@ def return_maps( virgo_ratios={"u": 0.35, "g": 0.4, "r": 1.0, "i": 1.0, "z": 0.9, "y": 0.9}, euclid_ratios={"u": 0.35, "g": 0.4, "r": 1.0, "i": 1.0, "z": 0.9, "y": 0.9}, ): - # Array to hold the labels for each pixel self.pix_labels = np.zeros(hp.nside2npix(self.nside), dtype="U20") self.healmaps = np.zeros( diff --git a/rubin_scheduler/sim_archive/prenight.py b/rubin_scheduler/sim_archive/prenight.py index 283f8fac..9fc91902 100644 --- a/rubin_scheduler/sim_archive/prenight.py +++ b/rubin_scheduler/sim_archive/prenight.py @@ -322,7 +322,6 @@ def _parse_dayobs_to_mjd(dayobs: str | float) -> float: def prenight_sim_cli(cli_args: list = []) -> None: - parser = argparse.ArgumentParser(description="Run prenight simulations") default_time = Time(int(_mjd_now() - 0.5), format="mjd") parser.add_argument( diff --git a/rubin_scheduler/site_models/unscheduled_downtime_data.py b/rubin_scheduler/site_models/unscheduled_downtime_data.py index ab1f8491..b8f65993 100644 --- a/rubin_scheduler/site_models/unscheduled_downtime_data.py +++ b/rubin_scheduler/site_models/unscheduled_downtime_data.py @@ -165,7 +165,6 @@ def total_downtime(self): class UnscheduledDowntimeMoreY1Data(UnscheduledDowntimeData): - def calc_sunrise_sets(self): """ """ almanac = Almanac(mjd_start=self.start_time.mjd) diff --git a/rubin_scheduler/skybrightness_pre/sky_model_pre.py b/rubin_scheduler/skybrightness_pre/sky_model_pre.py index 309806db..59de30ab 100644 --- a/rubin_scheduler/skybrightness_pre/sky_model_pre.py +++ b/rubin_scheduler/skybrightness_pre/sky_model_pre.py @@ -327,7 +327,6 @@ def return_mags( # Check if we are between sunrise/set if baseline > self.timestep_max + 1e-6: - # Check if sun is really high: obstime = Time(mjd, format="mjd") sun = get_sun(obstime) diff --git a/tests/scheduler/test_basisfuncs.py b/tests/scheduler/test_basisfuncs.py index 21abfea8..cef7f085 100644 --- a/tests/scheduler/test_basisfuncs.py +++ b/tests/scheduler/test_basisfuncs.py @@ -10,7 +10,6 @@ class TestBasis(unittest.TestCase): - def test_basics(self): """Test the basics of each basis function""" diff --git a/tests/scheduler/test_conditions.py b/tests/scheduler/test_conditions.py index 758663c1..26a8db63 100644 --- a/tests/scheduler/test_conditions.py +++ b/tests/scheduler/test_conditions.py @@ -8,7 +8,6 @@ class TestConditions(unittest.TestCase): - def test_conditions(self): # Generate a Conditions object with things filled out mo = ModelObservatory() diff --git a/tests/scheduler/test_coresched.py b/tests/scheduler/test_coresched.py index f21c4b42..be11690b 100644 --- a/tests/scheduler/test_coresched.py +++ b/tests/scheduler/test_coresched.py @@ -12,7 +12,6 @@ class TestCoreSched(unittest.TestCase): def testsched(self): - # Just set up a very simple survey, one band survey = simple_greedy_survey(bandname="r") diff --git a/tests/scheduler/test_detailers.py b/tests/scheduler/test_detailers.py index f6b8216f..d945fdf3 100644 --- a/tests/scheduler/test_detailers.py +++ b/tests/scheduler/test_detailers.py @@ -11,7 +11,6 @@ class TestDetailers(unittest.TestCase): - def test_basics(self): """Test basic detailer functionality""" @@ -63,7 +62,6 @@ def test_basics(self): assert len(result) > 0 def test_start_field(self): - observatory = ModelObservatory() conditions = observatory.return_conditions() diff --git a/tests/scheduler/test_features.py b/tests/scheduler/test_features.py index 867c1c4c..2f15a15c 100644 --- a/tests/scheduler/test_features.py +++ b/tests/scheduler/test_features.py @@ -57,7 +57,6 @@ def make_observations_arrays(observations_list, nside=32): class TestFeatures(unittest.TestCase): - def test_features_add_observation_methods(self): # Generic test that add_observations_array equals add_observations # Under the default conditions. @@ -174,7 +173,6 @@ def test_conditions(self): _ = conditions_naked.__str__() def test_note_last_observed(self): - observations_list = make_observations_list(5) for i, obs in enumerate(observations_list): if i == 1: diff --git a/tests/scheduler/test_filterschedulers.py b/tests/scheduler/test_filterschedulers.py index 8bd401f8..eb85fbaf 100644 --- a/tests/scheduler/test_filterschedulers.py +++ b/tests/scheduler/test_filterschedulers.py @@ -8,7 +8,6 @@ class TestBandSchedulers(unittest.TestCase): - def test_ComCamBandSched(self): illum_bins = np.arange(0, 100 + 1, 50) band_groups = (("g", "r", "i"), ("i", "z", "y")) diff --git a/tests/scheduler/test_simple_examples.py b/tests/scheduler/test_simple_examples.py index b1917953..bfe0bc69 100644 --- a/tests/scheduler/test_simple_examples.py +++ b/tests/scheduler/test_simple_examples.py @@ -16,7 +16,6 @@ class TestSurveyConveniences(unittest.TestCase): - def setUp(self) -> None: self.survey_start = np.floor(SURVEY_START_MJD) + 0.5 self.day_obs_start = Time(self.survey_start, format="mjd", scale="utc").iso[:10] diff --git a/tests/scheduler/test_snapshots.py b/tests/scheduler/test_snapshots.py index 73f12454..16d27100 100644 --- a/tests/scheduler/test_snapshots.py +++ b/tests/scheduler/test_snapshots.py @@ -15,7 +15,6 @@ class TestSnapshots(unittest.TestCase): - @unittest.skip("Test too slow to run routinely.") @unittest.skipUnless( os.path.isfile(os.path.join(get_data_dir(), "scheduler/dust_maps/dust_nside_32.npz")), diff --git a/tests/scheduler/test_wind.py b/tests/scheduler/test_wind.py index 599d5929..8b2e10b7 100644 --- a/tests/scheduler/test_wind.py +++ b/tests/scheduler/test_wind.py @@ -34,7 +34,6 @@ def return_conditions(self): class TestWind(unittest.TestCase): - @unittest.skipUnless(os.path.isfile(SAMPLE_BIG_DATA_FILE), "Test data not available.") def test_wind(self): """ diff --git a/tests/sim_archive/test_make_snapshot.py b/tests/sim_archive/test_make_snapshot.py index c51eb082..4a0abb08 100644 --- a/tests/sim_archive/test_make_snapshot.py +++ b/tests/sim_archive/test_make_snapshot.py @@ -13,7 +13,6 @@ class TestMakeSnapshot(unittest.TestCase): - @unittest.skip("Skipping because test depends on external repo.") @unittest.skipIf(not HAVE_TS, "No lsst.ts") def test_get_scheduler_instance_photcal(self): diff --git a/tests/utils/test_consdb.py b/tests/utils/test_consdb.py index 4728d460..d76b89d2 100644 --- a/tests/utils/test_consdb.py +++ b/tests/utils/test_consdb.py @@ -8,7 +8,6 @@ class TestConsdb(unittest.TestCase): - @unittest.skip("avoid requiring access to consdb for tests.") def test_consdb_read_visits_quick(self): day_obs: str = "2024-06-26" diff --git a/tests/utils/test_rotsky.py b/tests/utils/test_rotsky.py index 66a96c3d..47601aca 100644 --- a/tests/utils/test_rotsky.py +++ b/tests/utils/test_rotsky.py @@ -13,7 +13,6 @@ class TestRotSkyConvert(unittest.TestCase): - def test_rotation_converter(self): pa_vals = np.linspace(0, 360, 15) for tn in ["rubin", "auxtel", "comcam"]: