diff --git a/rubin_sim/maf/maf_contrib/kne_metrics.py b/rubin_sim/maf/maf_contrib/kne_metrics.py index 45452bb69..7a37ec91d 100644 --- a/rubin_sim/maf/maf_contrib/kne_metrics.py +++ b/rubin_sim/maf/maf_contrib/kne_metrics.py @@ -5,7 +5,7 @@ import numpy as np from rubin_scheduler.data import get_data_dir -from rubin_scheduler.utils import survey_start_mjd, uniform_sphere +from rubin_scheduler.utils import SURVEY_START_MJD, uniform_sphere from rubin_sim.maf.metrics import BaseMetric from rubin_sim.maf.slicers import UserPointsSlicer @@ -147,7 +147,7 @@ def __init__( night_col="night", pts_needed=2, file_list=None, - mjd0=None, + mjd0=SURVEY_START_MJD, output_lc=False, badval=-666, **kwargs, @@ -162,7 +162,7 @@ def __init__( self.output_lc = output_lc self.lightcurves = KnLc(file_list=file_list) - self.mjd0 = survey_start_mjd() if mjd0 is None else mjd0 + self.mjd0 = mjd0 dust_properties = DustValues() self.ax1 = dust_properties.ax1 diff --git a/rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py b/rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py index ad117c70f..bb5388459 100644 --- a/rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py +++ b/rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py @@ -8,7 +8,7 @@ import numpy as np import pandas as pd from rubin_scheduler.data import get_data_dir -from rubin_scheduler.utils import survey_start_mjd, uniform_sphere +from rubin_scheduler.utils import SURVEY_START_MJD, uniform_sphere import rubin_sim.maf.metrics as metrics import rubin_sim.maf.slicers as slicers @@ -150,7 +150,7 @@ def __init__( night_col="night", pts_needed=2, file_list=None, - mjd0=None, + mjd0=SURVEY_START_MJD, output_lc=False, skyregion="galactic", thr=0.003, @@ -182,7 +182,7 @@ def __init__( self.skyregion = skyregion # read in file as light curve object; self.lightcurves = KnLc(file_list=file_list) - self.mjd0 = survey_start_mjd() if mjd0 is None else mjd0 + self.mjd0 = mjd0 dust_properties = DustValues() self.ax1 = dust_properties.ax1 diff --git a/rubin_sim/maf/maf_contrib/tdes_pop_metric.py b/rubin_sim/maf/maf_contrib/tdes_pop_metric.py index f0d177924..32a34dd0e 100644 --- a/rubin_sim/maf/maf_contrib/tdes_pop_metric.py +++ b/rubin_sim/maf/maf_contrib/tdes_pop_metric.py @@ -5,7 +5,7 @@ import numpy as np from rubin_scheduler.data import get_data_dir -from rubin_scheduler.utils import survey_start_mjd, uniform_sphere +from rubin_scheduler.utils import SURVEY_START_MJD, uniform_sphere import rubin_sim.maf.metrics as metrics import rubin_sim.maf.slicers as slicers @@ -72,7 +72,7 @@ def __init__( night_col="night", pts_needed=2, file_list=None, - mjd0=None, + mjd0=SURVEY_START_MJD, **kwargs, ): maps = ["DustMap"] @@ -83,7 +83,7 @@ def __init__( self.pts_needed = pts_needed self.lightcurves = TdeLc(file_list=file_list) - self.mjd0 = survey_start_mjd() if mjd0 is None else mjd0 + self.mjd0 = mjd0 dust_properties = DustValues() self.ax1 = dust_properties.ax1 @@ -213,7 +213,7 @@ def __init__( tmin=-30, tmax=100, file_list=None, - mjd0=59853.5, + mjd0=SURVEY_START_MJD, **kwargs, ): maps = ["DustMap"] diff --git a/rubin_sim/maf/maf_contrib/xrb_metrics.py b/rubin_sim/maf/maf_contrib/xrb_metrics.py index c4786137f..92e4e6ae2 100644 --- a/rubin_sim/maf/maf_contrib/xrb_metrics.py +++ b/rubin_sim/maf/maf_contrib/xrb_metrics.py @@ -2,7 +2,7 @@ import numpy as np from rubin_scheduler.data import get_data_dir -from rubin_scheduler.utils import survey_start_mjd +from rubin_scheduler.utils import SURVEY_START_MJD from scipy.stats import loguniform from rubin_sim.maf.utils import m52snr @@ -291,7 +291,7 @@ def __init__( pts_needed=2, pts_early=2, t_early=7, - mjd0=None, + mjd0=SURVEY_START_MJD, output_lc=False, badval=-666, **kwargs, @@ -308,7 +308,7 @@ def __init__( self.output_lc = output_lc self.lightcurves = XrbLc() - self.mjd0 = survey_start_mjd() if mjd0 is None else mjd0 + self.mjd0 = mjd0 dust_properties = DustValues() self.ax1 = dust_properties.ax1 diff --git a/rubin_sim/satellite_constellations/model_observatory.py b/rubin_sim/satellite_constellations/model_observatory.py index 1a54c70cc..91af837d5 100644 --- a/rubin_sim/satellite_constellations/model_observatory.py +++ b/rubin_sim/satellite_constellations/model_observatory.py @@ -3,7 +3,7 @@ import numpy as np from rubin_scheduler.scheduler.model_observatory import ModelObservatory as oMO from rubin_scheduler.site_models import Almanac -from rubin_scheduler.utils import _healbin, survey_start_mjd +from rubin_scheduler.utils import SURVEY_START_MJD, _healbin # Take the model observatory from the scheduler and # subclass to expand to include satellite constellations @@ -48,7 +48,7 @@ class ModelObservatory(oMO): def __init__( self, nside=None, - mjd_start=None, + mjd_start=SURVEY_START_MJD, seed=42, alt_min=5.0, lax_dome=True, @@ -70,7 +70,7 @@ def __init__( # Need to do a little fiddle with the MJD since # self.mjd needs self.night set now. - self.mjd_start = survey_start_mjd() if mjd_start is None else mjd_start + self.mjd_start = mjd_start self.almanac = Almanac(mjd_start=self.mjd_start) self.night = -1 diff --git a/rubin_sim/satellite_constellations/sat_utils.py b/rubin_sim/satellite_constellations/sat_utils.py index aed47d425..2f63c7e6d 100644 --- a/rubin_sim/satellite_constellations/sat_utils.py +++ b/rubin_sim/satellite_constellations/sat_utils.py @@ -10,12 +10,12 @@ import numpy as np from astropy import constants as const from astropy import units as u -from rubin_scheduler.utils import Site, gnomonic_project_toxy, point_to_line_distance, survey_start_mjd +from rubin_scheduler.utils import SURVEY_START_MJD, Site, gnomonic_project_toxy, point_to_line_distance from shapely.geometry import LineString, Point from skyfield.api import EarthSatellite, load, wgs84 MJDOFFSET = 2400000.5 -mjd0 = survey_start_mjd() +mjd0 = SURVEY_START_MJD def sun_alt_limits(): diff --git a/tests/satellite_constellations/test_satellites.py b/tests/satellite_constellations/test_satellites.py index ef6663317..1ce99554d 100644 --- a/tests/satellite_constellations/test_satellites.py +++ b/tests/satellite_constellations/test_satellites.py @@ -1,7 +1,7 @@ import unittest import numpy as np -from rubin_scheduler.utils import survey_start_mjd +from rubin_scheduler.utils import SURVEY_START_MJD from rubin_sim.satellite_constellations import Constellation, oneweb_tles, starlink_tles_v1, starlink_tles_v2 @@ -10,7 +10,7 @@ class TestSatellites(unittest.TestCase): def test_constellations(self): """Test stellite constellations""" - mjd0 = survey_start_mjd() + mjd0 = SURVEY_START_MJD sv1 = starlink_tles_v1() sv2 = starlink_tles_v2() ow = oneweb_tles()