Skip to content

Commit

Permalink
Fix errors within rubin-sim when building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonlynne committed Oct 9, 2024
1 parent a99649c commit 56b3a6b
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 40 deletions.
4 changes: 2 additions & 2 deletions docs/data-download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ for more details on setting up $RUBIN_SIM_DATA_DIR (which is
shared between ``rubin_scheduler``, ``rubin_sim`` and ``schedview``).

Using either the default path to $RUBIN_SIM_DATA_DIR, or after setting it
explicitly, first download the necessary data for `rubin_scheduler` and
then add the (larger) data set for `rubin_sim`:
explicitly, first download the necessary data for ``rubin_scheduler`` and
then add the (larger) data set for ``rubin_sim``:

.. code-block:: bash
Expand Down
6 changes: 3 additions & 3 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Introduction

The `Legacy Survey of Space and Time <http://www.lsst.org>`_ (LSST)
is anticipated to encompass around 2 million observations spanning a decade,
averaging 800 visits per night. The `rubin_sim` package was built to help
averaging 800 visits per night. The ``rubin_sim`` package was built to help
understand the predicted performance of the LSST.

The :ref:`Phot Utils<phot-utils>` module provides synthetic photometry
Expand All @@ -18,14 +18,14 @@ The :ref:`skybrightness<skybrightness>` module incorporates the ESO
sky model, modified to match measured sky conditions at the LSST site,
including an addition of a model for twilight skybrightness. This is used
to generate the pre-calculated skybrightness data used in
`rubin_scheduler<rubin-scheduler.lsst.io/skybrightness-pre.html>`_.
`rubin_scheduler <rubin-scheduler.lsst.io/skybrightness-pre.html>`_.

The :ref:`Moving Objects<moving-objects>` module provides a way to create
synthetic observations of moving objects, based on how they would appear in
pointing databases ("opsims") created by
`rubin_scheduler <rubin-scheduler.lsst.io>`_.

One of the major goals for `rubin_sim` is to enable efficient and
One of the major goals for ``rubin_sim`` is to enable efficient and
scientifically varied evaluation of the LSST survey strategy and progress,
by providing a framework to enable these metrics to run in a
standardized way on opsim outputs.
Expand Down
2 changes: 1 addition & 1 deletion docs/skybrightness.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Skybrightness
#############

