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.
Files changed (387) hide show
  1. batch/compile_prenight_metadata_cache.sh +34 -0
  2. batch/run_auxtel_prenight_sims.sh +163 -0
  3. batch/run_prenight_sims.sh +239 -0
  4. docs/.gitignore +3 -0
  5. docs/Makefile +32 -0
  6. docs/api.rst +25 -0
  7. docs/conf.py +8 -0
  8. docs/data-api.rst +12 -0
  9. docs/data-download.rst +70 -0
  10. docs/developer.rst +14 -0
  11. docs/documenteer.toml +11 -0
  12. docs/index.rst +22 -0
  13. docs/installation.rst +76 -0
  14. docs/introduction.rst +37 -0
  15. docs/maf-api-batches.rst +12 -0
  16. docs/maf-api-db.rst +12 -0
  17. docs/maf-api-maf-contrib.rst +12 -0
  18. docs/maf-api-maps.rst +12 -0
  19. docs/maf-api-metricbundles.rst +12 -0
  20. docs/maf-api-metrics.rst +12 -0
  21. docs/maf-api-plots.rst +12 -0
  22. docs/maf-api-run-comparison.rst +12 -0
  23. docs/maf-api-slicers.rst +12 -0
  24. docs/maf-api-stackers.rst +12 -0
  25. docs/maf-api-utils.rst +12 -0
  26. docs/maf-api.rst +22 -0
  27. docs/maf.rst +60 -0
  28. docs/metric_list.py +49 -0
  29. docs/moving-objects-api.rst +12 -0
  30. docs/moving-objects.rst +22 -0
  31. docs/phot-utils-api.rst +12 -0
  32. docs/phot-utils.rst +11 -0
  33. docs/prenight.rst +117 -0
  34. docs/protoarchive.rst +276 -0
  35. docs/satellite-constellations-api.rst +12 -0
  36. docs/satellite-constellations.rst +13 -0
  37. docs/selfcal-api.rst +12 -0
  38. docs/selfcal.rst +15 -0
  39. docs/sim-archive-api.rst +12 -0
  40. docs/skybrightness-api.rst +12 -0
  41. docs/skybrightness.rst +23 -0
  42. docs/user-guide.rst +28 -0
  43. docs/vseqarchive-architecture.rst +438 -0
  44. docs/vseqarchive-setup.rst +238 -0
  45. docs/vseqarchive.rst +225 -0
  46. rubin_sim/__init__.py +7 -0
  47. rubin_sim/data/__init__.py +1 -0
  48. rubin_sim/data/rs_download_data.py +155 -0
  49. rubin_sim/maf/__init__.py +34 -0
  50. rubin_sim/maf/batches/__init__.py +18 -0
  51. rubin_sim/maf/batches/altaz_batch.py +161 -0
  52. rubin_sim/maf/batches/col_map_dict.py +274 -0
  53. rubin_sim/maf/batches/common.py +388 -0
  54. rubin_sim/maf/batches/ddf_batch.py +728 -0
  55. rubin_sim/maf/batches/filterchange_batch.py +182 -0
  56. rubin_sim/maf/batches/glance_batch.py +591 -0
  57. rubin_sim/maf/batches/hourglass_batch.py +79 -0
  58. rubin_sim/maf/batches/info_batch.py +114 -0
  59. rubin_sim/maf/batches/metadata_batch.py +558 -0
  60. rubin_sim/maf/batches/moving_objects_batch.py +1587 -0
  61. rubin_sim/maf/batches/openshutter_batch.py +100 -0
  62. rubin_sim/maf/batches/radar_limited.py +1100 -0
  63. rubin_sim/maf/batches/science_radar_batch.py +1910 -0
  64. rubin_sim/maf/batches/skycoverage.py +155 -0
  65. rubin_sim/maf/batches/slew_batch.py +146 -0
  66. rubin_sim/maf/batches/srd_batch.py +637 -0
  67. rubin_sim/maf/batches/time_batch.py +757 -0
  68. rubin_sim/maf/batches/time_sci_batch.py +105 -0
  69. rubin_sim/maf/batches/visitdepth_batch.py +485 -0
  70. rubin_sim/maf/db/__init__.py +2 -0
  71. rubin_sim/maf/db/add_run.py +34 -0
  72. rubin_sim/maf/db/results_db.py +1074 -0
  73. rubin_sim/maf/db/tracking_db.py +332 -0
  74. rubin_sim/maf/ddf_dir.py +53 -0
  75. rubin_sim/maf/generate_ss.py +218 -0
  76. rubin_sim/maf/glance_dir.py +58 -0
  77. rubin_sim/maf/maf_contrib/__init__.py +25 -0
  78. rubin_sim/maf/maf_contrib/calculate_lsst_field_visibility_astropy.py +170 -0
  79. rubin_sim/maf/maf_contrib/depth_limited_num_gal_metric.py +109 -0
  80. rubin_sim/maf/maf_contrib/example_new_metrics.py +40 -0
  81. rubin_sim/maf/maf_contrib/filter_pair_t_gaps_metric.py +208 -0
  82. rubin_sim/maf/maf_contrib/grb_transient_metric.py +249 -0
  83. rubin_sim/maf/maf_contrib/gw170817_det_metric.py +72 -0
  84. rubin_sim/maf/maf_contrib/intervals_between_obs_metric.py +68 -0
  85. rubin_sim/maf/maf_contrib/kne_metrics.py +473 -0
  86. rubin_sim/maf/maf_contrib/lss_metrics.py +45 -0
  87. rubin_sim/maf/maf_contrib/lss_obs_strategy/__init__.py +3 -0
  88. rubin_sim/maf/maf_contrib/lss_obs_strategy/constants_for_pipeline.py +73 -0
  89. rubin_sim/maf/maf_contrib/lss_obs_strategy/galaxy_counts_metric_extended.py +205 -0
  90. rubin_sim/maf/maf_contrib/lss_obs_strategy/galaxy_counts_with_pixel_calibration.py +171 -0
  91. rubin_sim/maf/maf_contrib/lv_dwarfs/__init__.py +1 -0
  92. rubin_sim/maf/maf_contrib/lv_dwarfs/lv_dwarfs_metrics.py +388 -0
  93. rubin_sim/maf/maf_contrib/microlensing_metric.py +593 -0
  94. rubin_sim/maf/maf_contrib/num_obs_in_survey_time_overlap_metric.py +43 -0
  95. rubin_sim/maf/maf_contrib/periodic_metric.py +51 -0
  96. rubin_sim/maf/maf_contrib/periodic_star_metric.py +186 -0
  97. rubin_sim/maf/maf_contrib/periodic_star_modulation_metric.py +236 -0
  98. rubin_sim/maf/maf_contrib/presto_color_kne_pop_metric.py +441 -0
  99. rubin_sim/maf/maf_contrib/selfcal_uniformity_metric.py +171 -0
  100. rubin_sim/maf/maf_contrib/star_count_mass_metric.py +64 -0
  101. rubin_sim/maf/maf_contrib/star_count_metric.py +56 -0
  102. rubin_sim/maf/maf_contrib/star_counts/__init__.py +8 -0
  103. rubin_sim/maf/maf_contrib/star_counts/abs_mag.py +324 -0
  104. rubin_sim/maf/maf_contrib/star_counts/coords.py +99 -0
  105. rubin_sim/maf/maf_contrib/star_counts/readme.txt +1 -0
  106. rubin_sim/maf/maf_contrib/star_counts/spec_type.py +91 -0
  107. rubin_sim/maf/maf_contrib/star_counts/starcount.py +30 -0
  108. rubin_sim/maf/maf_contrib/star_counts/starcount_bymass.py +93 -0
  109. rubin_sim/maf/maf_contrib/star_counts/stellardensity.py +59 -0
  110. rubin_sim/maf/maf_contrib/static_probes_fom_summary_metric.py +386 -0
  111. rubin_sim/maf/maf_contrib/tdes_pop_metric.py +362 -0
  112. rubin_sim/maf/maf_contrib/transient_ascii_sed_metric.py +652 -0
  113. rubin_sim/maf/maf_contrib/triplet_metric.py +156 -0
  114. rubin_sim/maf/maf_contrib/var_depth_metric.py +157 -0
  115. rubin_sim/maf/maf_contrib/xrb_metrics.py +523 -0
  116. rubin_sim/maf/maf_contrib/young_stellar_objects_metric.py +200 -0
  117. rubin_sim/maf/maf_night_report.py +200 -0
  118. rubin_sim/maf/make_fbs_tracking_db.py +90 -0
  119. rubin_sim/maf/maps/__init__.py +8 -0
  120. rubin_sim/maf/maps/base_map.py +72 -0
  121. rubin_sim/maf/maps/create_gaia_density_map.py +158 -0
  122. rubin_sim/maf/maps/dust_map.py +66 -0
  123. rubin_sim/maf/maps/dust_map_3d.py +190 -0
  124. rubin_sim/maf/maps/ebv_3d_hp.py +170 -0
  125. rubin_sim/maf/maps/ebv_hp.py +64 -0
  126. rubin_sim/maf/maps/gal_coords_map.py +22 -0
  127. rubin_sim/maf/maps/galactic_plane_priority_maps.py +210 -0
  128. rubin_sim/maf/maps/stellar_density_map.py +73 -0
  129. rubin_sim/maf/maps/trilegal_map.py +82 -0
  130. rubin_sim/maf/metadata_dir.py +90 -0
  131. rubin_sim/maf/metric_bundles/__init__.py +3 -0
  132. rubin_sim/maf/metric_bundles/metric_bundle.py +816 -0
  133. rubin_sim/maf/metric_bundles/metric_bundle_group.py +834 -0
  134. rubin_sim/maf/metric_bundles/mo_metric_bundle.py +646 -0
  135. rubin_sim/maf/metrics/__init__.py +52 -0
  136. rubin_sim/maf/metrics/agn_time_lag_metric.py +118 -0
  137. rubin_sim/maf/metrics/agnstructure.py +141 -0
  138. rubin_sim/maf/metrics/area_summary_metrics.py +120 -0
  139. rubin_sim/maf/metrics/base_metric.py +215 -0
  140. rubin_sim/maf/metrics/brown_dwarf_metric.py +162 -0
  141. rubin_sim/maf/metrics/cadence_metrics.py +400 -0
  142. rubin_sim/maf/metrics/calibration_metrics.py +618 -0
  143. rubin_sim/maf/metrics/chip_vendor_metric.py +43 -0
  144. rubin_sim/maf/metrics/color_slope_metrics.py +189 -0
  145. rubin_sim/maf/metrics/cosmology_summary_metrics.py +1212 -0
  146. rubin_sim/maf/metrics/coverage_metric.py +48 -0
  147. rubin_sim/maf/metrics/crowding_metric.py +255 -0
  148. rubin_sim/maf/metrics/cumulative_metric.py +46 -0
  149. rubin_sim/maf/metrics/dcr_metric.py +93 -0
  150. rubin_sim/maf/metrics/exgal_m5.py +57 -0
  151. rubin_sim/maf/metrics/fft_metric.py +27 -0
  152. rubin_sim/maf/metrics/galactic_plane_metrics.py +375 -0
  153. rubin_sim/maf/metrics/galplane_time_sampling_metrics.py +236 -0
  154. rubin_sim/maf/metrics/hourglass_metric.py +130 -0
  155. rubin_sim/maf/metrics/incremental_template_metric.py +255 -0
  156. rubin_sim/maf/metrics/kuiper_metrics.py +26 -0
  157. rubin_sim/maf/metrics/mo_metrics.py +1496 -0
  158. rubin_sim/maf/metrics/mo_summary_metrics.py +464 -0
  159. rubin_sim/maf/metrics/night_pointing_metric.py +70 -0
  160. rubin_sim/maf/metrics/optimal_m5_metric.py +94 -0
  161. rubin_sim/maf/metrics/pair_metric.py +69 -0
  162. rubin_sim/maf/metrics/periodic_detect_metric.py +133 -0
  163. rubin_sim/maf/metrics/phase_gap_metric.py +172 -0
  164. rubin_sim/maf/metrics/qso_number_counts_metric.py +138 -0
  165. rubin_sim/maf/metrics/scaling_metrics.py +148 -0
  166. rubin_sim/maf/metrics/schedview_metrics.py +39 -0
  167. rubin_sim/maf/metrics/season_metrics.py +344 -0
  168. rubin_sim/maf/metrics/simple_metrics.py +546 -0
  169. rubin_sim/maf/metrics/sky_sat_metric.py +18 -0
  170. rubin_sim/maf/metrics/sn_cadence_metric.py +104 -0
  171. rubin_sim/maf/metrics/sn_n_sn_metric.py +1364 -0
  172. rubin_sim/maf/metrics/sn_sl_metric.py +216 -0
  173. rubin_sim/maf/metrics/sn_snr_metric.py +715 -0
  174. rubin_sim/maf/metrics/snr_weight.py +24 -0
  175. rubin_sim/maf/metrics/star_density.py +77 -0
  176. rubin_sim/maf/metrics/string_count_metric.py +95 -0
  177. rubin_sim/maf/metrics/summary_metrics.py +201 -0
  178. rubin_sim/maf/metrics/surfb_metric.py +175 -0
  179. rubin_sim/maf/metrics/technical_metrics.py +271 -0
  180. rubin_sim/maf/metrics/tgaps.py +412 -0
  181. rubin_sim/maf/metrics/tomography_models.py +2034 -0
  182. rubin_sim/maf/metrics/transient_metrics.py +268 -0
  183. rubin_sim/maf/metrics/uniformity_metrics.py +418 -0
  184. rubin_sim/maf/metrics/use_metrics.py +55 -0
  185. rubin_sim/maf/metrics/vector_metrics.py +190 -0
  186. rubin_sim/maf/metrics/visit_groups_metric.py +341 -0
  187. rubin_sim/maf/metrics/weak_lensing_systematics_metric.py +210 -0
  188. rubin_sim/maf/plots/__init__.py +14 -0
  189. rubin_sim/maf/plots/hg_plotters.py +1117 -0
  190. rubin_sim/maf/plots/hourglass_plotters.py +120 -0
  191. rubin_sim/maf/plots/mo_plotters.py +358 -0
  192. rubin_sim/maf/plots/nd_plotters.py +220 -0
  193. rubin_sim/maf/plots/neo_distance_plotter.py +140 -0
  194. rubin_sim/maf/plots/night_pointing_plotter.py +96 -0
  195. rubin_sim/maf/plots/oned_plotters.py +114 -0
  196. rubin_sim/maf/plots/perceptual_rainbow.py +30 -0
  197. rubin_sim/maf/plots/plot_handler.py +766 -0
  198. rubin_sim/maf/plots/skyproj_plotters.py +540 -0
  199. rubin_sim/maf/plots/spatial_plotters.py +1029 -0
  200. rubin_sim/maf/plots/special_plotters.py +256 -0
  201. rubin_sim/maf/plots/two_d_plotters.py +177 -0
  202. rubin_sim/maf/plots/xyplotter.py +37 -0
  203. rubin_sim/maf/run_comparison/__init__.py +5 -0
  204. rubin_sim/maf/run_comparison/archive.py +584 -0
  205. rubin_sim/maf/run_comparison/gather_summaries.py +125 -0
  206. rubin_sim/maf/run_comparison/microlensing_compare.py +514 -0
  207. rubin_sim/maf/run_comparison/radar_plot.py +202 -0
  208. rubin_sim/maf/run_comparison/summary_plots.py +710 -0
  209. rubin_sim/maf/run_moving_calc.py +239 -0
  210. rubin_sim/maf/run_moving_fractions.py +128 -0
  211. rubin_sim/maf/run_moving_join.py +103 -0
  212. rubin_sim/maf/run_selfcal_metric.py +92 -0
  213. rubin_sim/maf/scimaf_dir.py +87 -0
  214. rubin_sim/maf/show_maf.py +227 -0
  215. rubin_sim/maf/slicers/__init__.py +13 -0
  216. rubin_sim/maf/slicers/base_slicer.py +513 -0
  217. rubin_sim/maf/slicers/base_spatial_slicer.py +202 -0
  218. rubin_sim/maf/slicers/healpix_sdss_slicer.py +118 -0
  219. rubin_sim/maf/slicers/healpix_slicer.py +189 -0
  220. rubin_sim/maf/slicers/healpix_subset_slicer.py +293 -0
  221. rubin_sim/maf/slicers/hourglass_slicer.py +37 -0
  222. rubin_sim/maf/slicers/mo_slicer.py +171 -0
  223. rubin_sim/maf/slicers/movie_slicer.py +288 -0
  224. rubin_sim/maf/slicers/nd_slicer.py +147 -0
  225. rubin_sim/maf/slicers/one_d_slicer.py +210 -0
  226. rubin_sim/maf/slicers/time_interval_slicers.py +283 -0
  227. rubin_sim/maf/slicers/uni_slicer.py +57 -0
  228. rubin_sim/maf/slicers/user_points_slicer.py +141 -0
  229. rubin_sim/maf/stackers/__init__.py +13 -0
  230. rubin_sim/maf/stackers/base_stacker.py +221 -0
  231. rubin_sim/maf/stackers/coord_stackers.py +224 -0
  232. rubin_sim/maf/stackers/date_stackers.py +192 -0
  233. rubin_sim/maf/stackers/general_stackers.py +683 -0
  234. rubin_sim/maf/stackers/get_col_info.py +104 -0
  235. rubin_sim/maf/stackers/label_stackers.py +114 -0
  236. rubin_sim/maf/stackers/m5_optimal_stacker.py +126 -0
  237. rubin_sim/maf/stackers/mo_phase.py +265 -0
  238. rubin_sim/maf/stackers/mo_stackers.py +486 -0
  239. rubin_sim/maf/stackers/n_follow_stacker.py +187 -0
  240. rubin_sim/maf/stackers/neo_dist_stacker.py +126 -0
  241. rubin_sim/maf/stackers/sdss_stackers.py +30 -0
  242. rubin_sim/maf/stackers/sn_stacker.py +152 -0
  243. rubin_sim/maf/stackers/teff_stacker.py +154 -0
  244. rubin_sim/maf/utils/__init__.py +6 -0
  245. rubin_sim/maf/utils/astrometry_utils.py +93 -0
  246. rubin_sim/maf/utils/generate_fov_map.py +58 -0
  247. rubin_sim/maf/utils/get_date_version.py +28 -0
  248. rubin_sim/maf/utils/maf_utils.py +212 -0
  249. rubin_sim/maf/utils/opsim_utils.py +259 -0
  250. rubin_sim/maf/utils/output_utils.py +34 -0
  251. rubin_sim/maf/utils/sn_n_sn_utils.py +894 -0
  252. rubin_sim/maf/utils/sn_utils.py +369 -0
  253. rubin_sim/maf/utils/stellar_mags.py +197 -0
  254. rubin_sim/maf/web/__init__.py +2 -0
  255. rubin_sim/maf/web/favicon.ico +0 -0
  256. rubin_sim/maf/web/maf_run_results.py +645 -0
  257. rubin_sim/maf/web/maf_tracking.py +139 -0
  258. rubin_sim/maf/web/sorttable.js +496 -0
  259. rubin_sim/maf/web/templates/allmetricresults.html +72 -0
  260. rubin_sim/maf/web/templates/configs.html +28 -0
  261. rubin_sim/maf/web/templates/macros.html +243 -0
  262. rubin_sim/maf/web/templates/master.html +294 -0
  263. rubin_sim/maf/web/templates/metricselect.html +91 -0
  264. rubin_sim/maf/web/templates/multicolor.html +147 -0
  265. rubin_sim/maf/web/templates/results.html +82 -0
  266. rubin_sim/maf/web/templates/runselect.html +58 -0
  267. rubin_sim/maf/web/templates/stats.html +50 -0
  268. rubin_sim/moving_objects/__init__.py +8 -0
  269. rubin_sim/moving_objects/base_obs.py +468 -0
  270. rubin_sim/moving_objects/cheby_fits.py +689 -0
  271. rubin_sim/moving_objects/cheby_values.py +231 -0
  272. rubin_sim/moving_objects/chebyshev_utils.py +365 -0
  273. rubin_sim/moving_objects/direct_obs.py +376 -0
  274. rubin_sim/moving_objects/make_lsst_obs.py +282 -0
  275. rubin_sim/moving_objects/ooephemerides.py +643 -0
  276. rubin_sim/moving_objects/orbits.py +507 -0
  277. rubin_sim/moving_objects/pre_generate.py +37 -0
  278. rubin_sim/moving_objects/utils.py +61 -0
  279. rubin_sim/phot_utils/__init__.py +7 -0
  280. rubin_sim/phot_utils/bandpass.py +425 -0
  281. rubin_sim/phot_utils/photometric_parameters.py +449 -0
  282. rubin_sim/phot_utils/physical_parameters.py +50 -0
  283. rubin_sim/phot_utils/predicted_zeropoints.py +245 -0
  284. rubin_sim/phot_utils/sed.py +1773 -0
  285. rubin_sim/phot_utils/sed_utils.py +52 -0
  286. rubin_sim/phot_utils/signaltonoise.py +695 -0
  287. rubin_sim/phot_utils/spectral_resampling.py +161 -0
  288. rubin_sim/satellite_constellations/__init__.py +3 -0
  289. rubin_sim/satellite_constellations/basis_function.py +40 -0
  290. rubin_sim/satellite_constellations/model_observatory.py +157 -0
  291. rubin_sim/satellite_constellations/sat_utils.py +488 -0
  292. rubin_sim/selfcal/__init__.py +4 -0
  293. rubin_sim/selfcal/generate_catalog.py +188 -0
  294. rubin_sim/selfcal/offsets.py +119 -0
  295. rubin_sim/selfcal/solver.py +143 -0
  296. rubin_sim/selfcal/star_tools.py +42 -0
  297. rubin_sim/sim_archive/__init__.py +14 -0
  298. rubin_sim/sim_archive/conda_packages.py +65 -0
  299. rubin_sim/sim_archive/future_vsarch.py +480 -0
  300. rubin_sim/sim_archive/make_snapshot.py +255 -0
  301. rubin_sim/sim_archive/prenight.py +216 -0
  302. rubin_sim/sim_archive/prenightindex.py +229 -0
  303. rubin_sim/sim_archive/prototype.py +1029 -0
  304. rubin_sim/sim_archive/sim_archive.py +680 -0
  305. rubin_sim/sim_archive/tempdb.py +56 -0
  306. rubin_sim/sim_archive/util.py +146 -0
  307. rubin_sim/sim_archive/vseqarchive.py +965 -0
  308. rubin_sim/sim_archive/vseqmetadata.py +1721 -0
  309. rubin_sim/skybrightness/__init__.py +5 -0
  310. rubin_sim/skybrightness/allsky_db.py +93 -0
  311. rubin_sim/skybrightness/data/ESO_Spectra/eso_tools.py +505 -0
  312. rubin_sim/skybrightness/data/solarSpec/package.py +22 -0
  313. rubin_sim/skybrightness/generate_hdf5.py +243 -0
  314. rubin_sim/skybrightness/interp_components.py +798 -0
  315. rubin_sim/skybrightness/sky_model.py +771 -0
  316. rubin_sim/skybrightness/twilight_func.py +83 -0
  317. rubin_sim/skybrightness/utils.py +91 -0
  318. rubin_sim-2.6.1.dev2.dist-info/METADATA +95 -0
  319. rubin_sim-2.6.1.dev2.dist-info/RECORD +387 -0
  320. rubin_sim-2.6.1.dev2.dist-info/WHEEL +5 -0
  321. rubin_sim-2.6.1.dev2.dist-info/entry_points.txt +24 -0
  322. rubin_sim-2.6.1.dev2.dist-info/licenses/LICENSE +674 -0
  323. rubin_sim-2.6.1.dev2.dist-info/top_level.txt +5 -0
  324. sql/make_vseqmeta.sql +251 -0
  325. tests/data/test_data.py +26 -0
  326. tests/data/test_ddf_grid.py +17 -0
  327. tests/maf/test_3x2fom.py +68 -0
  328. tests/maf/test_archive.py +162 -0
  329. tests/maf/test_basemetrics.py +99 -0
  330. tests/maf/test_batchcommon.py +36 -0
  331. tests/maf/test_batches.py +159 -0
  332. tests/maf/test_cadencemetrics.py +388 -0
  333. tests/maf/test_calibrationmetrics.py +242 -0
  334. tests/maf/test_color_slopes.py +71 -0
  335. tests/maf/test_cosmology_summaries.py +20 -0
  336. tests/maf/test_gathersummaries.py +48 -0
  337. tests/maf/test_healpixslicer.py +439 -0
  338. tests/maf/test_healpixsubsetslicer.py +273 -0
  339. tests/maf/test_hgplotters.py +145 -0
  340. tests/maf/test_hourglassmetric.py +33 -0
  341. tests/maf/test_io.py +187 -0
  342. tests/maf/test_json.py +169 -0
  343. tests/maf/test_maps.py +199 -0
  344. tests/maf/test_metricbundle.py +69 -0
  345. tests/maf/test_mometrics.py +422 -0
  346. tests/maf/test_movieslicer.py +216 -0
  347. tests/maf/test_ndslicer.py +240 -0
  348. tests/maf/test_neodistanceplotter.py +41 -0
  349. tests/maf/test_onedslicer.py +245 -0
  350. tests/maf/test_opsimutils.py +80 -0
  351. tests/maf/test_plotters.py +134 -0
  352. tests/maf/test_resultsdb.py +145 -0
  353. tests/maf/test_schedviewmetrics.py +14 -0
  354. tests/maf/test_simplemetrics.py +200 -0
  355. tests/maf/test_snmetrics.py +335 -0
  356. tests/maf/test_snmetrics_nsn.py +123 -0
  357. tests/maf/test_stackers.py +423 -0
  358. tests/maf/test_stellarmags.py +50 -0
  359. tests/maf/test_stringcount.py +26 -0
  360. tests/maf/test_summary_plots.py +197 -0
  361. tests/maf/test_summarymetrics.py +82 -0
  362. tests/maf/test_technicalmetrics.py +267 -0
  363. tests/maf/test_templatemetrics.py +86 -0
  364. tests/maf/test_timeintervalslicers.py +97 -0
  365. tests/maf/test_trackingdb.py +88 -0
  366. tests/maf/test_unislicer.py +116 -0
  367. tests/maf/test_vectormetrics.py +225 -0
  368. tests/maf/test_visitgroupsmetric.py +181 -0
  369. tests/moving_objects/test_camera.py +39 -0
  370. tests/moving_objects/test_chebyfits.py +188 -0
  371. tests/moving_objects/test_chebyshevutils.py +76 -0
  372. tests/moving_objects/test_chebyvalues.py +245 -0
  373. tests/moving_objects/test_ephemerides.py +219 -0
  374. tests/moving_objects/test_orbits.py +170 -0
  375. tests/moving_objects/test_sed_data.py +61 -0
  376. tests/phot_utils/test_approximatebandpasses.py +91 -0
  377. tests/phot_utils/test_photometricparameters.py +268 -0
  378. tests/phot_utils/test_photometry.py +61 -0
  379. tests/phot_utils/test_predicted_zeropoints.py +53 -0
  380. tests/phot_utils/test_read_bandpasses.py +29 -0
  381. tests/phot_utils/test_sed.py +368 -0
  382. tests/phot_utils/test_snr.py +370 -0
  383. tests/satellite_constellations/test_satellites.py +36 -0
  384. tests/sim_archive/test_make_snapshot.py +24 -0
  385. tests/sim_archive/test_prototype_sim_archive.py +204 -0
  386. tests/sim_archive/test_vseqarchive.py +947 -0
  387. tests/skybrightness/test_skymodel.py +359 -0
