# rubin_sim¶

Overview

## Python API¶

### rubin_sim.utils api¶

#### rubin_sim.utils Package¶

##### Functions¶
 `alt_az_pa_from_ra_dec`(ra, dec, obs[, ...]) Convert RA, Dec, longitude, latitude and MJD into altitude, azimuth and parallactic angle using PALPY `angular_separation`(long1, lat1, long2, lat2) Angular separation between two points in degrees `app_geo_from_icrs`(ra, dec[, pm_ra, pm_dec, ...]) Convert the mean position (RA, Dec) in the International Celestial Reference System (ICRS) to the mean apparent geocentric position `app_geo_from_observed`(ra, dec[, ...]) Convert observed (RA, Dec) to apparent geocentric (RA, Dec). `apply_precession`(ra, dec[, epoch, mjd]) apply_precession() applies precesion and nutation to coordinates between two epochs. `apply_proper_motion`(ra, dec, pm_ra, pm_dec, ...) Applies proper motion between two epochs. `apply_refraction`(zenith_distance, ...) Calculted refracted Zenith Distance `approx_alt_az2_ra_dec`(alt, az, lat, lon, mjd) Convert alt, az to RA, Dec without taking into account aberration, precession, diffraction, etc. `approx_altaz2pa`(alt_deg, az_deg, latitude_deg) A fast calculation of parallactic angle `approx_ra_dec2_alt_az`(ra, dec, lat, lon, mjd) Convert Ra,Dec to Altitude and Azimuth. Convert an angle in degrees to arcseconds Convert an angle in radians to arcseconds `bearing`(lon1, lat1, lon2, lat2) Bearing between two points all radians Compute Greenwich mean sidereal time and Greenwich apparent sidereal time see: From http://aa.usno.navy.mil/faq/docs/GAST.php `calc_lmst_last`(mjd, long_rad) calculates local mean sidereal time and local apparent sidereal time `calc_season`(ra, time) Calculate the 'season' in the survey for a series of ra/time values of an observation. `cartesian_from_spherical`(longitude, latitude) Transforms between spherical and Cartesian coordinates. Return the DDF locations as as dict. Convert an angle in arcseconds to degrees `dest_latlon`(dist, bearing, lat1, lon1) Destination lat and lon given a distance, bearing and starting position all radians `distance_to_sun`(ra, dec, mjd[, epoch]) Calculate the distance from an (ra, dec) point to the Sun (in degrees). The equation of equinoxes. `equatorial_from_galactic`(g_long, g_lat) Convert Galactic Coordinates to RA, dec (J2000) `find_htmid`(ra, dec, max_level) Find the htmid (the unique integer identifying each trixel) of the trixel containing a given RA, Dec pair. `galactic_from_equatorial`(ra, dec) Convert RA,Dec (J2000) to Galactic Coordinates `get_all_trixels`(level) Return a dict of all of the trixels up to a given mesh level. `get_package_dir`(package) Return the path to a package `get_rot_sky_pos`(ra, dec, obs, rot_tel) @param [in] ra is the RA in degrees. `get_rot_tel_pos`(ra, dec, obs, rot_sky) @param [in] ra is RA in degrees. `gnomonic_project_tosky`(x, y, r_acen, deccen) Calculate RA/dec on sky of object with x/y and RA/Cen of field of view. `gnomonic_project_toxy`(ra1, dec1, r_acen, deccen) Calculate x/y projection of ra1/dec1 in system with center at r_acen, deccen. `half_space_from_points`(pt1, pt2, pt3) Return a Half Space defined by two points on a Great Circle and a third point contained in the Half Space. `half_space_from_ra_dec`(ra, dec, radius) Take an RA, Dec and radius of a circular field of view and return a HalfSpace `haversine`(long1, lat1, long2, lat2) DEPRECATED; use angular_separation() instead `healbin`(ra, dec, values[, nside, ...]) Take arrays of ra's, dec's, and value and bin into healpixels. `hp_grow_argsort`(in_map[, ignore_nan]) Find the maximum of a healpix map, then orders healpixels by selecting the maximum bordering the selected area. `hpid2_ra_dec`(nside, hpids, **kwargs) Correct for healpy being silly and running dec from 0-180. `icrs_from_app_geo`(ra, dec[, epoch, mjd]) Convert the apparent geocentric position in (RA, Dec) to the mean position in the International Celestial Reference System (ICRS) `icrs_from_observed`(ra, dec[, obs_metadata, ...]) Convert observed RA, Dec into mean International Celestial Reference Frame (ICRS) RA, Dec. `int_binned_stat`(ids, values[, statistic]) Like scipy.binned_statistic, but for unique integer ids. `intersect_half_spaces`(hs1, hs2) Parameters: `level_from_htmid`(htmid) Find the level of a trixel from its htmid. `m5_flat_sed`(visit_filter, musky, fwhm_eff, ...) Calculate the m5 value, using photometric scaling. `m5_scale`(exp_time, nexp, airmass, fwhm_eff, ...) Return m5 (scaled) value for all filters. `moc2array`(data, uniq[, nside, reduce_func, ...]) Convert a Multi-Order Coverage Map to a single nside HEALPix array. `native_lon_lat_from_ra_dec`(ra, dec, obs_metadata) Convert the RA and Dec of a star into `native' longitude and latitude. `observed_from_app_geo`(ra, dec[, ...]) Convert apparent geocentric (RA, Dec) to observed (RA, Dec). `observed_from_icrs`(ra, dec[, pm_ra, pm_dec, ...]) Convert mean position (RA, Dec) in the International Celestial Reference Frame to observed (RA, Dec). `observed_from_pupil_coords`(x_pupil, y_pupil) Convert pupil coordinates into observed (RA, Dec) `point_to_line_distance`(lon1, lat1, lon2, ...) All radians points 1 and 2 define an arc segment, this finds the distance of point 3 to the arc segment. `pupil_coords_from_ra_dec`(ra_in, dec_in[, ...]) Take an input RA and dec from the sky and convert it to coordinates on the focal plane. `ra_dec2_hpid`(nside, ra, dec, **kwargs) Assign ra,dec points to the correct healpixel. `ra_dec_from_alt_az`(alt, az, obs[, ...]) Convert altitude and azimuth to RA and Dec `ra_dec_from_native_lon_lat`(lon, lat, ...) Transform a star's position in native longitude and latitude into RA and Dec. `ra_dec_from_pupil_coords`(x_pupil, y_pupil[, ...]) @param [in] x_pupil -- pupil coordinates in radians. `ra_dec_from_xyz`(x, y, z) Utility to convert x,y,z Cartesian coordinates to RA, dec positions in space. Convert an angle in arcseconds to radians `refraction_coefficients`([wavelength, site]) Calculate the refraction using PAL's refco routine `rot_about_x`(vec, theta) Rotate a Cartesian vector an angle theta about the x axis. `rot_about_y`(vec, theta) Rotate a Cartesian vector an angle theta about the y axis. `rot_about_z`(vec, theta) Rotate a Cartesian vector an angle theta about the z axis. Given two vectors v1,v2 calculate the rotation matrix for v1->v2 using the axis-angle approach `sample_patch_on_sphere`(phi, theta, delta, size) Uniformly distributes samples on a patch on a sphere between phi pm delta, and theta pm delta on a sphere. `solar_ra_dec`(mjd[, epoch]) Return the RA and Dec of the Sun in degrees `spatially_sample_obsmetadata`(obsmetadata[, ...]) Sample a square patch on the sphere overlapping obsmetadata field of view by picking the area enclosed in obsmetadata.pointing_ra pm obsmetadata.bound_length obsmetadata.pointing_dec pm obsmetadata.bound_length Transforms between Cartesian and spherical coordinates `stellar_mags`(stellar_type[, rmag]) Calculates the expected magnitudes in LSST filters for a typical star of the given spectral type. A place to store the expected MJD start time of the survey. `trixel_from_htmid`(htmid) Return the trixel corresponding to the given htmid (htmid is the unique integer identifying each trixel). `uniform_sphere`(npoints[, seed]) Just make RA, dec points on a sphere `xyz_angular_radius`([radius]) Convert an angular radius into a physical radius for a kdtree search. `xyz_from_ra_dec`(ra, dec) Utility to convert RA,dec positions in x,y,z space.
##### Classes¶
 `BoxBounds`(ra, dec, length) `CircleBounds`(ra, dec, radius) `HalfSpace`(vector, length) HalfSpaces are circles on the unit sphere defined by intersecting a plane with the unit sphere. `LsstCameraFootprint`([units, footprint_file]) Identify point on the sky within an LSST camera footprint. `MJDWarning` A sub-class of Warning. `ModifiedJulianDate`([TAI, utc]) `ObservationMetaData`([bound_type, ...]) Track metadata for a given telescope pointing. `Site`([name, longitude, latitude, height, ...]) This class will store site information for use in Catalog objects. `SpatialBounds`(*args) Classes inheriting from this class define spatial bounds on the objects contained within a catalog. `SpecMap`([file_dict, dir_dict]) Object to store values calculated in sys-eng `TimeHandler`(initial_date) Keep track of simulation time information. `Trixel`(present_htmid, present_corners) A trixel is a single triangle in the Hierarchical Triangular Mesh (HTM) tiling scheme. `Utctout1Warning` A sub-class of MJDWarning meant for use when astropy.Time cannot interpolate ut1-utc as a function of utc because utc is out of bounds of the data. A class to generate and evaluate the Zernike polynomials.

### rubin_sim.data api¶

#### rubin_sim.data Package¶

##### Functions¶
 return a dictionary of the source filenames in the data directory Get the path to the baseline cadence simulation and the run name Get the location of the rubin_sim data directory.

### rubin_sim.photUtils api¶

#### rubin_sim.phot_utils Package¶

