rubin-sim 2.6.1.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- batch/compile_prenight_metadata_cache.sh +34 -0
- batch/run_auxtel_prenight_sims.sh +163 -0
- batch/run_prenight_sims.sh +239 -0
- docs/.gitignore +3 -0
- docs/Makefile +32 -0
- docs/api.rst +25 -0
- docs/conf.py +8 -0
- docs/data-api.rst +12 -0
- docs/data-download.rst +70 -0
- docs/developer.rst +14 -0
- docs/documenteer.toml +11 -0
- docs/index.rst +22 -0
- docs/installation.rst +76 -0
- docs/introduction.rst +37 -0
- docs/maf-api-batches.rst +12 -0
- docs/maf-api-db.rst +12 -0
- docs/maf-api-maf-contrib.rst +12 -0
- docs/maf-api-maps.rst +12 -0
- docs/maf-api-metricbundles.rst +12 -0
- docs/maf-api-metrics.rst +12 -0
- docs/maf-api-plots.rst +12 -0
- docs/maf-api-run-comparison.rst +12 -0
- docs/maf-api-slicers.rst +12 -0
- docs/maf-api-stackers.rst +12 -0
- docs/maf-api-utils.rst +12 -0
- docs/maf-api.rst +22 -0
- docs/maf.rst +60 -0
- docs/metric_list.py +49 -0
- docs/moving-objects-api.rst +12 -0
- docs/moving-objects.rst +22 -0
- docs/phot-utils-api.rst +12 -0
- docs/phot-utils.rst +11 -0
- docs/prenight.rst +117 -0
- docs/protoarchive.rst +276 -0
- docs/satellite-constellations-api.rst +12 -0
- docs/satellite-constellations.rst +13 -0
- docs/selfcal-api.rst +12 -0
- docs/selfcal.rst +15 -0
- docs/sim-archive-api.rst +12 -0
- docs/skybrightness-api.rst +12 -0
- docs/skybrightness.rst +23 -0
- docs/user-guide.rst +28 -0
- docs/vseqarchive-architecture.rst +438 -0
- docs/vseqarchive-setup.rst +238 -0
- docs/vseqarchive.rst +225 -0
- rubin_sim/__init__.py +7 -0
- rubin_sim/data/__init__.py +1 -0
- rubin_sim/data/rs_download_data.py +155 -0
- rubin_sim/maf/__init__.py +34 -0
- rubin_sim/maf/batches/__init__.py +18 -0
- rubin_sim/maf/batches/altaz_batch.py +161 -0
- rubin_sim/maf/batches/col_map_dict.py +274 -0
- rubin_sim/maf/batches/common.py +388 -0
- rubin_sim/maf/batches/ddf_batch.py +728 -0
- rubin_sim/maf/batches/filterchange_batch.py +182 -0
- rubin_sim/maf/batches/glance_batch.py +591 -0
- rubin_sim/maf/batches/hourglass_batch.py +79 -0
- rubin_sim/maf/batches/info_batch.py +114 -0
- rubin_sim/maf/batches/metadata_batch.py +558 -0
- rubin_sim/maf/batches/moving_objects_batch.py +1587 -0
- rubin_sim/maf/batches/openshutter_batch.py +100 -0
- rubin_sim/maf/batches/radar_limited.py +1100 -0
- rubin_sim/maf/batches/science_radar_batch.py +1910 -0
- rubin_sim/maf/batches/skycoverage.py +155 -0
- rubin_sim/maf/batches/slew_batch.py +146 -0
- rubin_sim/maf/batches/srd_batch.py +637 -0
- rubin_sim/maf/batches/time_batch.py +757 -0
- rubin_sim/maf/batches/time_sci_batch.py +105 -0
- rubin_sim/maf/batches/visitdepth_batch.py +485 -0
- rubin_sim/maf/db/__init__.py +2 -0
- rubin_sim/maf/db/add_run.py +34 -0
- rubin_sim/maf/db/results_db.py +1074 -0
- rubin_sim/maf/db/tracking_db.py +332 -0
- rubin_sim/maf/ddf_dir.py +53 -0
- rubin_sim/maf/generate_ss.py +218 -0
- rubin_sim/maf/glance_dir.py +58 -0
- rubin_sim/maf/maf_contrib/__init__.py +25 -0
- rubin_sim/maf/maf_contrib/calculate_lsst_field_visibility_astropy.py +170 -0
- rubin_sim/maf/maf_contrib/depth_limited_num_gal_metric.py +109 -0
- rubin_sim/maf/maf_contrib/example_new_metrics.py +40 -0
- rubin_sim/maf/maf_contrib/filter_pair_t_gaps_metric.py +208 -0
- rubin_sim/maf/maf_contrib/grb_transient_metric.py +249 -0
- rubin_sim/maf/maf_contrib/gw170817_det_metric.py +72 -0
- rubin_sim/maf/maf_contrib/intervals_between_obs_metric.py +68 -0
- rubin_sim/maf/maf_contrib/kne_metrics.py +473 -0
- rubin_sim/maf/maf_contrib/lss_metrics.py +45 -0
- rubin_sim/maf/maf_contrib/lss_obs_strategy/__init__.py +3 -0
- rubin_sim/maf/maf_contrib/lss_obs_strategy/constants_for_pipeline.py +73 -0
- rubin_sim/maf/maf_contrib/lss_obs_strategy/galaxy_counts_metric_extended.py +205 -0
- rubin_sim/maf/maf_contrib/lss_obs_strategy/galaxy_counts_with_pixel_calibration.py +171 -0
- rubin_sim/maf/maf_contrib/lv_dwarfs/__init__.py +1 -0
- rubin_sim/maf/maf_contrib/lv_dwarfs/lv_dwarfs_metrics.py +388 -0
- rubin_sim/maf/maf_contrib/microlensing_metric.py +593 -0
- rubin_sim/maf/maf_contrib/num_obs_in_survey_time_overlap_metric.py +43 -0
- rubin_sim/maf/maf_contrib/periodic_metric.py +51 -0
- rubin_sim/maf/maf_contrib/periodic_star_metric.py +186 -0
- rubin_sim/maf/maf_contrib/periodic_star_modulation_metric.py +236 -0
- rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py +441 -0
- rubin_sim/maf/maf_contrib/selfcal_uniformity_metric.py +171 -0
- rubin_sim/maf/maf_contrib/star_count_mass_metric.py +64 -0
- rubin_sim/maf/maf_contrib/star_count_metric.py +56 -0
- rubin_sim/maf/maf_contrib/star_counts/__init__.py +8 -0
- rubin_sim/maf/maf_contrib/star_counts/abs_mag.py +324 -0
- rubin_sim/maf/maf_contrib/star_counts/coords.py +99 -0
- rubin_sim/maf/maf_contrib/star_counts/readme.txt +1 -0
- rubin_sim/maf/maf_contrib/star_counts/spec_type.py +91 -0
- rubin_sim/maf/maf_contrib/star_counts/starcount.py +30 -0
- rubin_sim/maf/maf_contrib/star_counts/starcount_bymass.py +93 -0
- rubin_sim/maf/maf_contrib/star_counts/stellardensity.py +59 -0
- rubin_sim/maf/maf_contrib/static_probes_fom_summary_metric.py +386 -0
- rubin_sim/maf/maf_contrib/tdes_pop_metric.py +362 -0
- rubin_sim/maf/maf_contrib/transient_ascii_sed_metric.py +652 -0
- rubin_sim/maf/maf_contrib/triplet_metric.py +156 -0
- rubin_sim/maf/maf_contrib/var_depth_metric.py +157 -0
- rubin_sim/maf/maf_contrib/xrb_metrics.py +523 -0
- rubin_sim/maf/maf_contrib/young_stellar_objects_metric.py +200 -0
- rubin_sim/maf/maf_night_report.py +200 -0
- rubin_sim/maf/make_fbs_tracking_db.py +90 -0
- rubin_sim/maf/maps/__init__.py +8 -0
- rubin_sim/maf/maps/base_map.py +72 -0
- rubin_sim/maf/maps/create_gaia_density_map.py +158 -0
- rubin_sim/maf/maps/dust_map.py +66 -0
- rubin_sim/maf/maps/dust_map_3d.py +190 -0
- rubin_sim/maf/maps/ebv_3d_hp.py +170 -0
- rubin_sim/maf/maps/ebv_hp.py +64 -0
- rubin_sim/maf/maps/gal_coords_map.py +22 -0
- rubin_sim/maf/maps/galactic_plane_priority_maps.py +210 -0
- rubin_sim/maf/maps/stellar_density_map.py +73 -0
- rubin_sim/maf/maps/trilegal_map.py +82 -0
- rubin_sim/maf/metadata_dir.py +90 -0
- rubin_sim/maf/metric_bundles/__init__.py +3 -0
- rubin_sim/maf/metric_bundles/metric_bundle.py +816 -0
- rubin_sim/maf/metric_bundles/metric_bundle_group.py +834 -0
- rubin_sim/maf/metric_bundles/mo_metric_bundle.py +646 -0
- rubin_sim/maf/metrics/__init__.py +52 -0
- rubin_sim/maf/metrics/agn_time_lag_metric.py +118 -0
- rubin_sim/maf/metrics/agnstructure.py +141 -0
- rubin_sim/maf/metrics/area_summary_metrics.py +120 -0
- rubin_sim/maf/metrics/base_metric.py +215 -0
- rubin_sim/maf/metrics/brown_dwarf_metric.py +162 -0
- rubin_sim/maf/metrics/cadence_metrics.py +400 -0
- rubin_sim/maf/metrics/calibration_metrics.py +618 -0
- rubin_sim/maf/metrics/chip_vendor_metric.py +43 -0
- rubin_sim/maf/metrics/color_slope_metrics.py +189 -0
- rubin_sim/maf/metrics/cosmology_summary_metrics.py +1212 -0
- rubin_sim/maf/metrics/coverage_metric.py +48 -0
- rubin_sim/maf/metrics/crowding_metric.py +255 -0
- rubin_sim/maf/metrics/cumulative_metric.py +46 -0
- rubin_sim/maf/metrics/dcr_metric.py +93 -0
- rubin_sim/maf/metrics/exgal_m5.py +57 -0
- rubin_sim/maf/metrics/fft_metric.py +27 -0
- rubin_sim/maf/metrics/galactic_plane_metrics.py +375 -0
- rubin_sim/maf/metrics/galplane_time_sampling_metrics.py +236 -0
- rubin_sim/maf/metrics/hourglass_metric.py +130 -0
- rubin_sim/maf/metrics/incremental_template_metric.py +255 -0
- rubin_sim/maf/metrics/kuiper_metrics.py +26 -0
- rubin_sim/maf/metrics/mo_metrics.py +1496 -0
- rubin_sim/maf/metrics/mo_summary_metrics.py +464 -0
- rubin_sim/maf/metrics/night_pointing_metric.py +70 -0
- rubin_sim/maf/metrics/optimal_m5_metric.py +94 -0
- rubin_sim/maf/metrics/pair_metric.py +69 -0
- rubin_sim/maf/metrics/periodic_detect_metric.py +133 -0
- rubin_sim/maf/metrics/phase_gap_metric.py +172 -0
- rubin_sim/maf/metrics/qso_number_counts_metric.py +138 -0
- rubin_sim/maf/metrics/scaling_metrics.py +148 -0
- rubin_sim/maf/metrics/schedview_metrics.py +39 -0
- rubin_sim/maf/metrics/season_metrics.py +344 -0
- rubin_sim/maf/metrics/simple_metrics.py +546 -0
- rubin_sim/maf/metrics/sky_sat_metric.py +18 -0
- rubin_sim/maf/metrics/sn_cadence_metric.py +104 -0
- rubin_sim/maf/metrics/sn_n_sn_metric.py +1364 -0
- rubin_sim/maf/metrics/sn_sl_metric.py +216 -0
- rubin_sim/maf/metrics/sn_snr_metric.py +715 -0
- rubin_sim/maf/metrics/snr_weight.py +24 -0
- rubin_sim/maf/metrics/star_density.py +77 -0
- rubin_sim/maf/metrics/string_count_metric.py +95 -0
- rubin_sim/maf/metrics/summary_metrics.py +201 -0
- rubin_sim/maf/metrics/surfb_metric.py +175 -0
- rubin_sim/maf/metrics/technical_metrics.py +271 -0
- rubin_sim/maf/metrics/tgaps.py +412 -0
- rubin_sim/maf/metrics/tomography_models.py +2034 -0
- rubin_sim/maf/metrics/transient_metrics.py +268 -0
- rubin_sim/maf/metrics/uniformity_metrics.py +418 -0
- rubin_sim/maf/metrics/use_metrics.py +55 -0
- rubin_sim/maf/metrics/vector_metrics.py +190 -0
- rubin_sim/maf/metrics/visit_groups_metric.py +341 -0
- rubin_sim/maf/metrics/weak_lensing_systematics_metric.py +210 -0
- rubin_sim/maf/plots/__init__.py +14 -0
- rubin_sim/maf/plots/hg_plotters.py +1117 -0
- rubin_sim/maf/plots/hourglass_plotters.py +120 -0
- rubin_sim/maf/plots/mo_plotters.py +358 -0
- rubin_sim/maf/plots/nd_plotters.py +220 -0
- rubin_sim/maf/plots/neo_distance_plotter.py +140 -0
- rubin_sim/maf/plots/night_pointing_plotter.py +96 -0
- rubin_sim/maf/plots/oned_plotters.py +114 -0
- rubin_sim/maf/plots/perceptual_rainbow.py +30 -0
- rubin_sim/maf/plots/plot_handler.py +766 -0
- rubin_sim/maf/plots/skyproj_plotters.py +540 -0
- rubin_sim/maf/plots/spatial_plotters.py +1029 -0
- rubin_sim/maf/plots/special_plotters.py +256 -0
- rubin_sim/maf/plots/two_d_plotters.py +177 -0
- rubin_sim/maf/plots/xyplotter.py +37 -0
- rubin_sim/maf/run_comparison/__init__.py +5 -0
- rubin_sim/maf/run_comparison/archive.py +584 -0
- rubin_sim/maf/run_comparison/gather_summaries.py +125 -0
- rubin_sim/maf/run_comparison/microlensing_compare.py +514 -0
- rubin_sim/maf/run_comparison/radar_plot.py +202 -0
- rubin_sim/maf/run_comparison/summary_plots.py +710 -0
- rubin_sim/maf/run_moving_calc.py +239 -0
- rubin_sim/maf/run_moving_fractions.py +128 -0
- rubin_sim/maf/run_moving_join.py +103 -0
- rubin_sim/maf/run_selfcal_metric.py +92 -0
- rubin_sim/maf/scimaf_dir.py +87 -0
- rubin_sim/maf/show_maf.py +227 -0
- rubin_sim/maf/slicers/__init__.py +13 -0
- rubin_sim/maf/slicers/base_slicer.py +513 -0
- rubin_sim/maf/slicers/base_spatial_slicer.py +202 -0
- rubin_sim/maf/slicers/healpix_sdss_slicer.py +118 -0
- rubin_sim/maf/slicers/healpix_slicer.py +189 -0
- rubin_sim/maf/slicers/healpix_subset_slicer.py +293 -0
- rubin_sim/maf/slicers/hourglass_slicer.py +37 -0
- rubin_sim/maf/slicers/mo_slicer.py +171 -0
- rubin_sim/maf/slicers/movie_slicer.py +288 -0
- rubin_sim/maf/slicers/nd_slicer.py +147 -0
- rubin_sim/maf/slicers/one_d_slicer.py +210 -0
- rubin_sim/maf/slicers/time_interval_slicers.py +283 -0
- rubin_sim/maf/slicers/uni_slicer.py +57 -0
- rubin_sim/maf/slicers/user_points_slicer.py +141 -0
- rubin_sim/maf/stackers/__init__.py +13 -0
- rubin_sim/maf/stackers/base_stacker.py +221 -0
- rubin_sim/maf/stackers/coord_stackers.py +224 -0
- rubin_sim/maf/stackers/date_stackers.py +192 -0
- rubin_sim/maf/stackers/general_stackers.py +683 -0
- rubin_sim/maf/stackers/get_col_info.py +104 -0
- rubin_sim/maf/stackers/label_stackers.py +114 -0
- rubin_sim/maf/stackers/m5_optimal_stacker.py +126 -0
- rubin_sim/maf/stackers/mo_phase.py +265 -0
- rubin_sim/maf/stackers/mo_stackers.py +486 -0
- rubin_sim/maf/stackers/n_follow_stacker.py +187 -0
- rubin_sim/maf/stackers/neo_dist_stacker.py +126 -0
- rubin_sim/maf/stackers/sdss_stackers.py +30 -0
- rubin_sim/maf/stackers/sn_stacker.py +152 -0
- rubin_sim/maf/stackers/teff_stacker.py +154 -0
- rubin_sim/maf/utils/__init__.py +6 -0
- rubin_sim/maf/utils/astrometry_utils.py +93 -0
- rubin_sim/maf/utils/generate_fov_map.py +58 -0
- rubin_sim/maf/utils/get_date_version.py +28 -0
- rubin_sim/maf/utils/maf_utils.py +212 -0
- rubin_sim/maf/utils/opsim_utils.py +259 -0
- rubin_sim/maf/utils/output_utils.py +34 -0
- rubin_sim/maf/utils/sn_n_sn_utils.py +894 -0
- rubin_sim/maf/utils/sn_utils.py +369 -0
- rubin_sim/maf/utils/stellar_mags.py +197 -0
- rubin_sim/maf/web/__init__.py +2 -0
- rubin_sim/maf/web/favicon.ico +0 -0
- rubin_sim/maf/web/maf_run_results.py +645 -0
- rubin_sim/maf/web/maf_tracking.py +139 -0
- rubin_sim/maf/web/sorttable.js +496 -0
- rubin_sim/maf/web/templates/allmetricresults.html +72 -0
- rubin_sim/maf/web/templates/configs.html +28 -0
- rubin_sim/maf/web/templates/macros.html +243 -0
- rubin_sim/maf/web/templates/master.html +294 -0
- rubin_sim/maf/web/templates/metricselect.html +91 -0
- rubin_sim/maf/web/templates/multicolor.html +147 -0
- rubin_sim/maf/web/templates/results.html +82 -0
- rubin_sim/maf/web/templates/runselect.html +58 -0
- rubin_sim/maf/web/templates/stats.html +50 -0
- rubin_sim/moving_objects/__init__.py +8 -0
- rubin_sim/moving_objects/base_obs.py +468 -0
- rubin_sim/moving_objects/cheby_fits.py +689 -0
- rubin_sim/moving_objects/cheby_values.py +231 -0
- rubin_sim/moving_objects/chebyshev_utils.py +365 -0
- rubin_sim/moving_objects/direct_obs.py +376 -0
- rubin_sim/moving_objects/make_lsst_obs.py +282 -0
- rubin_sim/moving_objects/ooephemerides.py +643 -0
- rubin_sim/moving_objects/orbits.py +507 -0
- rubin_sim/moving_objects/pre_generate.py +37 -0
- rubin_sim/moving_objects/utils.py +61 -0
- rubin_sim/phot_utils/__init__.py +7 -0
- rubin_sim/phot_utils/bandpass.py +425 -0
- rubin_sim/phot_utils/photometric_parameters.py +449 -0
- rubin_sim/phot_utils/physical_parameters.py +50 -0
- rubin_sim/phot_utils/predicted_zeropoints.py +245 -0
- rubin_sim/phot_utils/sed.py +1773 -0
- rubin_sim/phot_utils/sed_utils.py +52 -0
- rubin_sim/phot_utils/signaltonoise.py +695 -0
- rubin_sim/phot_utils/spectral_resampling.py +161 -0
- rubin_sim/satellite_constellations/__init__.py +3 -0
- rubin_sim/satellite_constellations/basis_function.py +40 -0
- rubin_sim/satellite_constellations/model_observatory.py +157 -0
- rubin_sim/satellite_constellations/sat_utils.py +488 -0
- rubin_sim/selfcal/__init__.py +4 -0
- rubin_sim/selfcal/generate_catalog.py +188 -0
- rubin_sim/selfcal/offsets.py +119 -0
- rubin_sim/selfcal/solver.py +143 -0
- rubin_sim/selfcal/star_tools.py +42 -0
- rubin_sim/sim_archive/__init__.py +14 -0
- rubin_sim/sim_archive/conda_packages.py +65 -0
- rubin_sim/sim_archive/future_vsarch.py +480 -0
- rubin_sim/sim_archive/make_snapshot.py +255 -0
- rubin_sim/sim_archive/prenight.py +216 -0
- rubin_sim/sim_archive/prenightindex.py +229 -0
- rubin_sim/sim_archive/prototype.py +1029 -0
- rubin_sim/sim_archive/sim_archive.py +680 -0
- rubin_sim/sim_archive/tempdb.py +56 -0
- rubin_sim/sim_archive/util.py +146 -0
- rubin_sim/sim_archive/vseqarchive.py +965 -0
- rubin_sim/sim_archive/vseqmetadata.py +1721 -0
- rubin_sim/skybrightness/__init__.py +5 -0
- rubin_sim/skybrightness/allsky_db.py +93 -0
- rubin_sim/skybrightness/data/ESO_Spectra/eso_tools.py +505 -0
- rubin_sim/skybrightness/data/solarSpec/package.py +22 -0
- rubin_sim/skybrightness/generate_hdf5.py +243 -0
- rubin_sim/skybrightness/interp_components.py +798 -0
- rubin_sim/skybrightness/sky_model.py +771 -0
- rubin_sim/skybrightness/twilight_func.py +83 -0
- rubin_sim/skybrightness/utils.py +91 -0
- rubin_sim-2.6.1.dev2.dist-info/METADATA +95 -0
- rubin_sim-2.6.1.dev2.dist-info/RECORD +387 -0
- rubin_sim-2.6.1.dev2.dist-info/WHEEL +5 -0
- rubin_sim-2.6.1.dev2.dist-info/entry_points.txt +24 -0
- rubin_sim-2.6.1.dev2.dist-info/licenses/LICENSE +674 -0
- rubin_sim-2.6.1.dev2.dist-info/top_level.txt +5 -0
- sql/make_vseqmeta.sql +251 -0
- tests/data/test_data.py +26 -0
- tests/data/test_ddf_grid.py +17 -0
- tests/maf/test_3x2fom.py +68 -0
- tests/maf/test_archive.py +162 -0
- tests/maf/test_basemetrics.py +99 -0
- tests/maf/test_batchcommon.py +36 -0
- tests/maf/test_batches.py +159 -0
- tests/maf/test_cadencemetrics.py +388 -0
- tests/maf/test_calibrationmetrics.py +242 -0
- tests/maf/test_color_slopes.py +71 -0
- tests/maf/test_cosmology_summaries.py +20 -0
- tests/maf/test_gathersummaries.py +48 -0
- tests/maf/test_healpixslicer.py +439 -0
- tests/maf/test_healpixsubsetslicer.py +273 -0
- tests/maf/test_hgplotters.py +145 -0
- tests/maf/test_hourglassmetric.py +33 -0
- tests/maf/test_io.py +187 -0
- tests/maf/test_json.py +169 -0
- tests/maf/test_maps.py +199 -0
- tests/maf/test_metricbundle.py +69 -0
- tests/maf/test_mometrics.py +422 -0
- tests/maf/test_movieslicer.py +216 -0
- tests/maf/test_ndslicer.py +240 -0
- tests/maf/test_neodistanceplotter.py +41 -0
- tests/maf/test_onedslicer.py +245 -0
- tests/maf/test_opsimutils.py +80 -0
- tests/maf/test_plotters.py +134 -0
- tests/maf/test_resultsdb.py +145 -0
- tests/maf/test_schedviewmetrics.py +14 -0
- tests/maf/test_simplemetrics.py +200 -0
- tests/maf/test_snmetrics.py +335 -0
- tests/maf/test_snmetrics_nsn.py +123 -0
- tests/maf/test_stackers.py +423 -0
- tests/maf/test_stellarmags.py +50 -0
- tests/maf/test_stringcount.py +26 -0
- tests/maf/test_summary_plots.py +197 -0
- tests/maf/test_summarymetrics.py +82 -0
- tests/maf/test_technicalmetrics.py +267 -0
- tests/maf/test_templatemetrics.py +86 -0
- tests/maf/test_timeintervalslicers.py +97 -0
- tests/maf/test_trackingdb.py +88 -0
- tests/maf/test_unislicer.py +116 -0
- tests/maf/test_vectormetrics.py +225 -0
- tests/maf/test_visitgroupsmetric.py +181 -0
- tests/moving_objects/test_camera.py +39 -0
- tests/moving_objects/test_chebyfits.py +188 -0
- tests/moving_objects/test_chebyshevutils.py +76 -0
- tests/moving_objects/test_chebyvalues.py +245 -0
- tests/moving_objects/test_ephemerides.py +219 -0
- tests/moving_objects/test_orbits.py +170 -0
- tests/moving_objects/test_sed_data.py +61 -0
- tests/phot_utils/test_approximatebandpasses.py +91 -0
- tests/phot_utils/test_photometricparameters.py +268 -0
- tests/phot_utils/test_photometry.py +61 -0
- tests/phot_utils/test_predicted_zeropoints.py +53 -0
- tests/phot_utils/test_read_bandpasses.py +29 -0
- tests/phot_utils/test_sed.py +368 -0
- tests/phot_utils/test_snr.py +370 -0
- tests/satellite_constellations/test_satellites.py +36 -0
- tests/sim_archive/test_make_snapshot.py +24 -0
- tests/sim_archive/test_prototype_sim_archive.py +204 -0
- tests/sim_archive/test_vseqarchive.py +947 -0
- tests/skybrightness/test_skymodel.py +359 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
__all__ = ("YearCoverageMetric",)
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
from .base_metric import BaseMetric
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class YearCoverageMetric(BaseMetric):
|
|
9
|
+
"""Count the number of `bins` covered by night_col.
|
|
10
|
+
|
|
11
|
+
The default `bins` cover years 0 to 10.
|
|
12
|
+
Handy for checking that a point on the sky gets observed every year,
|
|
13
|
+
as the default settings result in the metric returning the number years
|
|
14
|
+
in the data_slice (when used with a HealpixSlicer).
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
night_col : `str`, opt
|
|
19
|
+
Data column to histogram. Default 'night'.
|
|
20
|
+
bins : `np.ndarray`, (N,), opt
|
|
21
|
+
Bins to use in the histogram. Default corresponds to years 0-10
|
|
22
|
+
(with 365.25 nights per year).
|
|
23
|
+
units : `str`, opt
|
|
24
|
+
Units to use for the metric result. Default 'N years'.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
nbins : `int`
|
|
29
|
+
Number of histogram bins where the histogram value is greater than 0.
|
|
30
|
+
Typically this will be the number of years in the 'night_col'.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self, night_col="night", bins=None, units=None, **kwargs):
|
|
34
|
+
self.night_col = night_col
|
|
35
|
+
if bins is None:
|
|
36
|
+
self.bins = np.arange(0, np.ceil(365.25 * 10.0), 365.25) - 0.5
|
|
37
|
+
else:
|
|
38
|
+
self.bins = bins
|
|
39
|
+
|
|
40
|
+
if units is None:
|
|
41
|
+
units = "N years"
|
|
42
|
+
|
|
43
|
+
super().__init__([night_col], units=units)
|
|
44
|
+
|
|
45
|
+
def run(self, data_slice, slice_point):
|
|
46
|
+
hist, be = np.histogram(data_slice[self.night_col], bins=self.bins)
|
|
47
|
+
result = np.where(hist > 0)[0].size
|
|
48
|
+
return result
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
__all__ = ("CrowdingM5Metric", "CrowdingMagUncertMetric", "NstarsMetric")
|
|
2
|
+
|
|
3
|
+
import healpy as hp
|
|
4
|
+
import numpy as np
|
|
5
|
+
from scipy.interpolate import interp1d
|
|
6
|
+
|
|
7
|
+
from rubin_sim.maf.metrics import BaseMetric
|
|
8
|
+
|
|
9
|
+
# Originally contributed by Knut Olson (@knutago).
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _comp_crowd_error(mag_vector, lum_func, seeing, single_mag=None):
|
|
13
|
+
"""
|
|
14
|
+
Compute the photometric crowding error given the luminosity
|
|
15
|
+
function and best seeing.
|
|
16
|
+
|
|
17
|
+
Equation from Olsen, Blum, & Rigaut 2003, AJ, 126, 452
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
mag_vector : `np.array` (N,)
|
|
22
|
+
Stellar magnitudes.
|
|
23
|
+
lum_func : `np.array` (N,)
|
|
24
|
+
Stellar luminosity function.
|
|
25
|
+
seeing : `float`
|
|
26
|
+
The best seeing conditions.
|
|
27
|
+
Assuming forced-photometry can use the best seeing conditions
|
|
28
|
+
to help with confusion errors.
|
|
29
|
+
single_mag : `float` or None
|
|
30
|
+
If single_mag is None, the crowding error is calculated
|
|
31
|
+
for each mag in mag_vector. If single_mag is a float,
|
|
32
|
+
the crowding error is interpolated to that single value.
|
|
33
|
+
|
|
34
|
+
Returns
|
|
35
|
+
-------
|
|
36
|
+
mag_uncert : `np.array` (N,)
|
|
37
|
+
Magnitude uncertainties.
|
|
38
|
+
"""
|
|
39
|
+
# Our saved luminosity functions are cumulative,
|
|
40
|
+
# so we must here convert to differential
|
|
41
|
+
lum_func = np.diff(lum_func)
|
|
42
|
+
mag_vector = mag_vector[1:]
|
|
43
|
+
lum_area_arcsec = 3600.0**2
|
|
44
|
+
lum_vector = 10 ** (-0.4 * mag_vector)
|
|
45
|
+
coeff = np.sqrt(np.pi / lum_area_arcsec) * seeing / 2.0
|
|
46
|
+
my_int = (np.add.accumulate((lum_vector**2 * lum_func)[::-1]))[::-1]
|
|
47
|
+
temp = np.sqrt(my_int) / lum_vector
|
|
48
|
+
if single_mag is not None:
|
|
49
|
+
interp = interp1d(mag_vector, temp)
|
|
50
|
+
temp = interp(single_mag)
|
|
51
|
+
crowd_error = coeff * temp
|
|
52
|
+
return crowd_error
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class CrowdingM5Metric(BaseMetric):
|
|
56
|
+
"""Calculate the magnitude at which the photometric error exceeds
|
|
57
|
+
the crowding error threshold.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
crowding_error : `float`, optional
|
|
62
|
+
The magnitude uncertainty from crowding in magnitudes.
|
|
63
|
+
Default 0.1 mags.
|
|
64
|
+
filtername : `str`, optional
|
|
65
|
+
The bandpass in which to calculate the crowding limit. Default r.
|
|
66
|
+
seeing_col : `str`, optional
|
|
67
|
+
The name of the seeing column.
|
|
68
|
+
m5Col : `str`, optional
|
|
69
|
+
The name of the m5 depth column.
|
|
70
|
+
maps : `list` [`str`], optional
|
|
71
|
+
Names of maps required for the metric.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
mag : `float`
|
|
76
|
+
The magnitude of a star which has a photometric error of
|
|
77
|
+
`crowding_error`
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
def __init__(
|
|
81
|
+
self,
|
|
82
|
+
crowding_error=0.1,
|
|
83
|
+
filtername="r",
|
|
84
|
+
seeing_col="seeingFwhmGeom",
|
|
85
|
+
metric_name=None,
|
|
86
|
+
maps=["StellarDensityMap"],
|
|
87
|
+
**kwargs,
|
|
88
|
+
):
|
|
89
|
+
cols = [seeing_col]
|
|
90
|
+
units = "mag"
|
|
91
|
+
self.crowding_error = crowding_error
|
|
92
|
+
self.filtername = filtername
|
|
93
|
+
self.seeing_col = seeing_col
|
|
94
|
+
if metric_name is None:
|
|
95
|
+
metric_name = "Crowding to Precision %.2f" % (crowding_error)
|
|
96
|
+
super().__init__(col=cols, maps=maps, units=units, metric_name=metric_name, **kwargs)
|
|
97
|
+
|
|
98
|
+
def run(self, data_slice, slice_point=None):
|
|
99
|
+
# Set mag_vector to the same length as starLumFunc
|
|
100
|
+
# (lower edge of mag bins)
|
|
101
|
+
mag_vector = slice_point[f"starMapBins_{self.filtername}"][1:]
|
|
102
|
+
# Pull up density of stars at this point in the sky
|
|
103
|
+
lum_func = slice_point[f"starLumFunc_{self.filtername}"]
|
|
104
|
+
# Calculate the crowding error using the best seeing value
|
|
105
|
+
# (in any filter?)
|
|
106
|
+
crowd_error = _comp_crowd_error(mag_vector, lum_func, seeing=min(data_slice[self.seeing_col]))
|
|
107
|
+
# Locate at which point crowding error is greater than user-defined
|
|
108
|
+
# limit
|
|
109
|
+
above_crowd = np.where(crowd_error >= self.crowding_error)[0]
|
|
110
|
+
|
|
111
|
+
if np.size(above_crowd) == 0:
|
|
112
|
+
result = max(mag_vector)
|
|
113
|
+
else:
|
|
114
|
+
crowd_mag = mag_vector[max(above_crowd[0] - 1, 0)]
|
|
115
|
+
result = crowd_mag
|
|
116
|
+
|
|
117
|
+
return result
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class NstarsMetric(BaseMetric):
|
|
121
|
+
"""Calculate the number of stars detectable above some uncertainty
|
|
122
|
+
limit, taking image depth and crowding into account.
|
|
123
|
+
|
|
124
|
+
Parameters
|
|
125
|
+
----------
|
|
126
|
+
crowding_error : `float`, opt
|
|
127
|
+
The magnitude uncertainty from crowding in magnitudes.
|
|
128
|
+
Default 0.1 mags.
|
|
129
|
+
filtername : `str`, opt
|
|
130
|
+
The bandpass in which to calculate the crowding limit. Default r.
|
|
131
|
+
seeing_col : `str`, opt
|
|
132
|
+
The name of the seeing column.
|
|
133
|
+
m5_col : `str`, opt
|
|
134
|
+
The name of the m5 depth column.
|
|
135
|
+
maps : `list` [`str`], opt
|
|
136
|
+
Names of maps required for the metric.
|
|
137
|
+
ignore_crowding : `bool`, opt
|
|
138
|
+
Ignore the crowding limit.
|
|
139
|
+
|
|
140
|
+
Returns
|
|
141
|
+
-------
|
|
142
|
+
nstars : `float`
|
|
143
|
+
The number of stars above the error limit.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
def __init__(
|
|
147
|
+
self,
|
|
148
|
+
crowding_error=0.1,
|
|
149
|
+
filtername="r",
|
|
150
|
+
seeing_col="seeingFwhmGeom",
|
|
151
|
+
m5_col="fiveSigmaDepth",
|
|
152
|
+
metric_name=None,
|
|
153
|
+
maps=["StellarDensityMap"],
|
|
154
|
+
ignore_crowding=False,
|
|
155
|
+
**kwargs,
|
|
156
|
+
):
|
|
157
|
+
cols = [seeing_col, m5_col]
|
|
158
|
+
units = "N stars"
|
|
159
|
+
self.crowding_error = crowding_error
|
|
160
|
+
self.m5_col = m5_col
|
|
161
|
+
self.filtername = filtername
|
|
162
|
+
self.seeing_col = seeing_col
|
|
163
|
+
self.ignore_crowding = ignore_crowding
|
|
164
|
+
if metric_name is None:
|
|
165
|
+
metric_name = "N stars to Precision %.2f" % (crowding_error)
|
|
166
|
+
super().__init__(col=cols, maps=maps, units=units, metric_name=metric_name, **kwargs)
|
|
167
|
+
|
|
168
|
+
def run(self, data_slice, slice_point=None):
|
|
169
|
+
pix_area = hp.nside2pixarea(slice_point["nside"], degrees=True)
|
|
170
|
+
# Set mag_vector to the same length as starLumFunc
|
|
171
|
+
# (lower edge of mag bins)
|
|
172
|
+
mag_vector = slice_point[f"starMapBins_{self.filtername}"][1:]
|
|
173
|
+
# Pull up density of stars at this point in the sky
|
|
174
|
+
lum_func = slice_point[f"starLumFunc_{self.filtername}"]
|
|
175
|
+
# Calculate the crowding error using the best seeing value
|
|
176
|
+
# (in any filter?)
|
|
177
|
+
crowd_error = _comp_crowd_error(mag_vector, lum_func, seeing=min(data_slice[self.seeing_col]))
|
|
178
|
+
# Locate at which point crowding error is greater than
|
|
179
|
+
# user-defined limit
|
|
180
|
+
above_crowd = np.where(crowd_error >= self.crowding_error)[0]
|
|
181
|
+
|
|
182
|
+
if np.size(above_crowd) == 0:
|
|
183
|
+
crowd_mag = max(mag_vector)
|
|
184
|
+
else:
|
|
185
|
+
crowd_mag = mag_vector[max(above_crowd[0] - 1, 0)]
|
|
186
|
+
|
|
187
|
+
# Compute the coadded depth, and the mag where that depth
|
|
188
|
+
# hits the error specified
|
|
189
|
+
coadded_depth = 1.25 * np.log10(np.sum(10.0 ** (0.8 * data_slice[self.m5_col])))
|
|
190
|
+
mag_limit = -2.5 * np.log10(1.0 / (self.crowding_error * (1.09 * 5))) + coadded_depth
|
|
191
|
+
|
|
192
|
+
# Use the shallower depth, crowding or coadded
|
|
193
|
+
if self.ignore_crowding:
|
|
194
|
+
min_mag = mag_limit
|
|
195
|
+
else:
|
|
196
|
+
min_mag = np.min([crowd_mag, mag_limit])
|
|
197
|
+
|
|
198
|
+
# Interpolate to the number of stars
|
|
199
|
+
result = (
|
|
200
|
+
np.interp(
|
|
201
|
+
min_mag,
|
|
202
|
+
slice_point[f"starMapBins_{self.filtername}"][1:],
|
|
203
|
+
slice_point[f"starLumFunc_{self.filtername}"],
|
|
204
|
+
)
|
|
205
|
+
* pix_area
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
return result
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class CrowdingMagUncertMetric(BaseMetric):
|
|
212
|
+
"""Calculate the mean uncertainty in magnitude due to crowding.
|
|
213
|
+
|
|
214
|
+
Parameters
|
|
215
|
+
----------
|
|
216
|
+
rmag : `float`
|
|
217
|
+
The magnitude of the star to consider.
|
|
218
|
+
|
|
219
|
+
Returns
|
|
220
|
+
-------
|
|
221
|
+
mag_uncert : `float`
|
|
222
|
+
The uncertainty in magnitudes caused by crowding for a star of rmag.
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
def __init__(
|
|
226
|
+
self,
|
|
227
|
+
rmag=20.0,
|
|
228
|
+
seeing_col="seeingFwhmGeom",
|
|
229
|
+
units="mag",
|
|
230
|
+
metric_name=None,
|
|
231
|
+
filtername="r",
|
|
232
|
+
maps=["StellarDensityMap"],
|
|
233
|
+
**kwargs,
|
|
234
|
+
):
|
|
235
|
+
self.filtername = filtername
|
|
236
|
+
self.seeing_col = seeing_col
|
|
237
|
+
self.rmag = rmag
|
|
238
|
+
if metric_name is None:
|
|
239
|
+
metric_name = "CrowdingError at %.2f" % (rmag)
|
|
240
|
+
super().__init__(col=[seeing_col], maps=maps, units=units, metric_name=metric_name, **kwargs)
|
|
241
|
+
|
|
242
|
+
def run(self, data_slice, slice_point=None):
|
|
243
|
+
mag_vector = slice_point[f"starMapBins_{self.filtername}"][1:]
|
|
244
|
+
lum_func = slice_point[f"starLumFunc_{self.filtername}"]
|
|
245
|
+
# Magnitude uncertainty given crowding
|
|
246
|
+
# Use minimum here, however this may not be appropriate in all cases.
|
|
247
|
+
# (minimum makes value here match MagCrowding above, however
|
|
248
|
+
# the minimum seeing could also correlate with poor m5 values)
|
|
249
|
+
# Likely there should be some comparison between errors from crowding
|
|
250
|
+
# and errors from photometric noise that we're just not doing.
|
|
251
|
+
dmag_crowd = _comp_crowd_error(
|
|
252
|
+
mag_vector, lum_func, min(data_slice[self.seeing_col]), single_mag=self.rmag
|
|
253
|
+
)
|
|
254
|
+
result = np.mean(dmag_crowd)
|
|
255
|
+
return result
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
__all__ = ("CumulativeMetric",)
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
from .base_metric import BaseMetric
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CumulativeMetric(BaseMetric):
|
|
9
|
+
"""For plotting up the cumulative number of observations.
|
|
10
|
+
Expected to be used with a UniSlicer or UserPointSlicer with one point.
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
interp_points : `np.array`, (N,) or None
|
|
15
|
+
The points to interpolate the cumulative number of observations to.
|
|
16
|
+
If None, then the range of the data is used with a stepsize of 1.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
metric_name="Cumulative",
|
|
22
|
+
time_col="observationStartMJD",
|
|
23
|
+
night_col="night",
|
|
24
|
+
interp_points=None,
|
|
25
|
+
**kwargs,
|
|
26
|
+
):
|
|
27
|
+
super().__init__(col=[time_col, night_col], metric_name=metric_name, metric_dtype="object", **kwargs)
|
|
28
|
+
self.time_col = time_col
|
|
29
|
+
self.night_col = night_col
|
|
30
|
+
self.interp_points = interp_points
|
|
31
|
+
self.plot_dict = {"xlabel": "MJD (days)", "ylabel": "N obs"}
|
|
32
|
+
|
|
33
|
+
def run(self, data_slice, slice_point=None):
|
|
34
|
+
data_slice.sort(order=self.time_col)
|
|
35
|
+
if self.interp_points is None:
|
|
36
|
+
interp_points = np.arange(
|
|
37
|
+
data_slice[self.night_col].min(),
|
|
38
|
+
data_slice[self.night_col].max() + 1,
|
|
39
|
+
1,
|
|
40
|
+
)
|
|
41
|
+
else:
|
|
42
|
+
interp_points = self.interp_points
|
|
43
|
+
cumulative_number = np.arange(data_slice.size) + 1
|
|
44
|
+
yresult = np.interp(interp_points, data_slice[self.night_col], cumulative_number)
|
|
45
|
+
xresult = interp_points
|
|
46
|
+
return {"x": xresult, "y": yresult, "plot_dict": self.plot_dict}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
__all__ = ("DcrPrecisionMetric",)
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import rubin_scheduler.utils as utils
|
|
5
|
+
|
|
6
|
+
import rubin_sim.maf.utils as mafUtils
|
|
7
|
+
|
|
8
|
+
from .base_metric import BaseMetric
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DcrPrecisionMetric(BaseMetric):
|
|
12
|
+
"""Determine how precise a DCR correction could be made
|
|
13
|
+
|
|
14
|
+
Parameters
|
|
15
|
+
----------
|
|
16
|
+
atm_err : `float`
|
|
17
|
+
Minimum error in photometry centroids introduced by the atmosphere
|
|
18
|
+
(arcseconds). Default 0.01.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
metric_name="DCRprecision",
|
|
24
|
+
seeing_col="seeingFwhmGeom",
|
|
25
|
+
m5_col="fiveSigmaDepth",
|
|
26
|
+
ha_col="HA",
|
|
27
|
+
pa_col="paraAngle",
|
|
28
|
+
filter_col="band",
|
|
29
|
+
atm_err=0.01,
|
|
30
|
+
sed_template="flat",
|
|
31
|
+
rmag=20.0,
|
|
32
|
+
**kwargs,
|
|
33
|
+
):
|
|
34
|
+
self.m5_col = m5_col
|
|
35
|
+
self.filter_col = filter_col
|
|
36
|
+
self.pa_col = pa_col
|
|
37
|
+
self.seeing_col = seeing_col
|
|
38
|
+
self.mags = {}
|
|
39
|
+
self.filters = ["u", "g", "r", "i", "z", "y"]
|
|
40
|
+
if sed_template == "flat":
|
|
41
|
+
for f in self.filters:
|
|
42
|
+
self.mags[f] = rmag
|
|
43
|
+
else:
|
|
44
|
+
self.mags = utils.stellarMags(sed_template, rmag=rmag)
|
|
45
|
+
cols = [
|
|
46
|
+
"ra_dcr_amp",
|
|
47
|
+
"dec_dcr_amp",
|
|
48
|
+
seeing_col,
|
|
49
|
+
m5_col,
|
|
50
|
+
filter_col,
|
|
51
|
+
"zenithDistance",
|
|
52
|
+
pa_col,
|
|
53
|
+
]
|
|
54
|
+
units = "arcseconds"
|
|
55
|
+
self.atm_err = atm_err
|
|
56
|
+
super(DcrPrecisionMetric, self).__init__(cols, metric_name=metric_name, units=units, **kwargs)
|
|
57
|
+
|
|
58
|
+
def run(self, data_slice, slice_point=None):
|
|
59
|
+
snr = np.zeros(len(data_slice), dtype="float")
|
|
60
|
+
for filt in self.filters:
|
|
61
|
+
in_filt = np.where(data_slice[self.filter_col] == filt)
|
|
62
|
+
snr[in_filt] = mafUtils.m52snr(self.mags[filt], data_slice[self.m5_col][in_filt])
|
|
63
|
+
|
|
64
|
+
position_errors = np.sqrt(
|
|
65
|
+
mafUtils.astrom_precision(data_slice[self.seeing_col], snr) ** 2 + self.atm_err**2
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
x_coord = np.tan(np.radians(data_slice["zenithDistance"])) * np.sin(
|
|
69
|
+
np.radians(data_slice[self.pa_col])
|
|
70
|
+
)
|
|
71
|
+
x_coord2 = np.tan(np.radians(data_slice["zenithDistance"])) * np.cos(
|
|
72
|
+
np.radians(data_slice[self.pa_col])
|
|
73
|
+
)
|
|
74
|
+
# Things should be the same for RA and dec.
|
|
75
|
+
# Now I want to compute the error if I interpolate/extrapolate to +/-1.
|
|
76
|
+
|
|
77
|
+
# function is of form, y=ax. a=y/x. da = dy/x.
|
|
78
|
+
# Only strictly true if we know the unshifted position.
|
|
79
|
+
# But this should be a reasonable approx.
|
|
80
|
+
slope_uncerts = position_errors / x_coord
|
|
81
|
+
slope_uncerts2 = position_errors / x_coord2
|
|
82
|
+
|
|
83
|
+
total_slope_uncert = 1.0 / np.sqrt(np.sum(1.0 / slope_uncerts**2) + np.sum(1.0 / slope_uncerts2**2))
|
|
84
|
+
|
|
85
|
+
# So, this will be the uncertainty in the RA or Dec offset at
|
|
86
|
+
# x= +/- 1. A.K.A., the uncertainty in the slope
|
|
87
|
+
# of the line made by tan(zd)*sin(PA) vs RA offset
|
|
88
|
+
# or the line tan(zd)*cos(PA) vs Dec offset
|
|
89
|
+
# Assuming we know the unshfted position of the object
|
|
90
|
+
# (or there's little covariance if we are fitting for both)
|
|
91
|
+
result = total_slope_uncert
|
|
92
|
+
|
|
93
|
+
return result
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
__all__ = ("ExgalM5",)
|
|
2
|
+
|
|
3
|
+
from rubin_sim.phot_utils import DustValues
|
|
4
|
+
|
|
5
|
+
from .base_metric import BaseMetric
|
|
6
|
+
from .simple_metrics import Coaddm5Metric
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ExgalM5(BaseMetric):
|
|
10
|
+
"""
|
|
11
|
+
Calculate co-added five-sigma limiting depth after dust extinction.
|
|
12
|
+
|
|
13
|
+
Uses phot_utils to calculate dust extinction.
|
|
14
|
+
|
|
15
|
+
Parameters
|
|
16
|
+
----------
|
|
17
|
+
m5_col : `str`, optional
|
|
18
|
+
Column name for five sigma depth. Default 'fiveSigmaDepth'.
|
|
19
|
+
unit : `str`, optional
|
|
20
|
+
Label for units. Default 'mag'.
|
|
21
|
+
|
|
22
|
+
Returns
|
|
23
|
+
-------
|
|
24
|
+
coadd_m5 : `float`
|
|
25
|
+
Coadded m5 value, corrected for galactic dust extinction.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self, m5_col="fiveSigmaDepth", metric_name="ExgalM5", units="mag", filter_col="band", **kwargs
|
|
30
|
+
):
|
|
31
|
+
# Set the name for the dust map to use.
|
|
32
|
+
# This is gathered into the MetricBundle.
|
|
33
|
+
maps = ["DustMap"]
|
|
34
|
+
self.m5_col = m5_col
|
|
35
|
+
self.filter_col = filter_col
|
|
36
|
+
super().__init__(
|
|
37
|
+
col=[self.m5_col, self.filter_col], maps=maps, metric_name=metric_name, units=units, **kwargs
|
|
38
|
+
)
|
|
39
|
+
# Set the default wavelength limits for the lsst filters.
|
|
40
|
+
# These are approximately correct.
|
|
41
|
+
dust_properties = DustValues()
|
|
42
|
+
self.ax1 = dust_properties.ax1
|
|
43
|
+
# We will call Coaddm5Metric to calculate the coadded depth.
|
|
44
|
+
# Set it up here.
|
|
45
|
+
self.coaddm5_metric = Coaddm5Metric(m5_col=m5_col)
|
|
46
|
+
|
|
47
|
+
def run(self, data_slice, slice_point):
|
|
48
|
+
"""Compute the co-added m5 depth and then apply
|
|
49
|
+
dust extinction to that magnitude.
|
|
50
|
+
"""
|
|
51
|
+
m5 = self.coaddm5_metric.run(data_slice)
|
|
52
|
+
if m5 == self.coaddm5_metric.badval:
|
|
53
|
+
return self.badval
|
|
54
|
+
# Total dust extinction along this line of sight.
|
|
55
|
+
# Correct default A to this EBV value.
|
|
56
|
+
a_x = self.ax1[data_slice[self.filter_col][0]] * slice_point["ebv"]
|
|
57
|
+
return m5 - a_x
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
__all__ = ("FftMetric",)
|
|
2
|
+
|
|
3
|
+
from scipy import fftpack
|
|
4
|
+
|
|
5
|
+
from .base_metric import BaseMetric
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FftMetric(BaseMetric):
|
|
9
|
+
"""Calculate a truncated FFT of the exposure times."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, times_col="expmjd", metric_name="Fft", n_coeffs=100, **kwargs):
|
|
12
|
+
"""Instantiate metric.
|
|
13
|
+
|
|
14
|
+
'times_col' = column with the time of the visit (default expmjd),
|
|
15
|
+
'n_coeffs' = number of coefficients of the (real) FFT to keep."""
|
|
16
|
+
self.times = times_col
|
|
17
|
+
super(FftMetric, self).__init__(col=[self.times], metric_name=metric_name, **kwargs)
|
|
18
|
+
# Set up length of return values.
|
|
19
|
+
self.n_coeffs = n_coeffs
|
|
20
|
+
return
|
|
21
|
+
|
|
22
|
+
def run(self, data_slice, slice_point=None):
|
|
23
|
+
fft = fftpack.rfft(data_slice[self.times])
|
|
24
|
+
return fft[0 : self.n_coeffs]
|
|
25
|
+
|
|
26
|
+
def reduce_peak(self, fft_coeff):
|
|
27
|
+
pass
|