@@ -0,0 +1,369 @@
1
+ import matplotlib.pyplot as plt
2
+ import numpy as np
3
+ import numpy.lib.recfunctions as rf
4
+ from scipy import interpolate
5
+
6
+
7
+ class Lims:
8
+ """class to handle light curve of SN
9
+
10
+ Parameters
11
+ -------------
12
+ Li_files : `str`
13
+ light curve reference file
14
+ mag_to_flux_files : `str`
15
+ files of magnitude to flux
16
+ band : `str`
17
+ band considered
18
+ SNR : `float`
19
+ Signal-To-Noise Ratio cut
20
+ mag_range : `float`, `float`, optional
21
+ mag range considered
22
+ Default : (23., 27.5)
23
+ dt_range : `float`, `float`, optional
24
+ difference time range considered (cadence)
25
+ Default : (0.5, 25.)
26
+ """
27
+
28
+ def __init__(
29
+ self,
30
+ li_files,
31
+ mag_to_flux_files,
32
+ band,
33
+ SNR,
34
+ mag_range=(23.0, 27.5),
35
+ dt_range=(0.5, 25.0),
36
+ ):
37
+ self.band = band
38
+ self.SNR = SNR
39
+ self.lims = []
40
+ self.mag_to_flux = []
41
+ self.mag_range = mag_range
42
+ self.dt_range = dt_range
43
+
44
+ for val in li_files:
45
+ self.lims.append(self.get_lims(self.band, np.load(val), SNR))
46
+ for val in mag_to_flux_files:
47
+ self.mag_to_flux.append(np.load(val))
48
+ self.interp()
49
+
50
+ def get_lims(self, band, tab, SNR):
51
+ """
52
+ Estimations of the limits
53
+
54
+ Parameters
55
+ -------------
56
+ band : `str`
57
+ band to consider
58
+ tab : `np.ndarray`, (N,)
59
+ table of data
60
+ SNR : `float`
61
+ Signal-to-Noise Ratio cut
62
+
63
+ Returns
64
+ ---------
65
+ lims : `dict`
66
+ dict of limits with redshift and band as keys.
67
+
68
+ """
69
+
70
+ lims = {}
71
+
72
+ for z in np.unique(tab["z"]):
73
+ idx = (tab["z"] == z) & (tab["band"] == "LSST::" + band)
74
+ idx &= tab["flux_e"] > 0.0
75
+ sel = tab[idx]
76
+
77
+ if len(sel) > 0:
78
+ li2 = np.sqrt(np.sum(sel["flux_e"] ** 2))
79
+ lim = 5.0 * li2 / SNR
80
+ if z not in lims.keys():
81
+ lims[z] = {}
82
+ lims[z][band] = lim
83
+
84
+ return lims
85
+
86
+ def mesh(self, mag_to_flux):
87
+ """Mesh grid to estimate five-sigma depth values (m5) from mags input.
88
+
89
+ Parameters
90
+ -----------
91
+ mag_to_flux : `np.ndarray`, (N,2)
92
+ magnitude to flux values
93
+
94
+ Returns
95
+ -------
96
+ m5, Dt, metric : `np.ndarray`, np.ndarray`, `np.ndarray`
97
+ m5 values, time difference dt (cadence),
98
+ metric=sqrt(dt)*f5 where f5 is the 5-sigma flux
99
+
100
+ """
101
+ dt = np.linspace(self.dt_range[0], self.dt_range[1], 100)
102
+ m5 = np.linspace(self.mag_range[0], self.mag_range[1], 50)
103
+ ida = mag_to_flux["band"] == self.band
104
+ fa = interpolate.interp1d(mag_to_flux[ida]["m5"], mag_to_flux[ida]["flux_e"])
105
+ f5 = fa(m5)
106
+ f5, DT = np.meshgrid(f5, dt)
107
+ m5, DT = np.meshgrid(m5, dt)
108
+ metric = np.sqrt(DT) * f5
109
+
110
+ return m5, DT, metric
111
+
112
+ def interp(self):
113
+ """Estimate a grid of interpolated values in the plane
114
+ (m5, cadence, metric).
115
+ """
116
+
117
+ m5_all = []
118
+ dt_all = []
119
+ metric_all = []
120
+
121
+ for val in self.mag_to_flux:
122
+ m5, DT, metric = self.mesh(val)
123
+ m5_all.append(m5)
124
+ dt_all.append(DT)
125
+ metric_all.append(metric)
126
+
127
+ sorted_keys = []
128
+ for i in range(len(self.lims)):
129
+ sorted_keys.append(np.sort([k for k in self.lims[i].keys()])[::-1])
130
+ figa, axa = plt.subplots()
131
+
132
+ for kk, lim in enumerate(self.lims):
133
+ ll = [lim[zz][self.band] for zz in sorted_keys[kk]]
134
+ cs = axa.contour(m5_all[kk], dt_all[kk], metric_all[kk], ll)
135
+
136
+ points_values = None
137
+ for io, col in enumerate(cs.collections):
138
+ # Update in matplotlib changed get_segments to get_paths
139
+ if hasattr(col, "get_segments"):
140
+ segments = col.get_segments()
141
+ else:
142
+ segments = col.get_paths()
143
+ if segments:
144
+ segments = segments[0]
145
+ if hasattr(segments, "vertices"):
146
+ segments = segments.vertices
147
+ myarray = segments
148
+ res = np.array(myarray[:, 0], dtype=[("m5", "f8")])
149
+ res = rf.append_fields(res, "cadence", myarray[:, 1])
150
+ res = rf.append_fields(res, "z", [sorted_keys[kk][io]] * len(res))
151
+ if points_values is None:
152
+ points_values = res
153
+ else:
154
+ points_values = np.concatenate((points_values, res))
155
+ self.points_ref = points_values
156
+
157
+ plt.close(figa) # do not display
158
+
159
+ def interp_griddata(self, data):
160
+ """Estimate metric interpolation for data (m5,cadence)
161
+
162
+ Parameters
163
+ ----------
164
+ data : `np.ndarray`
165
+ data where interpolation has to be done (m5,cadence)
166
+
167
+ Returns
168
+ --------
169
+ res : `np.ndarray`
170
+ griddata interpolation (m5,cadence,metric)
171
+ """
172
+
173
+ ref_points = self.points_ref
174
+ res = interpolate.griddata(
175
+ (ref_points["m5"], ref_points["cadence"]),
176
+ ref_points["z"],
177
+ (data["m5_mean"], data["cadence_mean"]),
178
+ method="cubic",
179
+ )
180
+ return res
181
+
182
+
183
+ class GenerateFakeObservations:
184
+ """Class to generate Fake observations
185
+
186
+ Parameters
187
+ -----------
188
+ config: yaml-like
189
+ configuration file (parameter choice: filter, cadence, m5,Nseasons, ..)
190
+ list : `str`, optional
191
+ Name of the columns used.
192
+ Default : 'observationStartMJD', 'fieldRA', 'fieldDec','filter',
193
+ 'fiveSigmaDepth', 'visitExposureTime','numExposures',
194
+ 'visitTime','season'
195
+
196
+ Returns
197
+ ---------
198
+ observations : `np.ndarray`, (N, M)
199
+ recordarray of observations with the fields:
200
+ MJD, Ra, Dec, band,m5,Nexp, ExpTime, Season
201
+ """
202
+
203
+ def __init__(
204
+ self,
205
+ config,
206
+ mjd_col="observationStartMJD",
207
+ ra_col="fieldRA",
208
+ dec_col="fieldDec",
209
+ filter_col="filter",
210
+ m5_col="fiveSigmaDepth",
211
+ exptime_col="visitExposureTime",
212
+ nexp_col="numExposures",
213
+ season_col="season",
214
+ ):
215
+ self.mjd_col = mjd_col
216
+ self.m5_col = m5_col
217
+ self.filter_col = filter_col
218
+ self.ra_col = ra_col
219
+ self.dec_col = dec_col
220
+ self.exptime_col = exptime_col
221
+ self.season_col = season_col
222
+ self.nexp_col = nexp_col
223
+
224
+ # now make fake obs
225
+ self.make_fake(config)
226
+
227
+ def make_fake(self, config):
228
+ """Generate Fake observations
229
+
230
+ Parameters
231
+ -----------
232
+ config: yaml-like
233
+ configuration file (parameter choice: filter,
234
+ cadence, m5,Nseasons, ...)
235
+ """
236
+ bands = config["bands"]
237
+ cadence = dict(zip(bands, config["Cadence"]))
238
+ shift_days = dict(zip(bands, [config["shift_days"] * io for io in range(len(bands))]))
239
+ m5 = dict(zip(bands, config["m5"]))
240
+ nvisits = dict(zip(bands, config["nvisits"]))
241
+ exposure__time = dict(zip(bands, config["exposure__time"]))
242
+
243
+ ra = config["ra"]
244
+ dec = config["dec"]
245
+ rtot = []
246
+ # for season in range(1, config['nseasons']+1):
247
+ for il, season in enumerate(config["seasons"]):
248
+ # mjd_min = config['MJD_min'] + float(season-1)*inter_season_gap
249
+ mjd_min = config["MJD_min"][il]
250
+ mjd_max = mjd_min + config["season_length"]
251
+
252
+ for i, band in enumerate(bands):
253
+ mjd = np.arange(mjd_min, mjd_max + cadence[band], cadence[band])
254
+ mjd += shift_days[band]
255
+ m5_coadded = self.m5_coadd(m5[band], nvisits[band], exposure__time[band])
256
+ myarr = np.array(mjd, dtype=[(self.mjd_col, "f8")])
257
+ myarr = rf.append_fields(
258
+ myarr,
259
+ [self.ra_col, self.dec_col, self.filter_col],
260
+ [[ra] * len(myarr), [dec] * len(myarr), [band] * len(myarr)],
261
+ )
262
+ myarr = rf.append_fields(
263
+ myarr,
264
+ [self.m5_col, self.nexp_col, self.exptime_col, self.season_col],
265
+ [
266
+ [m5_coadded] * len(myarr),
267
+ [nvisits[band]] * len(myarr),
268
+ [nvisits[band] * exposure__time[band]] * len(myarr),
269
+ [season] * len(myarr),
270
+ ],
271
+ )
272
+ rtot.append(myarr)
273
+
274
+ res = np.copy(np.concatenate(rtot))
275
+ res.sort(order=self.mjd_col)
276
+
277
+ self.observations = res
278
+
279
+ def m5_coadd(self, m5, nvisits, tvisit):
280
+ """Coadded m5 estimation
281
+
282
+ Parameters
283
+ ----------
284
+ m5 : `list` [`float`]
285
+ list of five-sigma depth values
286
+ nvisits : `list` [`float`]
287
+ list of the number of visits
288
+ tvisit : `list` [`float`]
289
+ list of the visit times
290
+
291
+ Returns
292
+ ---------
293
+ m5_coadd : `list` [`float`]
294
+ list of m5 coadded values
295
+ """
296
+ m5_coadd = m5 + 1.25 * np.log10(float(nvisits) * tvisit / 30.0)
297
+ return m5_coadd
298
+
299
+
300
+ class ReferenceData:
301
+ """class to handle light curve of SN
302
+
303
+ Parameters
304
+ ------------
305
+ Li_files : `str`
306
+ light curve reference file
307
+ mag_to_flux_files : `str`
308
+ files of magnitude to flux
309
+ band : `str`
310
+ band considered
311
+ z : `float`
312
+ redshift considered
313
+ """
314
+
315
+ def __init__(self, li_files, mag_to_flux_files, band, z):
316
+ self.band = band
317
+ self.z = z
318
+ self.fluxes = []
319
+ self.mag_to_flux = []
320
+
321
+ for val in li_files:
322
+ self.fluxes.append(self.interp_fluxes(self.band, np.load(val), self.z))
323
+ for val in mag_to_flux_files:
324
+ self.mag_to_flux.append(self.interp_mag(self.band, np.load(val)))
325
+
326
+ def interp_fluxes(self, band, tab, z):
327
+ """Flux interpolator
328
+
329
+ Parameters
330
+ ---------------
331
+ band : `str`
332
+ band considered
333
+ tab : `np.ndarray`
334
+ reference data with (at least) fields z,band,time,DayMax
335
+ z : `float`
336
+ redshift considered
337
+
338
+ Returns
339
+ --------
340
+ fluxes : `list` [`float`]
341
+ list (float) of interpolated fluxes (in e/sec)
342
+ """
343
+ idx = (np.abs(tab["z"] - z) < 1.0e-5) & (tab["band"] == "LSST::" + band)
344
+ sel = tab[idx]
345
+ selc = np.copy(sel)
346
+ difftime = sel["time"] - sel["DayMax"]
347
+ selc = rf.append_fields(selc, "deltaT", difftime)
348
+ return interpolate.interp1d(selc["deltaT"], selc["flux_e"], bounds_error=False, fill_value=0.0)
349
+
350
+ def interp_mag(self, band, tab):
351
+ """magnitude (m5) to flux (e/sec) interpolator
352
+
353
+ Parameters
354
+ ---------------
355
+ band : `str`
356
+ band considered
357
+ tab : `np.ndarray`
358
+ reference data with (at least) fields band,m5,flux_e,
359
+ z : `float`
360
+ redshift considered
361
+
362
+ Returns
363
+ --------
364
+ mags : `list` [`float`]
365
+ list (float) of interpolated magnitudes (in e/sec)
366
+ """
367
+ idx = tab["band"] == band
368
+ sel = tab[idx]
369
+ return interpolate.interp1d(sel["m5"], sel["flux_e"], bounds_error=False, fill_value=0.0)
@@ -0,0 +1,197 @@
1
+ __all__ = ("stellar_mags",)
2
+
3
+ import numpy as np
4
+
5
+
6
+ def calc_wd_colors():
7
+ """
8
+ Calculate a few example WD colors. Values to go in stellar_mags().
9
+ Here in case values need to be regenerated
10
+ (different stars, bandpasses change, etc.)
11
+ """
12
+
13
+ try:
14
+ import os
15
+
16
+ from lsst.utils import getPackageDir
17
+
18
+ from rubin_sim.photUtils import Bandpass, Sed
19
+ except ImportError:
20
+ "Need to setup sims_photUtils to generate WD magnitudes."
21
+
22
+ names = ["HeWD_25200_80", "WD_11000_85", "WD_3000_85"]
23
+ fns = [
24
+ "bergeron_He_24000_80.dat_25200.gz",
25
+ "bergeron_10500_85.dat_11000.gz",
26
+ "bergeron_2750_85.dat_3000.gz",
27
+ ]
28
+ wd_dir = os.path.join(getPackageDir("sims_sed_library"), "starSED/wDs/")
29
+ files = [os.path.join(wd_dir, filename) for filename in fns]
30
+
31
+ # Read in the LSST bandpasses
32
+ bp_names = ["u", "g", "r", "i", "z", "y"]
33
+ bps = []
34
+ through_path = os.path.join(getPackageDir("throughputs"), "baseline")
35
+ for key in bp_names:
36
+ bp = np.loadtxt(
37
+ os.path.join(through_path, "filter_" + key + ".dat"),
38
+ dtype=list(zip(["wave", "trans"], [float] * 2)),
39
+ )
40
+ temp_b = Bandpass()
41
+ temp_b.setBandpass(bp["wave"], bp["trans"])
42
+ bps.append(temp_b)
43
+
44
+ # Read in the SEDs and compute mags
45
+ mags = []
46
+ for filename in files:
47
+ star = Sed()
48
+ star.readSED_flambda(filename)
49
+ single_mags = [star.calcMag(band) for band in bps]
50
+ mags.append([single_mags[i - 1] - single_mags[i] for i in range(1, 6)])
51
+
52
+ for maglist, fn, name in zip(mags, fns, names):
53
+ format = (name, fn) + tuple(maglist)
54
+ print("['%s', '%s', %f, %f, %f, %f, %f]" % format)
55
+
56
+
57
+ def stellar_mags(stellar_type, rmag=19.0):
58
+ """
59
+ Calculates the expected magnitudes in LSST filters for a
60
+ typical star of the given spectral type.
61
+
62
+ Based on mapping of Kuruz models to spectral types here:
63
+ http://www.stsci.edu/hst/observatory/crds/k93models.html
64
+
65
+
66
+ Parameters
67
+ ----------
68
+ stellar_type : str
69
+ Spectral type of a star (O,B,A,F,G,K,M), or for white dwarf colors,
70
+ one of 'HeWD_25200_80, 'WD_11000_85', 'WD_3000_85'
71
+ rmag : float
72
+ The expected r-band magnitude of the star.
73
+
74
+ Returns
75
+ -------
76
+ dict of floats
77
+ The expected magnitudes in LSST filters.
78
+ """
79
+
80
+ # If this is the first time running the function, set up the data array
81
+ if not hasattr(stellar_mags, "data"):
82
+ names = ["stellar_type", "Model Name", "u-g", "g-r", "r-i", "i-z", "z-y"]
83
+ types = [("U", 20), ("U", 35), float, float, float, float, float]
84
+ data = np.rec.fromrecords(
85
+ [
86
+ (
87
+ "O",
88
+ "kp00_50000[g50]",
89
+ -0.4835688497,
90
+ -0.5201721327,
91
+ -0.3991733698,
92
+ -0.3106800468,
93
+ -0.2072290744,
94
+ ),
95
+ (
96
+ "B",
97
+ "kp00_30000[g40]",
98
+ -0.3457202828,
99
+ -0.4834762052,
100
+ -0.3812792176,
101
+ -0.2906072887,
102
+ -0.1927230035,
103
+ ),
104
+ (
105
+ "A",
106
+ "kp00_9500[g40]",
107
+ 0.8823182684,
108
+ -0.237288029,
109
+ -0.2280783991,
110
+ -0.1587960264,
111
+ -0.03043824335,
112
+ ),
113
+ (
114
+ "F",
115
+ "kp00_7250[g45]",
116
+ 0.9140316091,
117
+ 0.1254277486,
118
+ -0.03419150003,
119
+ -0.0802010739,
120
+ -0.03802756413,
121
+ ),
122
+ (
123
+ "G",
124
+ "kp00_6000[g45]",
125
+ 1.198219095,
126
+ 0.3915608688,
127
+ 0.09129426676,
128
+ 0.002604263747,
129
+ -0.004659443668,
130
+ ),
131
+ (
132
+ "K",
133
+ "kp00_5250[g45]",
134
+ 1.716635024,
135
+ 0.6081567546,
136
+ 0.1796910856,
137
+ 0.06492278686,
138
+ 0.0425155827,
139
+ ),
140
+ (
141
+ "M",
142
+ "kp00_3750[g45]",
143
+ 2.747842719,
144
+ 1.287599638,
145
+ 0.5375622482,
146
+ 0.4313486709,
147
+ 0.219308065,
148
+ ),
149
+ (
150
+ "HeWD_25200_80",
151
+ "bergeron_He_24000_80.dat_25200.gz",
152
+ -0.218959,
153
+ -0.388374,
154
+ -0.326946,
155
+ -0.253573,
156
+ -0.239460,
157
+ ),
158
+ (
159
+ "WD_11000_85",
160
+ "bergeron_10500_85.dat_11000.gz",
161
+ 0.286146,
162
+ -0.109115,
163
+ -0.178500,
164
+ -0.185833,
165
+ -0.186913,
166
+ ),
167
+ (
168
+ "WD_3000_85",
169
+ "bergeron_2750_85.dat_3000.gz",
170
+ 3.170620,
171
+ 1.400062,
172
+ 0.167195,
173
+ 0.127024,
174
+ -0.378069,
175
+ ),
176
+ ],
177
+ dtype=list(zip(names, types)),
178
+ )
179
+ # Switch to a dict for faster look-up
180
+ stellar_mags.data = {}
181
+ for row in data:
182
+ stellar_mags.data["%s" % row["stellar_type"]] = row
183
+
184
+ results = {}
185
+ # good = np.where(stellar_mags.data['stellar_type'] == stellar_type)
186
+ if stellar_type not in stellar_mags.data:
187
+ message = "Received stellar_type %s" % stellar_type
188
+ message += " but expected one of %s" % ", ".join(stellar_mags.data.keys())
189
+ raise ValueError(message)
190
+
191
+ results["r"] = rmag
192
+ results["i"] = rmag - stellar_mags.data[stellar_type]["r-i"]
193
+ results["z"] = results["i"] - stellar_mags.data[stellar_type]["i-z"]
194
+ results["y"] = results["z"] - stellar_mags.data[stellar_type]["z-y"]
195
+ results["g"] = stellar_mags.data[stellar_type]["g-r"] + results["r"]
196
+ results["u"] = stellar_mags.data[stellar_type]["u-g"] + results["g"]
197
+ return results
@@ -0,0 +1,2 @@
1
+ from .maf_run_results import *
2
+ from .maf_tracking import *
Binary file