Skip to content

Commit

Permalink
Merge pull request #423 from lsst/tickets/OPSIM-1193
Browse files Browse the repository at this point in the history
remove survey_start function
  • Loading branch information
yoachim authored Oct 10, 2024
2 parents 27b9072 + 869e44e commit 91a7802
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions rubin_sim/maf/maf_contrib/kne_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions rubin_sim/maf/maf_contrib/tdes_pop_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -72,7 +72,7 @@ def __init__(
night_col="night",
pts_needed=2,
file_list=None,
mjd0=None,
mjd0=SURVEY_START_MJD,
**kwargs,
):
maps = ["DustMap"]
Expand All @@ -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
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(
tmin=-30,
tmax=100,
file_list=None,
mjd0=59853.5,
mjd0=SURVEY_START_MJD,
**kwargs,
):
maps = ["DustMap"]
Expand Down
6 changes: 3 additions & 3 deletions rubin_sim/maf/maf_contrib/xrb_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rubin_sim/satellite_constellations/model_observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions rubin_sim/satellite_constellations/sat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tests/satellite_constellations/test_satellites.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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()
Expand Down

0 comments on commit 91a7802

Please sign in to comment.