##### Functions¶
 `cache_lsst_seds`([wavelen_min, wavelen_max, ...]) Read all of the SEDs in sims_sed_library into a dict. `calc_astrometric_error`(mag, m5[, fwhm_geom, ...]) Calculate an expected astrometric error. `calc_gamma`(bandpass, m5, phot_params) Calculate the gamma parameter used for determining photometric signal to noise in equation 5 of the LSST overview paper (arXiv:0805.2366) `calc_instr_noise_sq`(phot_params) Combine all of the noise due to intrumentation into one value `calc_m5`(skysed, total_bandpass, hardware, ...) Calculate the AB magnitude of a 5-sigma above sky background source. `calc_mag_error_m5`(magnitude, bandpass, m5, ...) Calculate magnitude error using the model from equation (5) of arXiv:0805.2366 `calc_mag_error_sed`(source_sed, ...[, verbose]) Calculate the magnitudeError for a source, given the bandpass(es) and sky SED. `calc_neff`(fwhm_eff, platescale) Calculate the effective number of pixels in a single gaussian PSF. `calc_sky_counts_per_pixel_for_m5`(m5target, ...) Calculate the number of sky counts per pixel expected for a given value of the 5-sigma limiting magnitude (m5) `calc_snr_m5`(magnitude, bandpass, m5, phot_params) Calculate signal to noise in flux using the model from equation (5) of arXiv:0805.2366 `calc_snr_sed`(source_sed, totalbandpass, ...) Calculate the signal to noise ratio for a source, given the bandpass(es) and sky SED. `calc_total_non_source_noise_sq`(sky_sed, ...) Calculate the noise due to things that are not the source being observed (i.e. `fwhm_eff2_fwhm_geom`(fwhm_eff) Convert fwhm_eff to fwhm_geom. `fwhm_geom2_fwhm_eff`(fwhm_geom) Convert fwhm_geom to fwhm_eff. `get_imsim_flux_norm`(sed, magmatch) Calculate the flux normalization of an SED in the imsim bandpass. convert flux signal to noise ratio to an error in magnitude `read_close__kurucz`(teff, fe_h, logg) Check the cached Kurucz models and load the model closest to the input stellar parameters.
##### Classes¶
 `Bandpass`([wavelen, sb, sampling_warning]) Hold and use telescope throughput curves. `BandpassDict`(bandpass_list, bandpass_name_list) This class will wrap an OrderedDict of Bandpass instantiations. Set up a dictionary of a set of bandpasses (multi-filters). `CosmologyObject`([h0, om0, ok0, w0, wa]) `DustValues`([r_v, bandpass_dict, ref_ebv]) Calculate extinction values This class exists to store default values of seeing, m5, and gamma taken from the over view paper (arXiv 0805.2366, Table 2, 29 August 2014 version) `PhotometricParameters`([exptime, nexp, ...]) A class to store physical constants and other immutable parameters used by the sims_phot_utils code `Sed`([wavelen, flambda, fnu, badval, name]) "Hold and use spectral energy distributions (SEDs) `SedList`(sed_name_list, mag_norm_list[, ...]) This class will read in a list of Seds from disk and store them.

### rubin_sim.site_models api¶

#### rubin_sim.site_models Package¶

##### Functions¶
 `read_fields`([filename]) Read in field positions.
##### Classes¶
 `Almanac`([mjd_start, kind]) Class to load and return pre-computed information about the LSST site. `CloudData`(start_time[, cloud_db, ...]) Handle the cloud information. `CloudModel`([cloud_column, altitude_column, ...]) LSST cloud calculations for cloud extinction. `DowntimeModel`([sched_down_col, ...]) Downtime estimates, both scheduled and unscheduled. `ScheduledDowntimeData`(start_time[, ...]) Read the scheduled downtime data. `SeeingData`(start_time[, seeing_db, offset_year]) Read the seeing data from disk and return appropriate FWHM_500 value at a given time. `SeeingModel`([filter_list, eff_wavelens, ...]) LSST FWHM calculations for FWHM_effective and FWHM_geometric. `UnscheduledDowntimeData`(start_time[, seed, ...]) Handle (and create) the unscheduled downtime information.

### rubin_sim.skybrightness api¶

#### rubin_sim.skybrightness Package¶

##### Functions¶
 `all_sky_db`(date_id[, sql_q, dtypes, ...]) Take in a date_id (that corresponds to a single MJD, and return the star and sky magnitudes in a numpy structured array. `diode_sky_db`(mid_mjd[, sql_q, dtypes, ...]) `id2intid`(ids) take an array of ids, and convert them to an integer id. `intid2id`(intids, uintids, uids[, dtype]) convert an int back to an id `just_return`(inval) Really, just return the input. `load_spec_files`(filenames[, mags]) Load up the ESO spectra. `robust_rms`(array[, missing]) Use the interquartile range to compute a robust approximation of the RMS. `simple_twi`(xdata, *args) Fit a simple slope and constant to many healpixels `twilight_func`(xdata, *args[, amCut]) xdata: numpy array with columns 'alt', 'az', 'sunAlt' all in radians. Wrap only RA values into 0-2pi (using mod). `zenith_twilight`(alpha, *args) The flux at zenith as a linear combination of a twilight component and a constant: alpha = sun altitude (radians) args = ratio of (zenith twilight flux at sunAlt = -12) and dark sky zenith flux args = decay slope for all pixels (mags/radian) args = airmass term for hemisphere away from the sun.
##### Classes¶
 `Airglow`([comp_name, sorted_order, mags]) Interpolate the spectra caused by airglow. `BaseSingleInterp`([comp_name, sorted_order, mags]) Base class for sky components that only need to be interpolated on airmass `LowerAtm`([comp_name, mags]) Interpolate the spectra caused by the lower atmosphere. `MergedSpec`([comp_name, mags]) Interpolate the spectra caused by the sum of the scattered starlight, airglow, upper and lower atmosphere. `MoonInterp`([comp_name, sorted_order, mags]) Read in the saved Lunar spectra and interpolate. `ScatteredStar`([comp_name, mags]) Interpolate the spectra caused by scattered starlight. `SkyModel`([observatory, twilight, zodiacal, ...]) `TwilightInterp`([mags, dark_sky_mags, ...]) `UpperAtm`([comp_name, mags]) Interpolate the spectra caused by the upper atmosphere. `ZodiacalInterp`([comp_name, sorted_order, mags]) Interpolate the zodiacal light based on the airmass and the healpix ID where the healpixels are in ecliptic coordinates, with the sun at ecliptic longitude zero

### rubin_sim.skybrightness_pre api¶

#### rubin_sim.skybrightness_pre Package¶

##### Functions¶
 `dark_sky`([nside]) Load an array of HEALpix maps that have the darkest expected sky backgrounds per filter. `interp_angle`(x_out, xp, anglep[, degrees]) Interpolate angle values (handle wrap around properly).
##### Classes¶
 `SkyModelPre`([data_path, init_load_length, ...]) Load pre-computed sky brighntess maps for the LSST site and use them to interpolate to arbitrary dates.

### rubin_sim.scheduler api¶

#### rubin_sim.scheduler Package¶

##### Functions¶
 `sim_runner`(observatory, scheduler[, ...]) run a simulation

#### rubin_sim.scheduler.schedulers Package¶

##### Classes¶
 `CoreScheduler`(surveys[, nside, camera, ...]) Core scheduler that takes completed observations and observatory status and requests observations `FilterSchedUzy`([illum_limit]) remove u in bright time. A simple way to schedule what filter to load `SimpleFilterSched`([illum_limit])

#### rubin_sim.scheduler.surveys Package¶

##### Functions¶
 `dd_bfs`(RA, dec, survey_name, ha_limits[, ...]) Convienence function to generate all the feasibility basis functions `generate_dd_surveys`([nside, nexp, ...]) Utility to return a list of standard deep drilling field surveys. `generate_ddf_scheduled_obs`([data_file, ...]) Parameters: `generate_desc_dd_surveys`([nside, nexp, ...])
##### Classes¶
 `BaseMarkovSurvey`(basis_functions, basis_weights) A Markov Decision Function survey object. `BaseSurvey`(basis_functions[, ...]) A baseclass for survey objects. `BlobSurvey`(basis_functions, basis_weights[, ...]) Select observations in large, mostly contiguous, blobs. `DeepDrillingSurvey`(basis_functions, RA, dec) A survey class for running deep drilling fields. `DescDdf`(basis_functions, RA, dec[, ...]) DDF survey based on Scolnic et al Cadence White Paper. `FieldSurvey`(basis_functions, RA, dec[, ...]) `GreedySurvey`(basis_functions, basis_weights) Select pointings in a greedy way using a Markov Decision Process. `LongGapSurvey`(blob_survey, scripted_survey) Parameters: `PairsSurveyScripted`(basis_functions[, ...]) Check if incoming observations will need a pair in 30 minutes. `PlanAheadSurvey`(basis_functions, basis_weights) Have a survey object that can plan ahead if it will want to observer a blob later in the night `ScriptedSurvey`(basis_functions[, reward, ...]) Take a set of scheduled observations and serve them up. `TooMaster`(example__to_o_survey) A target of opportunity class. `TooSurvey`(basis_functions, basis_weights[, ...]) Survey class to catch incoming target of opportunity anouncements and try to observe them.

#### rubin_sim.scheduler.basis_functions Package¶

##### Classes¶
 `AfterEveningTwiBasisFunction`([time_after, ...]) Only execute right after evening twilight `AggressiveSlewtimeBasisFunction`([max_time, ...]) Reward slews that take little time `AreaCheckMaskBasisFunction`(bf_list[, nside, ...]) Take a list of other mask basis functions, and do an additional check for area available `AvoidDirectWind`([wind_speed_maximum, nside]) Basis function to avoid direct wind. `AvoidFastRevists`([filtername, nside, ...]) Marks targets as unseen if they are in a specified time window in order to avoid fast revisits. `AvoidLongGapsBasisFunction`([filtername, ...]) Boost the reward on parts of the survey that haven't been observed for a while. `AzModuloBasisFunction`([nside, az_limits, ...]) Try to replicate the Rothchild et al cadence forcing by only observing on limited az ranges per night. `AzimuthBasisFunction`([nside]) Reward staying in the same azimuth range. `BalanceVisits`(nobs_reference, note_survey, ...) Balance visits across multiple surveys. `BaseBasisFunction`([nside, filtername]) Class that takes features and computes a reward function when called. `CablewrapUnwrapBasisFunction`([nside, ...]) Parameters: `CadenceEnhanceBasisFunction`([filtername, ...]) Drive a certain cadence Drive a certain cadence, like CadenceEnhanceBasisFunction but with smooth transitions `CadenceInSeasonBasisFunction`(drive_map[, ...]) Drive observations at least every N days in a given area `CloudedOutBasisFunction`([cloud_limit]) `ConstantBasisFunction`([nside, filtername]) Just add a constant `DecModuloBasisFunction`([nside, dec_limits, ...]) Emphasize dec bands on a nightly varying basis `DelayStartBasisFunction`([nights_delay]) Force things to not run before a given night `EclipticBasisFunction`([nside, distance_to_eclip]) Mark the area around the ecliptic `EndOfEveningBasisFunction`([time_remaining, ...]) Only let observations happen in a limited time before twilight `FilterChangeBasisFunction`([filtername]) Reward staying in the current filter. `FilterLoadedBasisFunction`([filternames]) Check that the filter(s) needed are loaded `FootprintBasisFunction`([filtername, nside, ...]) Basis function that tries to maintain a uniformly covered footprint `FootprintNvisBasisFunction`([filtername, ...]) Basis function to drive observations of a given footprint. `FootprintRollingBasisFunction`([filtername, ...]) Let's get the rolling really right. `ForceDelayBasisFunction`([days_delay, ...]) Keep a survey from executing to rapidly. `FractionOfObsBasisFunction`(frac_total[, ...]) Limit the fraction of all observations that can be labled a certain survey name. Remove the bonus for staying in the same filter if certain conditions are met. `GoodSeeingBasisFunction`([nside, filtername, ...]) Drive observations in good seeing conditions `HaMaskBasisFunction`([ha_min, ha_max, nside]) Limit the sky based on hour angle `HourAngleLimitBasisFunction`([RA, ha_limits]) Only execute a survey in limited hour angle ranges. `LimitObsPnightBasisFunction`([survey_str, nlimit]) `LimitRepeatBasisFunction`([nside, ...]) Mask out pixels that haven't been observed in the night `LookAheadDdfBasisFunction`(frac_total, ...[, ...]) Look into the future to decide if it's a good time to observe or block. `M5DiffBasisFunction`([filtername, nside]) Basis function based on the 5-sigma depth. `MapCloudBasisFunction`([nside, ...]) Mark healpixels on a map if their cloud values are greater than the same healpixels on a maximum cloud map. `MapModuloBasisFunction`(inmaps) Similar to Dec_modulo, but now use input masks `MaskAzimuthBasisFunction`([nside, ...]) Mask pixels based on azimuth `MoonAvoidanceBasisFunction`([nside, ...]) Avoid looking too close to the moon. `MoonDownBasisFunction`([nside, filtername]) Demand the moon is down `NGoodSeeingBasisFunction`([filtername, ...]) Try to get N "good seeing" images each observing season `NObsHighAmBasisFunction`([nside, filtername, ...]) Reward only reward/count observations at high airmass `NObsPerYearBasisFunction`([filtername, ...]) Reward areas that have not been observed N-times in the last year `NearSunTwilightBasisFunction`([nside, ...]) Reward looking into the twilight for NEOs at high airmass `NightModuloBasisFunction`([pattern]) Only return true on certain nights `NotTwilightBasisFunction`([sun_alt_limit]) `ObservedTwiceBasisFunction`([nside, ...]) Mask out pixels that haven't been observed in the night `OnceInNightBasisFunction`([notes]) Stop observing if something has been executed already in the night `PlanetMaskBasisFunction`([mask_radius, ...]) Mask the bright planets `RewardNObsSequence`(n_obs_survey, note_survey) Reward taking a sequence of observations. `RisingMoreBasisFunction`(RA[, pad]) Say a spot is not available if it will rise substatially before twilight. `SeasonCoverageBasisFunction`([filtername, ...]) Basis function to encourage N observations per observing season `SkybrightnessLimitBasisFunction`([nside, ...]) Mask regions that are outside a sky brightness limit `SlewtimeBasisFunction`([max_time, ...]) Reward slews that take little time `SoftDelayBasisFunction`([fractions, delays, ...]) Like Force_delay, but go ahead and let things catch up if they fall far behind. Mask things at various solar elongations `StrictFilterBasisFunction`([time_lag, ...]) Remove the bonus for staying in the same filter if certain conditions are met. `SunAltHighLimitBasisFunction`([alt_limit]) Don't observe unless the sun is above some limit `SunAltLimitBasisFunction`([alt_limit]) Don't try unless the sun is below some limit `TargetMapBasisFunction`([filtername, nside, ...]) Basis function that tracks number of observations and tries to match a specified spatial distribution `TargetMapModuloBasisFunction`([day_offset, ...]) Basis function that tracks number of observations and tries to match a specified spatial distribution can enter multiple maps that will be used at different times in the survey `TemplateGenerateBasisFunction`([nside, ...]) Emphasize areas that have not been observed in a long time `ThirdObservationBasisFunction`([nside, ...]) If there have been observations in two filters long enough ago, go for a third `TimeInTwilightBasisFunction`([time_needed]) Make sure there is some time left in twilight. `TimeToScheduledBasisFunction`([time_needed]) Make sure there is enough time before next scheduled observation. `TimeToTwilightBasisFunction`([time_needed, ...]) Make sure there is enough time before twilight. `VisitGap`(note[, filter_names, gap_min, ...]) Basis function to create a visit gap based on the survey note field. `VisitRepeatBasisFunction`([gap_min, gap_max, ...]) Basis function to reward re-visiting an area on the sky. `ZenithMaskBasisFunction`([min_alt, max_alt, ...]) Just remove the area near zenith. `ZenithShadowMaskBasisFunction`([nside, ...]) Mask the zenith, and things that will soon pass near zenith.

#### rubin_sim.scheduler.features Package¶

##### Classes¶
 `BaseFeature`(**kwargs) Base class for features. `BaseSurveyFeature`(**kwargs) Feature that tracks progreess of the survey. `CoaddedDepth`([filtername, nside, fwh_meff_limit]) Track the co-added depth that has been reached accross the sky `Conditions`([nside, site, exptime, ...]) Class to hold telemetry information Record when the filter last changed. `LastNObsTimes`([filtername, n_obs, nside]) Record the last three observations for each healpixel `LastObservation`([survey_name]) Track the last observation. `LastObserved`([filtername, nside, fill]) Track when a pixel was last observed. `LastsequenceObservation`([sequence_ids]) When was the last observation `NObsCount`([filtername, tag]) Count the number of observations. `NObsCountSeason`(season[, nside, filtername, ...]) Count the number of observations. `NObsNight`([filtername, nside]) Track how many times something has been observed in a night (Note, even if there are two, it might not be a good pair.) `NObsSurvey`([note]) Count the number of observations. `NObservations`([filtername, nside, survey_name]) Track the number of observations that have been made across the sky. `NObservationsCurrentSeason`([filtername, ...]) Track how many observations have been taken in the current season that meet criteria `NObservationsSeason`(season[, filtername, ...]) Track the number of observations that have been made across sky `NoteInNight`([notes]) How many times a matching note has executed in the current night `NoteLastObserved`(note[, filtername]) Track the last time an observation with a particular `note` field was made. `PairInNight`([filtername, nside, gap_min, ...]) Track how many pairs have been observed within a night `RotatorAngle`([filtername, binsize, nside]) Track what rotation angles things are observed with. `SurveyInNight`([survey_str]) Keep track of how many times a survey has executed in a night.

#### rubin_sim.scheduler.detailers Package¶

##### Functions¶
 `calc_target_m5s`([alt, fiducial_seeing, exptime]) Use the skybrightness model to find some good target m5s.
##### Classes¶
 `BaseDetailer`([nside]) A Detailer is an object that takes a list of proposed observations and adds "details" to them. `CameraRotDetailer`([max_rot, min_rot, ...]) Randomly set the camera rotation, either for each exposure, or per night. `CloseAltDetailer`([alt_band]) re-order a list of observations so that the closest in altitude to the current pointing is first. `Comcam90rotDetailer`([nside]) Detailer to set the camera rotation so rotSkyPos is 0, 90, 180, or 270 degrees. `DitherDetailer`([max_dither, seed, ...]) make a uniform dither pattern. `EuclidDitherDetailer`([dither_bearing_dir, ...]) Directional dithering for Euclid DDFs `FilterNexp`([filtername, nexp, exptime]) Demand one filter always be taken as a certain number of exposures `FixedSkyAngleDetailer`([sky_angle, nside]) Detailer to force a specific sky angle. Update the flush-by MJD to be before any scheduled observations Convert all the rotTelPos values to rotSkyPos_desired `ShortExptDetailer`([exp_time, filtername, ...]) Check if the area has been observed with a short exposure time this year. `SpiderRotDetailer`([nside]) Set the camera rotation to +/- 45 degrees so diffraction spikes align along chip rows and columns `TakeAsPairsDetailer`([filtername, exptime, ...]) `TwilightTripleDetailer`([slew_estimate, ...]) `VaryExptDetailer`([nside, min_expt, ...]) Vary the exposure time on observations to try and keep each observation at uniform depth. `ZeroRotDetailer`([nside]) Detailer to set the camera rotation to be apporximately zero in rotTelPos.

#### rubin_sim.scheduler.model_observatory Package¶

##### Classes¶
 `KinemModel`([location, park_alt, park_az, ...]) A Kinematic model of the telescope. `ModelObservatory`([nside, mjd_start, ...]) A class to generate a realistic telemetry stream for the scheduler Dummy class that will always say there are no clouds Dummy class to always return nominal seeing

#### rubin_sim.scheduler.utils Package¶

##### Functions¶
 `calc_norm_factor`(goal_dict[, radius]) Calculate how to normalize a Target_map_basis_function. `combo_dust_fp`([nside, wfd_weights, ...]) Based on the Olsen et al Cadence White Paper `comcam_tessellate`([side_length, overlap]) Tesselate the sphere with a square footprint `create_season_offset`(nside, sun_ra_rad) Make an offset map so seasons roll properly Return a numpy array that could be a handy observation record `filter_count_ratios`(target_maps) Given the goal maps, compute the ratio of observations we want in each filter. `galactic_plane_healpixels`([nside, ...]) Define a Galactic Plane region. `generate_all_sky`([nside, elevation_limit, mask]) Set up a healpix map over the entire sky. Generate the matrix for the distance between town i and j `generate_goal_map`([nside, nes_fraction, ...]) Handy function that will put together a target map in the proper order. `generate_hulls`(towns) Given an array of x,y points, sort them into concentric hulls `get_dustmap`([nside]) `gnomonic_project_tosky`(x, y, r_acen, deccen) Calculate RA/dec on sky of object with x/y and RA/Cen of field of view. `gnomonic_project_toxy`(ra1, dec1, r_acen, deccen) Calculate x/y projection of ra1/dec1 in system with center at r_acen, deccen. `hp_kd_tree`([nside, leafsize, scale]) Generate a KD-tree of healpixel locations `inrange`(inval[, minimum, maximum]) Make sure values are within min/max `int_binned_stat`(ids, values[, statistic]) Like scipy.binned_statistic, but for unique int ids `magellanic_clouds_healpixels`([nside, ...]) Define the Galactic Plane region. `make_rolling_footprints`([fp_hp, mjd_start, ...]) Generate rolling footprints `match_hp_resolution`(in_map, nside_out[, ...]) Utility to convert healpix map resolution if needed and change hp.UNSEEN values to np.nan. `merge_hulls`(indices_lists, dist_matrix) Combine the hulls `nes_healpixels`([nside, min_eb, max_eb, dec_min]) Define the North Ecliptic Spur region. `ra_dec_hp_map`([nside]) Return all the RA,dec points for the centers of a healpix map, in radians. `raster_sort`(x0[, order, xbin]) XXXX--depriciated, use tsp instead. `restore_scheduler`(observation_id, scheduler, ...) Put the scheduler and observatory in the state they were in. `rotate_ra_dec`(ra, dec, ra_target, dec_target) Rotate ra and dec coordinates to be centered on a new dec. `route_length`(town_indx, dist_matrix) Find the length of a route `run_info_table`(observatory[, extra_info]) Make a little table for recording the information about a run Make an array to hold pre-scheduling observations `scp_healpixels`([nside, dec_max]) Define the South Celestial Pole region. `season_calc`(night[, offset, modulo, ...]) Compute what season a night is in with possible offset and modulo using convention that night -365 to 0 is season -1. `set_default_nside`([nside]) Utility function to set a default nside value across the scheduler. `slice_quad_galactic_cut`(target_map[, ...]) Helper function for generating rolling footprints `slice_wfd_area_quad`(target_map[, nslice, ...]) Divide a healpix map in an intelligent way `slice_wfd_indx`(target_map[, nslice, wfd_indx]) simple map split `smallest_signed_angle`(a1, a2) `standard_goals`([nside]) A quick function to generate the "standard" goal maps. `three_opt`(route, dist_matrix) Iterates over all possible 3-optional transformations. `tsp_convex`(towns[, optimize, niter]) Find a route through towns `warm_start`(scheduler, observations[, mjd_key]) Replay a list of observations into the scheduler `wfd_healpixels`([nside, dec_min, dec_max]) Define a region based on declination limits only. `wfd_no_dust_healpixels`(nside[, dec_min, ...]) Define a WFD region with a dust extinction limit. `wfd_no_gp_healpixels`(nside[, dec_min, ...]) Define a wide fast deep region with a galactic plane limit. `wrap_ra_dec`(ra, dec) Wrap RA into 0-2pi and Dec into +/0 pi/2.
##### Classes¶
 `BasePixelEvolution`([period, rise, t_start]) Helper class that can be used to describe the time evolution of a HEALpix in a footprint `ConstantFootprint`([nside, filters]) `EuclidOverlapFootprint`([nside, dust_limit, ...]) `Footprint`(mjd_start[, sun_ra_start, nside, ...]) An object to compute the desired survey footprint at a given time `Footprints`(footprint_list) An object to combine multiple Footprint objects. `HpInComcamFov`([nside, side_length]) Return the healpixels within a ComCam pointing. `HpInLsstFov`([nside, fov_radius, scale]) Return the healpixels within a pointing. `HpmapCross`([nside, radius, radius_search]) Find the cross-correlation of a healpix map and a bunch of rotated pointings `IntRounded`(inval[, scale]) Class to help force comparisons be made on scaled up integers, preventing machine precision issues cross-platforms `Pointings2hp`(nside[, radius]) Convert a list of telescope pointings and convert them to a pointing map Record how to convert an observation array to the standard opsim schema `SimTargetooServer`(targeto_o_list) Wrapper to deliver a targetoO object at the right time `SkyAreaGenerator`([nside, dust_limit, ...]) Generate survey footprint maps in each filter. `SkyAreaGeneratorGalplane`([nside, ...]) `StepLine`([period, rise, t_start]) Parameters: `StepSlopes`([period, rise, t_start]) Parameters: `TargetoO`(tooid, footprint, mjd_start, duration) Class to hold information about a target of opportunity object

### rubin_sim.movingObjects api¶

#### rubin_sim.moving_objects Package¶

##### Functions¶
 `chebeval`(x, p[, interval, do_velocity, mask]) Evaluate a Chebyshev series and first derivative at points x. `chebfit`(t, x[, dxdt, x_multiplier, ...]) Fit Chebyshev polynomial constrained at endpoints using Newhall89 approach. Find where the oorb files should be installed `make_cheb_matrix`(n_points, n_poly[, weight]) Compute C1^(-1)C2 using Newhall89 approach. `make_cheb_matrix_only_x`(n_points, n_poly) Compute C1^(-1)C2 using Newhall89 approach without dx/dt `read_observations`(simfile, colmap[, ...]) Read the opsim database. `read_orbits`(orbit_file) Read the orbits from the orbit_file. `run_obs`(orbits, simdata, colmap, obs_file[, ...]) Generate the observations. `setup_colors`(obs, filterlist, orbits)
##### Classes¶
 `BaseObs`([footprint, r_fov, x_tol, y_tol, ...]) Base class to generate observations of a set of moving objects. `ChebyFits`(orbits_obj, t_start, t_span[, ...]) Generates chebyshev coefficients for a provided set of orbits. Calculates positions, velocities, deltas, vmags and elongations, given a series of coefficients generated by ChebyFits. `DirectObs`([footprint, r_fov, x_tol, y_tol, ...]) Generate observations of a set of moving objects: exact ephemeris at the times of each observation. `LinearObs`([footprint, r_fov, x_tol, y_tol, ...]) Generate observations for a set of Orbits using linear interpolation. Orbits reads, checks for required values, and stores orbit parameters for moving objects. `PyOrbEphemerides`([ephfile]) Generate ephemerides and propagate orbits using the python interface to Oorb.

### rubin_sim.maf api¶

#### rubin_sim.maf.batches Package¶

##### Functions¶
 `allMetadata`([colmap, runName, extraSql, ...]) Generate a large set of metrics about the metadata of each visit - distributions of airmass, normalized airmass, seeing, sky brightness, single visit depth, hour angle, distance to the moon, and solar elongation. `altazHealpix`([colmap, run_name, extraSql, ...]) Generate a set of metrics measuring the number visits as a function of alt/az plotted on a HealpixSkyMap. `altazLambert`([colmap, runName, extraSql, ...]) Generate a set of metrics measuring the number visits as a function of alt/az plotted on a LambertSkyMap. `astrometryBatch`([colmap, runName, extraSql, ...]) Metrics for evaluating proper motion and parallax. `characterization_inner_batch`(slicer[, ...]) Characterization metrics for inner solar system objects. `characterization_outer_batch`(slicer[, ...]) Characterization metrics for outer solar system objects. `col_map_dict`([dict_name]) `combine_info_labels`(info1, info2) `combine_subsets`(mbSubsets) `ddfBatch`([run_name, nside, radius, ...]) Parameters: `discovery_batch`(slicer[, colmap, run_name, ...]) `eastWestBias`([colmap, runName, extraSql, ...]) Plot the number of observations to the east vs to the west, per night. `extended_metrics`(colname[, replace_colname]) An extended set of simple metrics for some quantity. An extended set of summary metrics, to calculate all that is in the standard summary stats, plus 25/75 percentiles. `fOBatch`([colmap, runName, extraSql, ...]) Metrics for calculating fO. `filter_list`([all, extra_sql, extra_info_label]) Return a list of filters, plot colors and orders. `filtersPerNight`([colmap, runName, nights, ...]) Generate a set of metrics measuring the number and rate of filter changes over a given span of nights. `filtersWholeSurvey`([colmap, runName, ...]) Generate a set of metrics measuring the number and rate of filter changes over the entire survey. `firstYearMetadata`([colmap, runName, ...]) Measure the distribution of some basic metadata in the first year of operations - distributions of airmass, seeing, sky brightness, single visit depth. `fraction_population_at_threshold`(thresholds) Creates a list of summary metrics to be applied to any moving object metric which reports a float value, calculating the fraction of the population above X. `get_col_map`(opsdb) Get the colmap dictionary, if you already have a database object. `glanceBatch`([colmap, run_name, nside, ...]) Generate a handy set of metrics that give a quick overview of how well a survey performed. `hourglassPlots`([colmap, runName, nyears, ...]) Run the hourglass metric, for each individual year. `interNight`([colmap, runName, nside, ...]) Generate a set of statistics about the spacing between nights with observations. `intraNight`([colmap, runName, nside, ...]) Generate a set of statistics about the pair/triplet/etc. `meanRADec`([colmap, runName, extraSql, ...]) Plot the range of RA/Dec as a function of night. `metadataBasics`(value[, colmap, runName, ...]) Calculate basic metrics on visit metadata 'value' (e.g. `metadataBasicsAngle`(value[, colmap, ...]) Calculate basic metrics on visit metadata 'value', where value is a wrap-around angle. `metadataMaps`(value[, colmap, runName, ...]) Calculate 25/50/75 percentile values on maps across sky for a single metadata value. `metadata_bundle_dicts`(allsky_slicer, wfd_slicer) `microlensing_summary`(metric_type[, ...]) `nvisitsM5Maps`([colmap, runName, extraSql, ...]) Generate maps of the number of visits and coadded depth (with and without dust extinction) in all bands and per filter. `nvisitsPerNight`([colmap, runName, ...]) Count the number of visits per night through the survey. `nvisitsPerSubset`([colmap, runName, ...]) Look at the distribution of a given sql constraint or footprint constraint's visits, total number and distribution over time (# per night), if possible. `openshutterFractions`([colmap, runName, ...]) Evaluate open shutter fraction over whole survey and per night. `plot_activity`(bdict[, figroot, results_db, ...]) `plot_completeness`(bdictCompleteness[, ...]) Plot a minor subset of the completeness results. `plot_fractions`(bdictFractions[, figroot, ...]) `plot_single`(bundle[, results_db, out_dir, ...]) Plot 5%/25%/50%/75%/95% iles for a metric value. `quick_discovery_batch`(slicer[, colmap, ...]) `radec_cols`(dither_stacker, colmap[, ...]) `rapidRevisitBatch`([colmap, runName, ...]) Metrics for evaluating proper motion and parallax. `read_and_combine`(orbitRoot, baseDir, splits, ...) Read and combine the metric results from split locations, returning a single bundle. `run_completeness_summary`(bdict, h_mark, ...) 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. `run_fraction_summary`(bdict, h_mark, out_dir, ...) Calculate fractional completeness of the population for color and lightcurve metrics. `science_radar_batch`([runName, nside, ...]) A batch of metrics for looking at survey performance relative to the SRD and the main science drivers of LSST. `seasons`([colmap, runName, nside, extraSql, ...]) Generate a set of statistics about the length and number of seasons. `setup_mo_slicer`(orbit_file, h_range[, obs_file]) Set up the slicer and read orbit_file and obs_file from disk. `slewActivities`([colmap, runName, ...]) Generate a set of slew statistics focused on finding the contributions to the overall slew time. `slewAngles`([colmap, runName, sqlConstraint]) Generate a set of slew statistics focused on the angles of each component (dome and telescope). `slewBasics`([colmap, runName, sqlConstraint]) Generate a simple set of statistics about the slew times and distances. `slewSpeeds`([colmap, runName, sqlConstraint]) Generate a set of slew statistics focused on the speeds of each component (dome and telescope). `ss_population_defaults`(objtype) Provide useful default ranges for H, based on objtype of population type. `standard_angle_metrics`(colname[, ...]) A set of standard simple metrics for some quantity which is a wrap-around angle. `standard_metrics`(colname[, replace_colname]) A set of standard simple metrics for some quantity. `standard_summary`([withCount]) A set of standard summary metrics, to calculate Mean, RMS, Median, #, Max/Min, and # 3-sigma outliers. `summary_completeness_at_time`(times, h_val[, ...]) A simple list of summary metrics to be applied to the Discovery_Time or PreviouslyKnown metrics. A simple list of summary metrics to be applied to the Discovery_N_Chances metric. `tEffMetrics`([colmap, runName, extraSql, ...]) Generate a series of Teff metrics. `timeGaps`([colmap, runName, nside, extraSql, ...]) Generate a set of statistics about the spacing between nights with observations.

#### rubin_sim.maf.metrics Package¶

##### Functions¶
 `calc_interval_decay`(delta_tobs, tau) `find_season_edges`(seasons) Given the seasons, return the indexes of each start/end of the season. `galplane_nvisits_thresholds`(tau_obs[, nyears]) "Return estimated nvisits required to well-sample lightcurves that need sampling every tau_obs (days). `galplane_priority_map_thresholds`(science_map) Return minimum threshold for priority maps, when considering filter balance. `integrate_over_h`(metric_values, hvalues[, ...]) Calculate a metric value integrated over an h_range. `neo_dndh_granvik`(hvalues, **kwargs) `neo_dndh_grav`(hvalues, **kwargs) `pha_dndh_granvik`(hvalues, **kwargs) `pha_dndh_grav`(hvalues, **kwargs) `power_law_dndh`(hvalues[, hindex, no, ho]) Power law distribution of objects. `sum_over_h`(metric_values, hvalues[, dndh_func]) Calculate the sum of the metric value multiplied by the number of objects at each H value.
##### Classes¶
 `AbsMaxMetric`([col, metric_name, maps, ...]) Calculate the max of the absolute value of a simData column slice. `AbsMaxPercentMetric`([col, metric_name, ...]) Return the percent of the data which has the absolute value of the max value of the data. `AbsMeanMetric`([col, metric_name, maps, ...]) Calculate the mean of the absolute value of a simData column slice. `AbsMedianMetric`([col, metric_name, maps, ...]) Calculate the median of the absolute value of a simData column slice. `AccumulateCountMetric`([col, bins, bin_col, ...]) `AccumulateM5Metric`([bins, bin_col, m5_col, ...]) `AccumulateMetric`([col, bins, bin_col, ...]) Calculate the accumulated stat `AccumulateUniformityMetric`([bins, bin_col, ...]) Make a 2D version of UniformityMetric `ActivityOverPeriodMetric`(bin_size[, ...]) Count fraction of object period we could identify activity for an SSobject. `ActivityOverTimeMetric`(window[, snr_limit, ...]) Count fraction of survey we could identify activity for an SSobject. `AgnTimeLagMetric`([lag, z, log, threshold, ...]) `AngularSpreadMetric`([col, period]) Compute the angular spread statistic which measures uniformity of a distribution angles accounting for 2pi periodicity. `AreaSummaryMetric`([col, metric_name, area, ...]) Find the min/max of a value in the best area. `AreaThresholdMetric`([col, metric_name, ...]) Find the amount of area on the sky that meets a given threshold value. `AveSlewFracMetric`([col, activity, ...]) `BDParallaxMetric`([metric_name, m5_col, ...]) Calculate the distance to which one could reach a parallax SNR for a given object Modification of ParallaxMetric, illustrated in https://github.com/jgizis/LSST-BD-Cadence/blob/main/bd_allLT_baseline_17.ipynb `BaseMetric`([col, metric_name, maps, units, ...]) Base class for the metrics. `BaseMoMetric`([cols, metric_name, units, ...]) Base class for the moving object metrics. `BinaryMetric`([col, metric_name, maps, ...]) Return 1 if there is data. `BruteOSFMetric`([metric_name, exp_time_col, ...]) Assume I can't trust the slewtime or visittime colums. `CampaignLengthMetric`([mjd_col, ...]) Calculate the number of seasons (roughly, years) a pointing is observed for. `ChipVendorMetric`([cols]) See what happens if we have chips from different vendors `Coaddm5Metric`([m5_col, metric_name]) Calculate the coadded m5 value at this gridpoint. ColRegistry tracks the columns needed for all metric objects (kept internally in a set). `ColorAsteroidMetric`([weight_det, snr_max, ...]) This metric is appropriate for MBAs and NEOs, and other inner solar system objects. `CountBeyondThreshold`([col, lower_threshold, ...]) Count the number of entries in a data column above or below the threshold. `CountExplimMetric`([col, min_exp, ...]) Count the number of x second visits. `CountMetric`([col]) Count the length of a simData column slice. `CountRatioMetric`([col, norm_val, ...]) Count the length of a simData column slice, then divide by 'norm_val'. `CountSubsetMetric`([col, subset, units]) Count the length of a simData column slice which matches 'subset'. `CountUniqueMetric`([col, metric_name, maps, ...]) Return the number of unique values. `CrowdingM5Metric`([crowding_error, ...]) Return the magnitude at which the photometric error exceeds crowding_error threshold. `CrowdingMagUncertMetric`([rmag, seeing_col, ...]) Given a stellar magnitude, calculate the mean uncertainty on the magnitude from crowding. `CumulativeMetric`([metric_name, time_col, ...]) For plotting up the cumulative number of observations. `DcrPrecisionMetric`([metric_name, ...]) Determine how precise a DCR correction could be made `DiscoveryDistanceMetric`(parent_discovery_metric) Returns the distance of the first discovery track of an SSobject. `DiscoveryEclonlatMetric`(parent_discovery_metric) Returns the ecliptic lon/lat and solar elong of the first discovery track of an SSobject. `DiscoveryMetric`([n_obs_per_night, t_min, ...]) Identify the discovery opportunities for an SSobject. `DiscoveryNChancesMetric`(parent_discovery_metric) Calculate total number of discovery opportunities for an SSobject. `DiscoveryNObsMetric`(parent_discovery_metric) Calculates the number of observations in the first discovery track of an SSobject. `DiscoveryRadecMetric`(parent_discovery_metric) Returns the RA/Dec of the first discovery track of an SSobject. `DiscoveryTimeMetric`(parent_discovery_metric) Returns the time of the first discovery track of an SSobject. `DiscoveryVelocityMetric`(parent_discovery_metric) Returns the sky velocity of the first discovery track of an SSobject. `ExgalM5`([m5_col, metric_name, units, filter_col]) Calculate co-added five-sigma limiting depth after dust extinction. `ExgalM5WithCuts`([m5_col, filter_col, ...]) Calculate co-added five-sigma limiting depth, but apply dust extinction and depth cuts. `FOArea`([col, n_visit, asky, nside, norm, ...]) Metrics based on a specified number of visits, but returning AREA related to Nvisits: given n_visit, what amount of sky is covered with at least that many visits? `FONv`([col, asky, nside, n_visit, norm, ...]) Metrics based on a specified area, but returning NVISITS related to area: given asky, what is the minimum and median number of visits obtained over that much area? (choose the portion of the sky with the highest number of visits first). `FftMetric`([times_col, metric_name, n_coeffs]) Calculate a truncated FFT of the exposure times. `FootprintFraction`([footprint, metric_name, ...]) Find what fraction of a desired footprint got covered. `FracAboveMetric`([col, cutoff, scale, ...]) Find the fraction of data values above a given value. `FracBelowMetric`([col, cutoff, scale, ...]) Find the fraction of data values below a given value. `FullRangeAngleMetric`([col, metric_name, ...]) Calculate the full range of an angular (degrees) simData column slice. `FullRangeMetric`([col, metric_name, maps, ...]) Calculate the range of a simData column slice. `GalPlaneFootprintMetric`(science_map[, ...]) Evaluate the survey overlap with desired regions in the Galactic Plane and Magellanic Clouds, by referencing the pre-computed priority maps provided. `GalPlaneSeasonGapsTimescaleMetric`(science_map) Metric to evaluate the gap between sequential seasonal gaps in observations in a lightcurve relative to the scientifically desired sampling interval. `GalPlaneTimePerFilterMetric`(science_map[, ...]) Evaluate the fraction of exposure time spent in each filter as a fraction of the total exposure time dedicated to that healpix in the weighted galactic plane priority maps. `GalPlaneVisitIntervalsTimescaleMetric`(...[, ...]) Evaluate the intervals between sequential observations in a lightcurve relative to the scientifically desired sampling interval. `HighVelocityMetric`([psf_factor, snr_limit, ...]) Count number of times an SSobject appears trailed. `HighVelocityNightsMetric`([psf_factor, ...]) Count the number of discovery opportunities (via trailing) for an SSobject. `HistogramM5Metric`([bins, bin_col, m5_col, ...]) Calculate the coadded depth for each bin (e.g., per night). `HistogramMetric`([bins, bin_col, col, units, ...]) A wrapper to stats.binned_statistic `HourglassMetric`([telescope, mjd_col, ...]) Plot the filters used as a function of time. `IdentityMetric`([col, metric_name, maps, ...]) Return the metric value itself . `InstantaneousColorMetric`([n_pairs, ...]) Identify SSobjects which could have observations suitable to determine colors. `InterNightGapsMetric`([mjd_col, night_col, ...]) Calculate the (reduce_func) of the gap between consecutive observations in different nights, in days. `IntraNightGapsMetric`([mjd_col, night_col, ...]) Calculate the (reduce_func) of the gap between consecutive observations within a night, in hours. `KnownObjectsMetric`([elong_thresh, ...]) Identify SSobjects which could be classified as 'previously known' based on their peak V magnitude. `KuiperMetric`([col, metric_name, maps, ...]) Find the Kuiper V statistic for a distribution, useful for angles. `LightcurveColorOuterMetric`([snr_limit, ...]) This metric is appropriate for outer solar system objects, such as TNOs and SDOs. This metric is generally applicable to NEOs and MBAs - inner solar system objects. `LongGapAGNMetric`([metric_name, mjdcol, ...]) max delta-t and average of the top-10 longest gaps. `MagicDiscoveryMetric`([n_obs, t_window, ...]) Count the number of nights with discovery opportunities with very good software for an SSobject. `MaxGapMetric`([mjd_col]) Find the maximum gap (in days) in between successive observations. `MaxMetric`([col, metric_name, maps, units, ...]) Calculate the maximum of a simData column slice. `MaxPercentMetric`([col, metric_name, maps, ...]) Return the percent of the data which has the maximum value. `MaxStateChangesWithinMetric`([change_col, ...]) Compute the maximum number of changes of state that occur within a given timespan. `MeanAngleMetric`([col, metric_name, maps, ...]) Calculate the mean of an angular (degree) simData column slice. `MeanCampaignFrequencyMetric`([mjd_col, ...]) Calculate the mean separation between nights, within a season - then the mean over the campaign. `MeanMetric`([col, metric_name, maps, units, ...]) Calculate the mean of a simData column slice. `MeanValueAtHMetric`([h_mark, reduce_func, ...]) Return the mean value of a metric at a given H. `MedianMetric`([col, metric_name, maps, ...]) Calculate the median of a simData column slice. `MetricRegistry`(name, bases, dict) Meta class for metrics, to build a registry of metric classes. `MinMetric`([col, metric_name, maps, units, ...]) Calculate the minimum of a simData column slice. `MinTimeBetweenStatesMetric`([change_col, ...]) Compute the minimum time between changes of state in a column value. `MoCompletenessAtTimeMetric`(times[, hval, ...]) Calculate the completeness (relative to the entire population) <= a given H as a function of time, given the times of each discovery. `MoCompletenessMetric`([threshold, nbins, ...]) Calculate the fraction of the population that meets `threshold` value or higher. `NChangesMetric`([col, order_by]) Compute the number of times a column value changes. `NNightsMetric`([snr_limit]) Count the number of distinct nights an SSobject is observed. `NObsMetric`([snr_limit]) Count the total number of observations where an SSobject was 'visible'. `NObsNoSinglesMetric`([snr_limit]) Count the number of observations for an SSobject, without singles. `NRevisitsMetric`([mjd_col, d_t, normed, ...]) Calculate the number of consecutive visits with time differences less than d_t. `NStateChangesFasterThanMetric`([change_col, ...]) Compute the number of changes of state that happen faster than 'cutoff'. `NVisitsPerNightMetric`([night_col, bins, units]) Histogram the number of visits in each night. `NgalScaleMetric`([seeing_col, m5_col, ...]) Approximate number of galaxies, scaled by median seeing. `NightPointingMetric`([alt_col, az_col, ...]) Gather relevant information for a night to plot. `NightTimespanMetric`([percentile, night_col, ...]) Calculate the maximum time span covered in each night, report the `percentile` value of all timespans. `NightgapsMetric`([night_col, all_gaps, bins, ...]) Histogram the number of nights between observations. `NlcPointsMetric`([ndpmin, mags, m5_col, ...]) Number of points in stellar light curves `NormalizeMetric`([col, norm_val]) Return a metric values divided by 'norm_val'. `NoutliersNsigmaMetric`([col, n_sigma, ...]) Calculate the # of visits less than n_sigma below the mean (n_sigma<0) or more than n_sigma above the mean of 'col'. `NstarsMetric`([crowding_error, filtername, ...]) Return the number of stars visible above some uncertainty limit, taking image depth and crowding into account. `ObsArcMetric`([snr_limit]) Calculate the difference between the first and last observation of an SSobject. `OpenShutterFractionMetric`([metric_name, ...]) Compute the fraction of time the shutter is open compared to the total time spent observing. `OptimalM5Metric`([m5_col, opt_m5_col, ...]) Compare the co-added depth of the survey to one where all the observations were taken on the meridian. `PairFractionMetric`([mjd_col, metric_name, ...]) What fraction of observations are part of a pair. `PairMetric`([mjd_col, metric_name, ...]) Count the number of pairs that could be used for Solar System object detection `ParallaxCoverageMetric`([metric_name, ...]) Check how well the parallax factor is distributed. `ParallaxDcrDegenMetric`([metric_name, ...]) Use the full parallax and DCR displacement vectors to find if they are degenerate. `ParallaxMetric`([metric_name, m5_col, ...]) Calculate the uncertainty in a parallax measurement given a series of observations. `PassMetric`([cols]) Just pass the entire array through `PeakVMagMetric`(**kwargs) Pull out the peak V magnitude of all observations of the SSobject. `PercentileMetric`([col, percentile, metric_name]) Find the value of a column at a given percentile. `PeriodicDetectMetric`([mjd_col, periods, ...]) Determine if we would be able to classify an object as periodic/non-uniform, using an F-test The idea here is that if a periodic source is aliased, it will be indistinguishable from a constant source, so we can find a best-fit constant, and if the reduced chi-squared is ~1, we know we are aliased. `PeriodicQualityMetric`([mjd_col, period, ...]) `PhaseGapMetric`([col, n_periods, period_min, ...]) Measure the maximum gap in phase coverage for observations of periodic variables. `ProperMotionMetric`([metric_name, m5_col, ...]) Calculate the uncertainty in the returned proper motion. `QSONumberCountsMetric`(lsst_filter[, m5_col, ...]) Calculate the number of quasars expected with SNR>=5 according to the Shen et al. (2020) QLF - model A in the redshift range zmin < z < zmax. A metric computing the total exposure time of an riz coadd. `RadiusObsMetric`([metric_name, ra_col, ...]) find the radius in the focal plane. `RapidRevisitMetric`([mjd_col, metric_name, ...]) `RapidRevisitUniformityMetric`([mjd_col, ...]) Calculate uniformity of time between consecutive visits on short timescales (for RAV1). `RealMeanMetric`([col, metric_name, maps, ...]) Calculate the mean of a simData column slice with no nans or infs. `RelRmsMetric`([col, metric_name, maps, ...]) Calculate the relative scatter metric (RMS divided by median). `RmsAngleMetric`([col, metric_name, maps, ...]) Calculate the standard deviation of an angular (degrees) simData column slice. `RmsMetric`([col, metric_name, maps, units, ...]) Calculate the standard deviation of a simData column slice. `RobustRmsMetric`([col, metric_name, maps, ...]) Use the inter-quartile range of the data to estimate the RMS. `SFUncertMetric`([mag, times_col, m5_col, ...]) Structure Function (SF) Uncertainty Metric. `SNCadenceMetric`([metric_name, mjd_col, ...]) Metric to estimate the redshift limit for faint supernovae (x1,color) = (-2.0,0.2) `SNNSNMetric`([metric_name, mjd_col, ...]) Measure zlim of type Ia supernovae. `SNSLMetric`([metric_name, mjd_col, ...]) Calculate the number of expected well-measured strongly lensed SN (per data_slice). `SNSNRMetric`([metric_name, mjd_col, ra_col, ...]) Metric to estimate the detection rate for faint supernovae (x1,color) = (-2.0,0.2) `SeasonLengthMetric`([mjd_col, exp_time_col, ...]) Calculate the length of LSST seasons, in days. `SkySaturationMetric`([metric_name, units]) Check if the sky would saturate a visit in an exposure `SlewContributionMetric`([col, activity, ...]) `SnrWeightedMetric`(col[, m5_col, metric_name]) Take the SNR weighted average of a column. `StarDensityMetric`([mag_limit, filtername, ...]) Interpolate the stellar luminosity function to return the number of stars per square arcsecond brighter than the mag_limit. `StaticProbesFoMEmulatorMetricSimple`([nside, ...]) This calculates the Figure of Merit for the combined static probes (3x2pt, i.e., Weak Lensing, LSS, Clustering). `StringCountMetric`([metric_name, col, percent]) Count up the number of times each string appears in a column. `SumMetric`([col, metric_name, maps, units, ...]) Calculate the sum of a simData column slice. `SurfaceBrightLimitMetric`([pixscale, nsigma, ...]) Gaussian limit, ignoring systematic errors in photometry `TdcMetric`([mjd_col, night_col, filter_col, ...]) Calculate the Time Delay Challenge metric, as described in Liao et al 2015 (https://arxiv.org/pdf/1409.1254.pdf). `TeffMetric`([m5_col, filter_col, ...]) Effective time equivalent for a given set of visits. `TemplateExistsMetric`([seeing_col, ...]) Calculate the fraction of images with a previous template image of desired quality. `TgapsMetric`([times_col, all_gaps, bins, units]) Histogram the times of the gaps between observations. `TgapsPercentMetric`([times_col, all_gaps, ...]) Compute the fraction of the time gaps between observations that occur in a given time range. `TotalNumberSSO`([h_mark, dndh_func]) Calculate the total number of objects of a given population expected at a given H value or larger. `TotalPowerMetric`([col, lmin, lmax, ...]) Calculate the total power in the angular power spectrum between lmin/lmax. `TransientMetric`([metric_name, mjd_col, ...]) Calculate what fraction of the transients would be detected. `UniformityMetric`([mjd_col, units, survey_length]) Calculate how uniformly the observations are spaced in time. `UniqueRatioMetric`([col, metric_name, maps, ...]) Return the number of unique values divided by the total number of values. `UseMetric`([note_col]) Metric to classify visits by type of visits `ValueAtHMetric`([h_mark]) Return the metric value at a given H value. `VisitGapMetric`([mjd_col, night_col, ...]) Calculate the (reduce_func) of the gap between any consecutive observations, in hours, regardless of night boundaries. `VisitGroupsMetric`([time_col, nights_col, ...]) Count the number of visits per night within delta_t_min and delta_t_max. `VolumeSumMetric`([col, metric_name, nside]) Compute the total volume assuming a metric has values of distance `WeakLensingNvisits`([m5_col, exp_time_col, ...]) A proxy metric for WL systematics. `YearCoverageMetric`([night_col, bins, units]) Count the number of bins covered by night_col -- default bins are 'years'. `ZeropointMetric`([col, zp]) Return a metric values with the addition of 'zp'.

#### rubin_sim.maf.maf_contrib Package¶

##### Functions¶
 `alm_plots`(path, out_dir, bundle[, nside, ...]) Plot the skymaps/cartview plots corresponding to alms with specified l-ranges. `artificial_structure_calculation`(path, ...) Calculate artificial structure, i.e. fluctuations in galaxy counts dN/N, resulting due to imperfect observing strategy (OS). `calc_os_bias_err`(c_ells) Calculate the OS bias (as an average across the specified bands) and the uncertainty in the bias (as the std across the cls from thes specified bands). `coadd_m5_analysis`(path, dbfile, run_name[, ...]) Analyze the artifacts induced in the coadded 5sigma depth due to imperfect observing strategy. `coefficients_fsfb`(t, t0, te, u0, fs, fb) Coefficients for calculating the first derivatives wrt fs,fb in the Fisher (information) matrix in an effective way, optimized with sympy and cse this function needs to be evaluated for each passband respectively. `coefficients_pspl`(t, t0, te, u0, fs, fb) Coefficients for calculating the first derivatives wrt t0,te,u0 in the Fisher matrix in an effective way, optimized with sympy and cse via Markus Hundertmark markus.hundertmark@uni-heidelberg.de `fisher_matrix`(t, t0, te, u0, fs, fb, snr[, ...]) The Fisher (information) matrix relying on first derivatives wrt t0,te,u0,fs,fb relying on with cse optimized coefficents. `galaxy_counts_with_pixel_calibration`(...[, ...]) Estimate galaxy counts for a given HEALpix pixel directly (without a slicer). `generate_kn_pop_slicer`([t_start, t_end, ...]) Generate a population of KNe events, and put the info about them into a UserPointSlicer object Read the Karachentsev+ catalog of nearby galaxies, and put the info about them into a UserPointSlicer object. Generate a UserPointSlicer with a population of microlensing events. `generate_presto_pop_slicer`([skyregion, ...]) Generate a population of KNe events, and put the info about them into a UserPointSlicer object Parameters ---------- skyregion : string The skyregion of interst. Only two options: 'galactic' and 'extragalaxtic' t_start : float (1) The night to start kilonova events on (days) t_end : float (3652) The final night of kilonova events n_events : int (10000) The number of kilonova events to generate seed : float The seed passed to np.random n_files : int (7) The number of different kilonova lightcurves to use d_min : float or int (10) Minimum luminosity distance (Mpc) d_max : float or int (300) Maximum luminosity distance (Mpc). `generate_tde_pop_slicer`([t_start, t_end, ...]) Generate a population of TDE events, and put the info about them into a UserPointSlicer object `generate_xrb_pop_slicer`([t_start, t_end, ...]) Generate a population of XRB events, and put the info about them into a UserPointSlicer object `get_fom`(ell_min, ell_max, ell_for_bias_err, ...) Calculate the FoM based on the bias uncertaity and statistical floor. `get_fsky`(outdir[, band, print_fsky]) Calculate the fraction of the sky observed in a survey. `get_kne_filename`([inj_params_list]) Given kilonova parameters, get the filename from the grid of models developed by M. `get_outdir_name`(band, nside, pixel_radius, ...) Return the output directory name where the cls for deltaN/N would be, given the input parameters. `get_theory_spectra`(mock_data_path[, ...]) Return the data for the five redshift bins, read from the files containing the with BAO galaxy power spectra from Hu Zhan. `info_peak_before_t0`([impact_parameter, ...]) Time of Maximum Information before peak `make__fake_old_galaxy_lf`(int_b, mu, filtername) Make a simulated luminosity function for an old (10 Gyr) dwarf galaxy of given Create dicts containing g- and i-band LFs for simulated dwarfs between `masking_algorithm_generalized`(my_bundles, ...) Assign new_value to all pixels in a skymap within pixel_radius of pixels with value <, >, or = find_value. `microlensing_amplification`(t[, ...]) The microlensing amplification The microlensing amplification in terms of source flux and blend flux `os_bias_overplots`(out_dir, data_paths, ...) Calculate/plot the OS bias uncertainty and the statistical floor for the specified redshift bin. `os_bias_overplots_diff_dbs`(out_dir, ...[, ...]) Calculate/plot the OS bias uncertainty and the statistical floor for the specified redshift bin. `return_cls`(path, outdir, band[, specified_dith]) Get the cls from .npy files in path+outdir folder for a specified filter band. `save_bundle_data_npz_format`(path, bundle, ...) Save data in the metricBundle.
##### Classes¶
 `DepthLimitedNumGalMetric`([m5_col, ...]) This metric calculates the number of galaxies while accounting for the extragalactic footprint. Offset along a Fermat's spiral with num_points, out to a maximum radius of max_dither. Offset along a Fermat's spiral with num_points, out to a maximum radius of max_dither. `FermatSpiralDitherPerNightStacker`([ra_col, ...]) Offset along a Fermat's spiral with num_points, out to a maximum radius of max_dither. `FilterPairTGapsMetric`([mjd_col, filter_col, ...]) figure of merit to measure the coverage the time gaps in same and different filter pairs; FoM is defined as sum of Nv / standard deviation after a clip; Parameters: colname: list, ['observationStartMJD', 'filter', 'fiveSigmaDepth'] fltpairs: filter pair, default ['uu', 'ug', 'ur', 'ui', 'uz','uy', 'gg', 'gr', 'gi', 'gz', 'gy', 'rr', 'ri', 'rz', 'ry', 'ii', 'iz', 'iy', 'zz', 'zy', 'yy'] mag_lim: list, fiveSigmaDepth threshold each filter, default {'u':18, 'g':18, 'r':18, 'i':18, 'z':18, 'y':18} bins_same: np.array, bins to get histogram for same-filter pair ; bins_diff: np.array, bins to get histogram for diff-filter pair ; nv_clip: number of visits of pairs to clip, std is calculated below nv_clip allgaps: boolean, all possible pairs if True, else consider only nearest `GRBTransientMetric`([alpha, ...]) Detections for on-axis GRB afterglows decaying as `GW170817DetMetric`([ascii_file, metric_name, ...]) Wrapper metric class for GW170817-like kilonovae based on the TransientAsciiSEDMetric. `GalaxyCountsMetric` `GalaxyCountsMetricExtended`([m5_col, ...]) Estimate galaxy counts per HEALpix pixel. `KNePopMetric`([metric_name, mjd_col, m5_col, ...]) `KnLc`([file_list]) Read in some KNe lightcurves `LVDwarfsMetric`([radius, distlim, cmd_frac, ...]) Estimate the detection limit in total dwarf luminosity for resolved dwarf galaxies at a given distance. `MicrolensingMetric`([metric_name, ...]) Quantifies detectability of Microlensing events. `NYoungStarsMetric`([metric_name, m5_col, ...]) Calculate the distance or number of stars with color uncertainty defined by mags/snrs. `NumObsMetric`([night_col, nside, metric_name]) Calculate the number of observations per data slice. `OrderedDict` Dictionary that remembers insertion order Offset along a diamond circumscribed by a pentagon. Offset along a diamond circumscribed by a pentagon. `PentagonDitherPerSeasonStacker`([ra_col, ...]) Offset along two pentagons, one inverted and inside the other. `PeriodDeviationMetric`([col, period_min, ...]) Measure the percentage deviation of recovered periods for pure sine wave variability (in magnitude). `PeriodicMetric`([time_col]) From a set of observation times, uses code provided by Robert Siverd (LCOGT) to calculate the spectral window function. `PeriodicStar`(filternames) `PeriodicStarMetric`([metric_name, mjd_col, ...]) At each slice_point, run a Monte Carlo simulation to see how well a periodic source can be fit. `PeriodicStarModulationMetric`([metric_name, ...]) Evaluate how well a periodic source can be fit on a short baseline, using a Monte Carlo simulation. `PrestoColorKNePopMetric`([metric_name, ...]) Repulsive-randomly dither the RA and Dec pointings up to max_dither degrees from center, one dither offset per new night of observation of a field. Repulsive-randomly dither the RA and Dec pointings up to max_dither degrees from center, different offset per visit for each field. Repulsive-randomly dither the RA and Dec pointings up to max_dither degrees from center, one dither offset per night for all the fields. `SEDSNMetric`([m5_col, seeing_col, sky_b_col, ...]) Computes the S/Ns for a given SED. `SNMetric`([m5_col, seeing_col, sky_b_col, ...]) Calculate the signal to noise metric in a given filter for an object of a given magnitude. `SpiralDitherPerSeasonStacker`([ra_col, ...]) Offsets along a 10pt spiral. `StarCountMassMetric`(**kwargs) Find the number of stars in a given field in the mass range fainter than magnitude 16 and bright enough to have noise less than 0.03 in a given band. `StarCountMetric`(**kwargs) Find the number of stars in a given field between d1 and d2 in parsecs. `StaticProbesFoMEmulatorMetric`([nside, ...]) This calculates the Figure of Merit for the combined static probes (3x2pt, i.e., Weak Lensing, LSS, Clustering). `TdeLc`([file_list]) Read in some TDE lightcurves `TdePopMetric`([metric_name, mjd_col, m5_col, ...]) `TdePopMetricQuality`([metric_name, mjd_col, ...]) `ThreshSEDSNMetric`([m5_col, seeing_col, ...]) Computes the metric whether the S/N is bigger than the threshold in all the bands for a given SED `TripletBandMetric`([time_col, filter_col]) Find the number of 'triplets' of three images taken in the same band, based on user-selected minimum and maximum intervals (in hours), as well as constraining the ratio of the two exposures intervals. `TripletMetric`([time_col]) Find the number of 'triplets' of three images taken in any band, based on user-selected minimum and maximum intervals (in hours), as well as constraining the ratio of the two exposures intervals. `VarDepth`([m5_col, metric_name, ...]) Calculate the survey depth that a variable star can be reliably identified. `XRBPopMetric`([metric_name, mjd_col, m5_col, ...]) `XrbLc`([seed]) Synthesize XRB outburst lightcurves.

#### rubin_sim.maf.slicers Package¶

##### Classes¶
 `BaseSlicer`([verbose, badval]) Base class for all slicers: sets required methods and implements common functionality. `BaseSpatialSlicer`([lon_col, lat_col, ...]) Base spatial slicer object, contains additional functionality for spatial slicing, including setting up and traversing a kdtree containing the simulated data points. `BlockIntervalSlicer`([mjd_column_name, ...]) Slices into intervals with common "note" values and no long gaps. `HealpixComCamSlicer`([nside, lon_col, ...]) Slicer that uses the ComCam footprint to decide if observations overlap a healpixel center `HealpixSDSSSlicer`([nside, lon_col, lat_col, ...]) For use with SDSS stripe 82 square images `HealpixSlicer`([nside, lon_col, lat_col, ...]) A spatial slicer that evaluates pointings on a healpix-based grid. `HealpixSubsetSlicer`(nside, hpid[, lon_col, ...]) A spatial slicer that evaluates pointings on a subset of a healpix-based grid. `HourglassSlicer`([verbose, badval]) Slicer to make the filter hourglass plots `MoObjSlicer`([h_range, verbose, badval]) Slice moving object _observations_, per object and optionally clone/per H value. `MovieSlicer`([slice_col_name, ...]) `NDSlicer`([slice_col_list, bins_list, verbose]) Nd slicer (N dimensions) `OneDSlicer`([slice_col_name, ...]) OneD Slicer allows the 'slicing' of data into bins in a single dimension. `SlicerNotSetup` Thrown when a slicer is not setup for the method called. `SlicerRegistry`(name, bases, dict) Meta class for slicers, to build a registry of slicer classes. `TimeIntervalSlicer`([interval_seconds, ...]) Base for all time interval slicers. `UniSlicer`([verbose, badval]) UniSlicer. `UserPointsSlicer`(ra, dec[, lon_col, ...]) A spatial slicer that evaluates pointings overlapping user-provided list of points. `VisitIntervalSlicer`([mjd_column_name, ...]) Slices into intervals each of which contain one visit

#### rubin_sim.maf.db Package¶

##### Functions¶
 `add_run_to_database`(maf_dir, tracking_db_file) Adds information about a MAF analysis run to a MAF tracking database.
##### Classes¶
 `DisplayRow`(**kwargs) Define contents and format of the displays table. `MetricRow`(**kwargs) Define contents and format of metric list table. `PlotRow`(**kwargs) Define contents and format of plot list table. `ResultsDb`([out_dir, database, verbose]) The ResultsDb is a sqlite database containing information on the metrics run via MAF, the plots created, the display information (such as captions), and any summary statistics output. `SummaryStatRow`(**kwargs) Define contents and format of the summary statistics table. `TrackingDb`([database, trackingDbverbose]) Sqlite database to track MAF output runs and their locations, for show_maf `VersionRow`(**kwargs)

#### rubin_sim.maf.maps Package¶

##### Functions¶
 `ebv_3d_hp`(nside[, map_file, ra, dec, ...]) Reads and saves a 3d dust extinction file, return extinction at specified points (ra/dec/ or pixels). `galplane_priority_map`([nside, get_keys, ra, ...]) Reads and saves the galactic plane priority maps. `get_x_at_nearest_y`(x, y, x_goal) Given a goal x value, find y values at the closest x value. A convenience function to make keeping the map key formats in sync in various places
##### Classes¶
 `BaseMap`(**kwargs) `DustMap`([interp, nside, map_path]) Compute the E(B-V) for each point in a given spatial distribution of slicePoints. `DustMap3D`([nside, map_file, interp, ...]) The DustMap3D provides a `map` to hold 3d EBV data. `GalacticPlanePriorityMap`([interp, nside, ...]) Read and return the galactic plane priority map data at each slice_point. `MapsRegistry`(name, bases, dict) Meta class for Maps, to build a registry of maps classes. `StellarDensityMap`([startype, filtername, ...]) Return the cumulative stellar luminosity function for each slice_point. `TrilegalDensityMap`([filtername, nside, ext]) Return the cumulative stellar luminosity function for each slice_point.

#### rubin_sim.maf.stackers Package¶

##### Functions¶
 `find_telescopes`([min_size]) Finds telescopes larger than min_size, from list of large telescopes based on http://astro.nineplanets.org/bigeyes.html. Fit a line to how the sky brightness changes with airmass. `in_hexagon`(x_off, y_off, max_dither) Identify dither offsets which fall within the inscribed hexagon. `polygon_coords`(nside, radius, rotation_angle) Find the x,y coords of a polygon. `ra_dec2_alt_az`(ra, dec, lat, lon, mjd[, altonly]) Convert RA/Dec (and telescope site lat/lon) to alt/az. `setup_dither_stackers`(ra_col, dec_col, ...) Wrap only RA values into 0-2pi (using mod). `wrap_ra_dec`(ra, dec) Wrap RA into 0-2pi and Dec into +/0 pi/2.
##### Classes¶
 `AppMagStacker`([v_mag_col, color_col, loss_col]) Add apparent magnitude of an object for the current h_val (compared to Href in the orbit file), incorporating the magnitude losses due to trailing/detection, as well as the color of the object. `BaseDitherStacker`([ra_col, dec_col, ...]) Base class for dither stackers. Base class for moving object (SSobject) stackers. Base MAF Stacker: add columns generated at run-time to the simdata array. `CoaddStacker`([mjd_col, ra_col, dec_col, ...]) Stacker to estimate m5 "coadded" per band and par night Class to hold the unit and source locations for columns. `CometAppMagStacker`([comet_type, ap, rh_col, ...]) Add a cometary apparent magnitude, including nucleus and coma, based on a calculation of Afrho (using the current h_val) and a Halley-Marcus phase curve for the coma brightness. `DcrStacker`([filter_col, alt_col, degrees, ...]) Calculate the RA,Dec offset expected for an object due to differential chromatic refraction. `EclStacker`([ra_col, dec_col, in_deg]) Add ecliptic latitude/longitude (ecLat/ecLon) to the slicer ssoObs (in degrees). `EclipticStacker`([mjd_col, ra_col, dec_col, ...]) Add the ecliptic coordinates of each RA/Dec pointing: eclipLat, eclipLon Optionally subtract off the sun's ecliptic longitude and wrap. `FiveSigmaStacker`([airmass_col, seeing_col, ...]) Calculate the 5-sigma limiting depth for a point source in the given conditions. `GalacticStacker`([ra_col, dec_col, degrees]) Add the galactic coordinates of each RA/Dec pointing: gall, galb `HexDitherFieldPerNightStacker`([ra_col, ...]) Use offsets from the hexagonal grid of 'hexdither', but visit each vertex sequentially. `HexDitherFieldPerVisitStacker`([ra_col, ...]) Use offsets from the hexagonal grid of 'hexdither', but visit each vertex sequentially. `HexDitherPerNightStacker`([ra_col, dec_col, ...]) Use offsets from the hexagonal grid of 'hexdither', but visit each vertex sequentially. `HourAngleStacker`([lst_col, ra_col, degrees]) Add the Hour Angle for each observation. `M5OptimalStacker`([airmass_col, dec_col, ...]) Make a new m5 column as if observations were taken on the meridian. `MoMagStacker`([magtype, v_mag_col, ...]) Add columns relevant to SSobject apparent magnitudes and visibility to the slicer ssoObs dataframe, given a particular Href and current h_val. `NEODistStacker`([stepsize, max_dist, ...]) For each observation, find the max distance to a ~144 km NEO, also stack on the x,y position of the object. `NFollowStacker`([min_size, airmass_limit, ...]) Add the number of telescopes ('nObservatories') that could follow up any visit at (any of the) times in timeStep, specifying the minimum telescope size (in meters) and airmass limit. `NormAirmassStacker`([airmass_col, dec_col, ...]) Calculate the normalized airmass for each opsim pointing. `ParallacticAngleStacker`([ra_col, dec_col, ...]) Add the parallactic angle to each visit. `ParallaxFactorStacker`([ra_col, dec_col, ...]) Calculate the parallax factors for each opsim pointing. `RandomDitherFieldPerNightStacker`([ra_col, ...]) Randomly dither the RA and Dec pointings up to max_dither degrees from center, one dither offset per new night of observation of a field. `RandomDitherFieldPerVisitStacker`([ra_col, ...]) Randomly dither the RA and Dec pointings up to max_dither degrees from center, with a different offset for each field, for each visit. `RandomDitherPerNightStacker`([ra_col, ...]) Randomly dither the RA and Dec pointings up to max_dither degrees from center, one dither offset per night. Randomly dither the physical angle of the telescope rotator wrt the mount, after every filter change. `SNRStacker`([app_mag_col, m5_col, gamma, ...]) Add SNR and visibility for a particular object, given the five sigma depth of the image and the apparent magnitude (whether from AppMagStacker or CometAppMagStacker, etc). `SaturationStacker`([seeing_col, ...]) Calculate the saturation limit of a point source. `SdssRADecStacker`([pcols]) convert the p1,p2,p3. `SpiralDitherFieldPerNightStacker`([ra_col, ...]) Offset along an equidistant spiral with num_points, out to a maximum radius of max_dither. `SpiralDitherFieldPerVisitStacker`([ra_col, ...]) Offset along an equidistant spiral with num_points, out to a maximum radius of max_dither. `SpiralDitherPerNightStacker`([ra_col, ...]) Offset along an equidistant spiral with num_points, out to a maximum radius of max_dither. `StackerRegistry`(name, bases, dict) Meta class for Stackers, to build a registry of stacker classes. `WFDlabelStacker`([footprint, fp_threshold, ...]) Add an 'areaId' column to flag whether a visit was inside the 'footprint'. `ZenithDistStacker`([alt_col, degrees]) Calculate the zenith distance for each pointing.

#### rubin_sim.maf.plots Package¶

##### Functions¶
 `apply_zp_norm`(metric_value, plot_dict) `set_color_lims`(metric_value, plot_dict[, ...]) Set up x or color bar limits. `set_color_map`(plot_dict)
##### Classes¶
 Serve as the base type for MAF plotters and example of API. `CategoricalHourglassPlotMixin`(*args, **kwargs) A mix-in to allow the HourglassPlot to accept categorical data, rather than float/int. Special plotter to generate and label fO plots. `GeneralHourglassPlot`([tz, site, solar_time, ...]) Make an hourglass plot Generate a sky map of healpix metric values using healpy's mollweide view. Use basemap and contour to make a Lambertian projection. Plot metric values versus H. `MetricVsOrbit`([xaxis, yaxis]) Plot metric values (at a particular H value) vs. `MetricVsOrbitPoints`([xaxis, yaxis]) Plot metric values (at a particular H value) as function of orbital parameters, using points for each metric value. `MonthHourglassCategoricalPlot`(*args, **kwargs) Plot categorical data for a Month. `MonthHourglassPlot`(month, year, **kwargs) Make an hourglass plot for a month `MonthHourglassUsePlot`(*args, **kwargs) Plot categorical 'use' data for one month. `NeoDistancePlotter`([step, eclip_max, eclip_min]) Special plotter to calculate and plot the maximum distance an H=22 NEO could be observable to, in any particular particular opsim observation. `NightPointingPlotter`([mjd_col, alt_col, az_col]) Plot a single axes from the sliceColList, identified by plot_dict['axis'], given the metric_values at all slicepoints [sums over non-visible axes]. `PlotBundle`([bundle_list, plot_dicts, plot_func]) Object designed to help organize multiple MetricBundles that will be plotted together using the PlotHandler. `PlotHandler`([out_dir, results_db, savefig, ...]) `RangeHourglassCategoricalPlot`(*args, **kwargs) Plot categorical data for a range of dates. Special plotter to summarize metrics which return a set of values at each slice_point, such as if a histogram was calculated at each slice_point (e.g. `TimeUseHourglassPlotMixin`(*args, **kwargs) A mix-in to allow the HourglassPlot to accept categorical 'use' data rather than float/int. Plot 2 axes from the slicer.sliceColList, identified by plot_dict['xaxis']/['yaxis'], given the metric_values at all slicepoints [sums over non-visible axes]. Given an opsim2dSlicer, figure out what fraction of observations are in singles, pairs, triples, etc. Bare-bones plotter for making scatter plots. `YearHourglassCategoricalPlot`(*args, **kwargs) Plot categorical data for a year. `YearHourglassPlot`(year, **kwargs) Make an array of monthly hourglass plots for a year. `YearHourglassUsePlot`(*args, **kwargs) Plot categorical 'use' data for one year.

#### rubin_sim.maf.metric_bundles Package¶

##### Functions¶
 Create an empty metric bundle. Create an empty metric bundle. `make_bundles_dict_from_list`(bundle_list) Utility to convert a list of MetricBundles into a dictionary, keyed by the fileRoot names. `make_completeness_bundle`(bundle, ...[, ...]) Make a mock metric bundle from a bundle which had MoCompleteness or MoCumulativeCompleteness summary metrics run.
##### Classes¶
 `MetricBundle`(metric, slicer[, constraint, ...]) The MetricBundle is defined by a combination of a (single) metric, slicer and constraint - together these define a unique combination of an opsim benchmark. `MetricBundleGroup`(bundle_dict, db_con[, ...]) The MetricBundleGroup exists to calculate the metric values for a group of MetricBundles. `MoMetricBundle`(metric, slicer[, constraint, ...]) `MoMetricBundleGroup`(bundle_dict[, out_dir, ...])

#### rubin_sim.maf.run_comparison Package¶

##### Functions¶
 `bundle_dict_from_disk`(result_db, run_name, ...) Load metric data from disk and import them into metricBundles. `combine_result_dbs`(run_dirs[, dbfilename]) Helper function for gather_summaries `confusion_matrix_plot`(comparison_matrix, ...) Plots a confusion matrix type plot comparing two metric types. `create_metric_set_df`(metric_set, metrics[, ...]) Create a DataFrame that defines a metric set. `describe_families`(families[, summary, ...]) Display (in a jupyter on IPython notebook) family descirptions `detected_fisher_comparison`(fisher_results, ...) Returns an array of the following form where A = fisher criteria and B = detection criteria: [[(Yes A and Yes B), (Yes A and No B)], [(No A and Yes B), (No A and No B)]] where Yes A and Yes B are the number of events that pass both the A and B criteria. `detected_npts_comparison`(detect_results, ...) Returns an array of the following form where A = detect criteria and B = npts criteria: [[(Yes A and Yes B), (Yes A and No B)], [(No A and Yes B), (No A and No B)]] where Yes A and Yes B are the number of events that pass both the A and B criteria. `download_runs`(runs[, dest_dir, runs_source, ...]) Download opsim visit databases for specified runs to a local directory. `find_family_lines`(families, family_list) `fisher_npts_comparison`(fisher_results, ...) Returns an array of the following form where A = fisher criteria and B = npts criteria: [[(Yes A and Yes B), (Yes A and No B)], [(No A and Yes B), (No A and No B)]] where Yes A and Yes B are the number of events that pass both the A and B criteria. Find resultsDbs in a series of directories and gather up their summary stats into a single CSV or hdf5 file. `get_family_descriptions`([family_source]) Get description of families or funs. `get_family_runs`([run_source]) Load a data frame that supplies run names for each run family `get_metric_sets`([metric_set_source]) Get metadata on named sets of related metrics. `get_metric_summaries`([run_families, ...]) Get summary metric values for a set of runs and metrics. `get_results`(df, run_type[, ...]) Plots the results from the discovery/detect metric, Npts metric, and Fisher metric in three sub plots `get_results_dbs`(result_db_path) Create a dictionary of result_db from result_db files via PCW Hackathan 2020 Resources `get_runs`([run_source]) Load metadata on opsim runs into a `pandas.DataFrame`. `microlensing_fom`(save_folder, ...[, ...]) Processes a folder, puts together results for discovery/detect metric, Npts metric, and Fisher metric, and plots them in the four tE bins of 1 - 10 days, 10 - 30 days, 30 - 100 days, and 100 - 1000 days. `normalize_for_radar`(summary[, norm_run, ...]) Normalize values in a dataframe to a given run, return output in a dataframe. `normalize_metric_summaries`(baseline_run, summary) Create a normalized `pandas.DataFrame` of metric summary values. Parses names of MicrolensingMetric file names `plot_compare`(results, run_names, run_types, ...) Plots confusion matrix type plots comparing fraction detected, characterized (via Fisher), and fraction of events with at least npts_required points within 2 tE `plot_fom`(results, run_names, run_types, ...) Plots the results from the discovery/detect metric, Npts metric, and Fisher metric in three sub plots `plot_run_metric`(summary[, baseline_run, ...]) Plot normalized metric values as colored points on a cartesian plane. `plot_run_metric_mesh`(summary[, metric_set, ...]) Plot normalized metric values as colored points on a cartesian plane. `radar`(df[, rgrids, colors, alpha, legend, ...]) make a radar plot! `write_metric_sets`(metric_set_file, metric_sets) Write an updated metric_set dataframe to disk

#### rubin_sim.maf.utils Package¶

##### Functions¶
 `astrom_precision`(fwhm, snr) Calculate the approximate precision of astrometric measurements, given a particular seeing and SNR value. `calc_coadded_depth`(nvisits, single_visit_depth) Calculate the coadded depth expected for a given number of visits and single visit depth. `collapse_night`(data_slice[, night_col, ...]) Collapse a data_slice into per-filter, per-night values for the 'night', 'filter', 'median observationStartMJD', and 'fiveSigmaDepth'. Get today's date and a dictionary with the MAF version information. `get_sim_data`(db_con, sqlconstraint, dbcols) Query an opsim database for the needed data columns and run any required stackers. Load up and return instumental zeropoints and atmospheric extinctions `m52snr`(m, m5) Calculate the SNR for a star of magnitude m in an observation with 5-sigma limiting magnitude depth m5. `name_sanitize`(in_string) Convert a string to a more file name (and web) friendly format. `optimal_bins`(datain[, binmin, binmax, ...]) Set an 'optimal' number of bins using the Freedman-Diaconis rule. `percentile_clipping`(data[, percentile]) Calculate the minimum and maximum values of a distribution of points, after discarding data more than 'percentile' from the median. `print_dict`(content, label[, filehandle, ...]) Print dictionaries (and/or nested dictionaries) nicely. `print_simple_dict`(topdict, subkeyorder[, ...]) Print a simple one-level nested dictionary nicely across the screen, with one line per top-level key and all sub-level keys aligned. `radec2pix`(nside, ra, dec) Calculate the nearest healpixel ID of an RA/Dec array, assuming nside. `scale_benchmarks`(run_length[, benchmark]) Set the design and stretch values of the number of visits, area of the footprint, seeing values, FWHMeff values, skybrightness, and single visit depth (based on SRD values). `sigma_slope`(x, sigma_y) Calculate the uncertainty in fitting a line, as given by the spread in x values and the uncertainties in the y values.

#### rubin_sim.maf.web Package¶

##### Classes¶
 `MafRunResults`(out_dir[, run_name, results_db]) Class to read MAF's resultsDb_sqlite.db and organize the output for display on web pages. `MafTracking`([database]) Class to read MAF's tracking SQLite database (tracking a set of MAF runs) and handle the output for web display.