Skip to content

Commit

Permalink
update schema docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Jan 6, 2025
1 parent 1c03366 commit 4d1fa79
Show file tree
Hide file tree
Showing 25 changed files with 5 additions and 34 deletions.
5 changes: 4 additions & 1 deletion docs/fbs-output-schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
6 changes: 0 additions & 6 deletions rubin_scheduler/scheduler/detailers/detailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(
[
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/scheduler/features/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/scheduler/sim_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/scheduler/surveys/field_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ def __init__(
flush_pad=30.0,
detailers=None,
):

if detailers is None:
detailers = [AltAz2RaDecDetailer()]

Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/scheduler/surveys/too_scripted_surveys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/scheduler/utils/footprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions rubin_scheduler/scheduler/utils/sky_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,6 @@ def return_maps(


class Phase3AreaMap(EuclidOverlapFootprint):

def __init__(
self,
nside=DEFAULT_NSIDE,
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/sim_archive/prenight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/site_models/unscheduled_downtime_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def total_downtime(self):


class UnscheduledDowntimeMoreY1Data(UnscheduledDowntimeData):

def calc_sunrise_sets(self):
""" """
almanac = Almanac(mjd_start=self.start_time.mjd)
Expand Down
1 change: 0 additions & 1 deletion rubin_scheduler/skybrightness_pre/sky_model_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_basisfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class TestBasis(unittest.TestCase):

def test_basics(self):
"""Test the basics of each basis function"""

Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class TestConditions(unittest.TestCase):

def test_conditions(self):
# Generate a Conditions object with things filled out
mo = ModelObservatory()
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_coresched.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 0 additions & 2 deletions tests/scheduler/test_detailers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class TestDetailers(unittest.TestCase):

def test_basics(self):
"""Test basic detailer functionality"""

Expand Down Expand Up @@ -63,7 +62,6 @@ def test_basics(self):
assert len(result) > 0

def test_start_field(self):

observatory = ModelObservatory()
conditions = observatory.return_conditions()

Expand Down
2 changes: 0 additions & 2 deletions tests/scheduler/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_filterschedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_simple_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/test_wind.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
1 change: 0 additions & 1 deletion tests/sim_archive/test_make_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/utils/test_consdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion tests/utils/test_rotsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit 4d1fa79

Please sign in to comment.