The `rubin_sim.skybrightness` module generates
The ``rubin_sim.skybrightness`` module generates
predicted skybrightness values (in either magnitudes per
square arcsecond for any LSST bandpass or
as a SED over the relevant wavelengths).
Expand Down
4 changes: 2 additions & 2 deletions rubin_sim/data/rs_download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def data_dict() -> dict:
file_dict : `dict`
Data bucket filenames dictionary with keys:
``"name"``
Data bucket name (`str`).
Data bucket name (`str`).
``"version"``
Versioned file name (`str`).
Versioned file name (`str`).
"""
# Note for developers:
# to create tar files and follow any sym links, run: e.g.
Expand Down
4 changes: 2 additions & 2 deletions rubin_sim/maf/batches/metadata_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ def metadataBasics(
Calculates this around the sky (HealpixSlicer),
makes histograms of all visits (OneDSlicer),
and calculates statistics on all visits (UniSlicer) for the quantity,
in all visits and per filter.
in all visits and per filter.
Currently have a hack for HA & normairmass.
Parameters
----------
value : `str`
The column name for the quantity to evaluate.
(column name in the database or created by a stacker).
(column name in the database or created by a stacker).
colmap : `dict` or None, optional
A dictionary with a mapping of column names.
runName : `str`, optional
Expand Down
15 changes: 11 additions & 4 deletions rubin_sim/maf/batches/moving_objects_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@


def ss_population_defaults(objtype):
"Provide useful default ranges for H, based on objtype of population type."
"""Provide useful default ranges for H,
based on objtype of population type.
"""
defaults = {}
defaults["Vatira"] = {
"h_range": [16, 28, 0.2],
Expand Down Expand Up @@ -135,6 +137,9 @@ def quick_discovery_batch(
constraint=None,
magtype="asteroid",
):
"""A subset of discovery metrics, using only the default discovery
criteria of 3 pairs in 15 or 30 nights.
"""
if colmap is None:
colmap = col_map_dict()
bundleList = []
Expand Down Expand Up @@ -276,6 +281,9 @@ def discovery_batch(
constraint=None,
magtype="asteroid",
):
"""A comprehensive set of discovery metrics, using a wide range
of discovery criteria.
"""
if colmap is None:
colmap = col_map_dict()
bundleList = []
Expand Down Expand Up @@ -648,8 +656,7 @@ def _configure_child_bundles(parentBundle):


def run_completeness_summary(bdict, h_mark, times, out_dir, results_db):
"""
Calculate completeness and create completeness bundles from all
"""Calculate completeness and create completeness bundles from all
N_Chances and Time (child) metrics of the (discovery) bundles in bdict,
and write completeness at h_mark to results_db, save bundle to disk.
Expand All @@ -665,7 +672,7 @@ def run_completeness_summary(bdict, h_mark, times, out_dir, results_db):
If not defined (None), then the h_mark from the plotdict from the
metric bundle will be used if available.
If None and h_mark not in plot_dict, then median of h_range values
will be used.
will be used.
times : `np.ndarray`
The times at which to calculate completeness (over time).
out_dir : `str`
Expand Down
6 changes: 2 additions & 4 deletions rubin_sim/maf/maf_contrib/kne_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ def get_kne_filename(inj_params_list=None):
mass of the dynamical ejecta (mej_dyn), mass of the disk wind ejecta
(mej_wind), semi opening angle of the cylindrically-symmetric ejecta
fan ('phi'), and viewing angle ('theta'). For example
inj_params_list = [{'mej_dyn': 0.005,
'mej_wind': 0.050,
'phi': 30,
'theta': 25.8}]
inj_params_list =
[{'mej_dyn': 0.005, 'mej_wind': 0.050, 'phi': 30, 'theta': 25.8}]
"""
# Get files, model grid developed by M. Bulla
datadir = get_data_dir()
Expand Down
5 changes: 5 additions & 0 deletions rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def generate_presto_pop_slicer(
):
"""Generate a population of KNe events, and put the info about them
into a UserPointSlicer object
Parameters
----------
skyregion : `str`
Expand All @@ -100,6 +101,10 @@ def generate_presto_pop_slicer(
Minimum luminosity distance (Mpc)
d_max : `float` or `int`
Maximum luminosity distance (Mpc)
Returns
-------
kne_slicer : `~.maf.UserPointsSlicer`
"""

def rndm(a, b, g, size=1):
Expand Down
4 changes: 2 additions & 2 deletions rubin_sim/maf/maps/galactic_plane_priority_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

def gp_priority_map_components_to_keys(filtername, science_map):
"""A convenience function to help keep the map key
formats in sync in various places"""
formats in sync in various places.
"""
return f"galplane_priority_{science_map}:{filtername}"


Expand Down Expand Up @@ -71,7 +72,6 @@ def galplane_priority_map(
Use the priority_GalPlane_footprint_alt_map_data_{ugrizysum}.fits
files instead of the default
priority_galPlane_footprint_map_data_{ugrizysum}.fits files.
Default False.
"""
# This is a function that will read the galactic plane priority map data
# and hold onto it indefinitely
Expand Down
11 changes: 7 additions & 4 deletions rubin_sim/maf/metrics/color_slope_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def __call__(self, data_slice):

