diff --git a/rubin_sim/maf/metrics/mo_metrics.py b/rubin_sim/maf/metrics/mo_metrics.py index 771f66f6b..8d574e283 100644 --- a/rubin_sim/maf/metrics/mo_metrics.py +++ b/rubin_sim/maf/metrics/mo_metrics.py @@ -376,7 +376,7 @@ def run(self, sso_obs, orb, hval): sso_obs[self.night_col][vis][good_idx] - sso_obs[self.night_col][vis][good_idx][sIdx] <= self.t_window )[0] - end_idxs[i] = np.array([in_window.max()]) + end_idxs[i] = in_window.max() # Convert back to index based on sso_obs[vis] (sorted by expMJD). start_idxs = good_idx[start_idxs] end_idxs = good_idx_ends[end_idxs] diff --git a/rubin_sim/maf/slicers/base_slicer.py b/rubin_sim/maf/slicers/base_slicer.py index bdaa1757d..41418585a 100644 --- a/rubin_sim/maf/slicers/base_slicer.py +++ b/rubin_sim/maf/slicers/base_slicer.py @@ -64,7 +64,7 @@ class BaseSlicer(metaclass=SlicerRegistry): The value the Slicer uses to fill masked metric data values """ - def __init__(self, verbose=True, badval=-666): + def __init__(self, verbose=False, badval=-666): self.verbose = verbose self.badval = badval # Set the cache_size. @@ -419,7 +419,10 @@ def read_data(self, infilename): try: slicer = getattr(slicers, slicer_name)(**slicer_init) except TypeError: - warnings.warn(f"Cannot use saved slicer init values; falling back to defaults for {infilename}") + if self.verbose: + warnings.warn( + f"Cannot use saved slicer init values; falling back to defaults for {infilename}" + ) slicer = getattr(slicers, slicer_name)() # Restore slice_point information. slicer.nslice = slicer_nslice @@ -489,7 +492,10 @@ def read_backwards_compatible(self, restored, infilename): try: slicer = getattr(slicers, slicer_name)(**slicer_init) except TypeError: - warnings.warn(f"Cannot use saved slicer init values; falling back to defaults for {infilename}") + if self.verbose: + warnings.warn( + f"Cannot use saved slicer init values; falling back to defaults for {infilename}" + ) slicer = getattr(slicers, slicer_name)() # Restore slice_point information. slicer.nslice = slicer_nslice diff --git a/rubin_sim/maf/utils/obs2sqlite.py b/rubin_sim/maf/utils/obs2sqlite.py index 64e020ee7..7101ba0a1 100644 --- a/rubin_sim/maf/utils/obs2sqlite.py +++ b/rubin_sim/maf/utils/obs2sqlite.py @@ -6,10 +6,10 @@ import healpy as hp import numpy as np import pandas as pd +from rubin_scheduler.utils import Site, _approx_ra_dec2_alt_az, m5_flat_sed, raDec2Hpid import rubin_sim.skybrightness_pre as sb from rubin_sim.skybrightness import SkyModel -from rubin_sim.utils import Site, _approx_ra_dec2_alt_az, m5_flat_sed, raDec2Hpid def obs2sqlite( diff --git a/rubin_sim/moving_objects/direct_obs.py b/rubin_sim/moving_objects/direct_obs.py index 3658fc0e6..d3e361e3f 100644 --- a/rubin_sim/moving_objects/direct_obs.py +++ b/rubin_sim/moving_objects/direct_obs.py @@ -106,7 +106,7 @@ def __init__( obs_info="", tstep=1.0, rough_tol=10.0, - verbose=True, + verbose=False, night_col="night", filter_col="filter", m5_col="fiveSigmaDepth", diff --git a/rubin_sim/moving_objects/make_lsst_obs.py b/rubin_sim/moving_objects/make_lsst_obs.py index 18dd9ecc8..cc4e5c6cc 100755 --- a/rubin_sim/moving_objects/make_lsst_obs.py +++ b/rubin_sim/moving_objects/make_lsst_obs.py @@ -160,6 +160,9 @@ def setup_args(parser=None): default=None, help="Send log output to log_file, instead of to console. (default = console)", ) + parser.add_argument("--verbose", dest="verbose", action="store_true", help="Print more output") + parser.set_defaults(verbose=False) + args = parser.parse_args() if args.simulation_db is None: @@ -244,6 +247,7 @@ def make_lsst_obs(): tstep=args.t_step, rough_tol=args.rough_tol, obs_info=args.obs_info, + verbose=args.verbose, ) filterlist = np.unique(pointing_data["filter"]) d_obs.read_filters(filterlist=filterlist)