class ColorSlopeMetric(BaseMetric):
"""How many times do we get a color and slope in a night
A proxie metric for seeing how many times
A proxy metric for seeing how many times
there would be the possibility of identifying and
classifying a transient.
Expand All @@ -81,7 +82,8 @@ class ColorSlopeMetric(BaseMetric):
to still count as a color (hours). Default 1 hour.
slope_length : `float`
The length of time to demand observations in the
same filter be greater than (hours). Default 3 hours."""
same filter be greater than (hours). Default 3 hours.
"""

def __init__(
self,
Expand Down Expand Up @@ -128,7 +130,7 @@ def run(self, data_slice, slice_point=None):
class ColorSlope2NightMetric(ColorSlopeMetric):
"""Like ColorSlopeMetric, but span over 2 nights
Parameters
Parameters
----------
mag : `dict`
Dictionary with filternames as keys and minimum depth m5
Expand All @@ -138,7 +140,8 @@ class ColorSlope2NightMetric(ColorSlopeMetric):
to still count as a color (hours). Default 1 hour.
slope_length : `float`
The length of time to demand observations in the
same filter be greater than (hours). Default 15 hours."""
same filter be greater than (hours). Default 15 hours.
"""

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion rubin_sim/maf/metrics/mo_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ class ColorAsteroidMetric(BaseMoMetric):
1 = g and (r or i) and (z or y).
i.e. obtain colors g-r or g-i PLUS g-z or g-y
2 = Any 4 different filters (from grizy).
i.e. colors = g-r, r-i, i-z, OR r-i, i-z, z-y..
i.e. colors = g-r, r-i, i-z, OR r-i, i-z, z-y..
3 = All 5 from grizy. i.e. colors g-r, r-i, i-z, z-y.
4 = All 6 filters (ugrizy) -- best possible! add u-g.
Expand Down
10 changes: 5 additions & 5 deletions rubin_sim/maf/plots/two_d_plotters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ def __call__(self, metric_value, slicer, user_plot_dict, fig=None):
The metric values from the bundle.
slicer : `rubin_sim.maf.slicers.TwoDSlicer`
The slicer.
user_plot_dict: `dict`
user_plot_dict : `dict`
Dictionary of plot parameters set by user
(overrides default values).
fig : `matplotlib.figure.Figure`
Matplotlib figure number to use. Default = None, starts new figure.
Returns
-------
fig : `matplotlib.figure.Figure
Figure with the plot.
fig : `matplotlib.figure.Figure`
Figure with the plot.
"""
if "Healpix" in slicer.slicer_name:
self.default_plot_dict["ylabel"] = "Healpix ID"
Expand Down Expand Up @@ -124,7 +124,7 @@ class VisitPairsHist(BasePlotter):
The metric values from the bundle.
slicer : `rubin_sim.maf.slicers.TwoDSlicer`
The slicer.
user_plot_dict: `dict`
user_plot_dict : `dict`
Dictionary of plot parameters set by user
(overrides default values).
fig : `matplotlib.figure.Figure`
Expand All @@ -133,7 +133,7 @@ class VisitPairsHist(BasePlotter):
Returns
-------
fig : `matplotlib.figure.Figure`
Figure with the plot.
Figure with the plot.
"""

def __init__(self):
Expand Down
2 changes: 2 additions & 0 deletions rubin_sim/maf/run_comparison/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def get_metric_summaries(
----
The entire summary statistic values for all of the runs and metrics can
be downloaded from the default sources first, by simply calling
.. code-block:: python
summary = get_metric_summaries()
Then, you can use `get_metric_summaries` to get a subset without
Expand Down
8 changes: 4 additions & 4 deletions rubin_sim/maf/stackers/mo_stackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ class AppMagStacker(BaseMoStacker):
This is calculated from the reported mag_v in the input observation
file (calculated assuming Href) as:
```
ssoObs['appMag'] = ssoObs[self.vMagCol] + ssoObs[self.colorCol] +
ssoObs[self.lossCol] + h_val - Href
```
.. codeblock::python
ssoObs['appMag'] = ssoObs[self.vMagCol] + ssoObs[self.colorCol] +
ssoObs[self.lossCol] + h_val - Href
Using the vMag reported in the input observations implicitly uses
the phase curve coded in at that point;
Expand Down
2 changes: 1 addition & 1 deletion rubin_sim/phot_utils/sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def resample_sed(
Give method wavelen/flux OR default to self.wavelen/self.flambda.
Method either returns wavelen/flambda (if given those arrays) or
updates wavelen/flambda in self.
updates wavelen/flambda in self.
If updating self, resets fnu to None.
Method will first check if resampling needs to be done or not,
unless 'force' is True.
Expand Down
11 changes: 6 additions & 5 deletions rubin_sim/skybrightness/interp_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


def id2intid(ids):
"""take an array of ids, and convert them to an integer id.
"""Take an array of ids, and convert them to an integer id.
Handy if you want to put things into a sparse array.
"""
uids = np.unique(ids)
Expand Down Expand Up @@ -76,10 +76,11 @@ def load_spec_files(filenames, mags=False):
* filter_wave: The central wavelengths of the pre-computed magnitudes
* wave: wavelengths for the spectra
* spec: array of spectra and magnitudes along with the relevant
variable inputs. For example, airglow has dtype =
[('airmass', '<f8'), ('solar_flux', '<f8'), ('spectra',
'<f8', (17001,)),
('mags', '<f8', (6,)]
variable inputs. For example, airglow has dtype =
[('airmass', '<f8'),
('solar_flux', '<f8'),
('spectra','<f8', (17001,)),
('mags', '<f8', (6,)]
For each unique airmass and solar_flux value, there is a 17001 elements
spectra and 6 magnitudes.
Expand Down

0 comments on commit 56b3a6b

Please sign in to comment.