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,139 @@
1
+ __all__ = ("MafTracking",)
2
+
3
+ import os
4
+ from collections import OrderedDict
5
+
6
+ import numpy as np
7
+
8
+ from rubin_sim.maf.utils import get_sim_data
9
+
10
+ from .maf_run_results import MafRunResults
11
+
12
+
13
+ class MafTracking:
14
+ """Hold and serve the MAF tracking (sqlite) database content for
15
+ the show_maf web server.
16
+
17
+ Parameters
18
+ ----------
19
+ database : `str`, optional
20
+ Path to the sqlite tracking database file.
21
+ If None, looks for `trackingDb_sqlite.db` default file in the
22
+ current directory.
23
+ """
24
+
25
+ def __init__(self, database=None):
26
+ if database is None:
27
+ database = os.path.join(os.getcwd(), "trackingDb_sqlite.db")
28
+ self.tracking_db = database
29
+ self.stamp = os.stat(self.tracking_db).st_mtime
30
+
31
+ # Read in the tracking database.
32
+ cols = [
33
+ "maf_run_id",
34
+ "run_name",
35
+ "run_group",
36
+ "maf_comment",
37
+ "run_comment",
38
+ "db_file",
39
+ "maf_dir",
40
+ "run_version",
41
+ "run_date",
42
+ "maf_version",
43
+ "maf_date",
44
+ ]
45
+ self.runs = get_sim_data(self.tracking_db, "", cols, table_name="runs")
46
+ self.runs = self.sort_runs(self.runs, order=["maf_run_id", "run_name", "maf_comment"])
47
+ self.runs_page = {}
48
+
49
+ def _check_db(self):
50
+ """Check if the database file has changed"""
51
+ new_stamp = os.stat(self.tracking_db).st_mtime
52
+ if new_stamp != self.stamp:
53
+ self.__init__(database=self.tracking_db)
54
+
55
+ def run_info(self, run):
56
+ """Get the tracking database information relevant for a given run
57
+ in a format that the jinja2 templates for show_maf can use.
58
+
59
+ Parameters
60
+ ----------
61
+ run : `np.ndarray`, (1,)
62
+ One line from self.runs
63
+
64
+ Returns
65
+ -------
66
+ run_info : `OrderedDict`
67
+ Ordered dict version of the numpy structured array.
68
+ """
69
+ self._check_db()
70
+ runInfo = OrderedDict()
71
+ maf_dir = os.path.relpath(run["maf_dir"], start=os.path.dirname(self.tracking_db))
72
+ runInfo["Run Name"] = run["run_name"]
73
+ runInfo["Group"] = run["run_group"]
74
+ runInfo["Maf Comment"] = run["maf_comment"]
75
+ runInfo["Run Comment"] = run["run_comment"]
76
+ runInfo["RunDb File"] = [
77
+ os.path.relpath(run["db_file"]),
78
+ os.path.split(run["db_file"])[1],
79
+ ]
80
+ runInfo["ResultsDb"] = os.path.join(maf_dir, "resultsDb_sqlite.db")
81
+ runInfo["maf_dir"] = maf_dir
82
+ runInfo["sched_version"] = run["run_version"]
83
+ runInfo["sched_date"] = run["run_date"]
84
+ runInfo["maf_version"] = run["maf_version"]
85
+ runInfo["maf_date"] = run["maf_date"]
86
+ return runInfo
87
+
88
+ def sort_runs(self, runs, order=["run_name", "maf_comment", "maf_run_id"]):
89
+ """Sort the numpy array of run data.
90
+
91
+ Parameters
92
+ ----------
93
+ runs : `np.ndarray`, (N,)
94
+ The runs from self.runs to sort.
95
+ order : `list` [`str`]
96
+ The fields to use to sort the runs array.
97
+
98
+ Returns
99
+ -------
100
+ runs : `numpy.NDarray`
101
+ A sorted numpy array.
102
+ """
103
+ self._check_db()
104
+ return np.sort(runs, order=order)
105
+
106
+ def get_run(self, maf_run_id):
107
+ """Set up a mafRunResults object to read and handle the data
108
+ from a single individual run.
109
+ Caches the mafRunResults object, meaning the metric information from
110
+ a particular run is only read once from disk.
111
+
112
+ Parameters
113
+ ----------
114
+ maf_run_id : `int`
115
+ maf_run_id value in the tracking database
116
+ corresponding to a particular MAF run.
117
+
118
+ Returns
119
+ -------
120
+ runPage : `MafRunResults`
121
+ A MafRunResults object containing the information for this run.
122
+ Stored internally in self.runs_page dict, but also passed
123
+ back to the tornado server.
124
+ """
125
+ self._check_db()
126
+ if not isinstance(maf_run_id, int):
127
+ if isinstance(maf_run_id, dict):
128
+ maf_run_id = int(maf_run_id["maf_run_id"][0][0])
129
+ if isinstance(maf_run_id, list):
130
+ maf_run_id = int(maf_run_id[0])
131
+ if maf_run_id in self.runs_page:
132
+ return self.runs_page[maf_run_id]
133
+ match = self.runs["maf_run_id"] == maf_run_id
134
+ maf_dir = self.runs[match]["maf_dir"][0]
135
+ run_name = self.runs[match]["run_name"][0]
136
+ if run_name == "NULL":
137
+ run_name = None
138
+ self.runs_page[maf_run_id] = MafRunResults(maf_dir, run_name)
139
+ return self.runs_page[maf_run_id]
@@ -0,0 +1,496 @@
1
+ /*
2
+ SortTable
3
+ version 2
4
+ 7th April 2007
5
+ Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
6
+
7
+ Instructions:
8
+ Download this file
9
+ Add <script src="sorttable.js"></script> to your HTML
10
+ Add class="sortable" to any table you'd like to make sortable
11
+ Click on the headers to sort
12
+
13
+ Thanks to many, many people for contributions and suggestions.
14
+ Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
15
+ This basically means: do what you want with it.
16
+ */
17
+
18
+
19
+ var stIsIE = /*@cc_on!@*/false;
20
+
21
+ sorttable = {
22
+ init: function() {
23
+ // quit if this function has already been called
24
+ if (arguments.callee.done) return;
25
+ // flag this function so we don't do the same thing twice
26
+ arguments.callee.done = true;
27
+ // kill the timer
28
+ if (_timer) clearInterval(_timer);
29
+
30
+ if (!document.createElement || !document.getElementsByTagName) return;
31
+
32
+ sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
33
+
34
+ forEach(document.getElementsByTagName('table'), function(table) {
35
+ if (table.className.search(/\bsortable\b/) != -1) {
36
+ sorttable.makeSortable(table);
37
+ }
38
+ });
39
+
40
+ },
41
+
42
+ makeSortable: function(table) {
43
+ if (table.getElementsByTagName('thead').length == 0) {
44
+ // table doesn't have a tHead. Since it should have, create one and
45
+ // put the first table row in it.
46
+ the = document.createElement('thead');
47
+ the.appendChild(table.rows[0]);
48
+ table.insertBefore(the,table.firstChild);
49
+ }
50
+ // Safari doesn't support table.tHead, sigh
51
+ if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
52
+
53
+ if (table.tHead.rows.length != 1) return; // can't cope with two header rows
54
+
55
+ // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
56
+ // "total" rows, for example). This is B&R, since what you're supposed
57
+ // to do is put them in a tfoot. So, if there are sortbottom rows,
58
+ // for backwards compatibility, move them to tfoot (creating it if needed).
59
+ sortbottomrows = [];
60
+ for (var i=0; i<table.rows.length; i++) {
61
+ if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
62
+ sortbottomrows[sortbottomrows.length] = table.rows[i];
63
+ }
64
+ }
65
+ if (sortbottomrows) {
66
+ if (table.tFoot == null) {
67
+ // table doesn't have a tfoot. Create one.
68
+ tfo = document.createElement('tfoot');
69
+ table.appendChild(tfo);
70
+ }
71
+ for (var i=0; i<sortbottomrows.length; i++) {
72
+ tfo.appendChild(sortbottomrows[i]);
73
+ }
74
+ delete sortbottomrows;
75
+ }
76
+
77
+ // work through each column and calculate its type
78
+ headrow = table.tHead.rows[0].cells;
79
+ for (var i=0; i<headrow.length; i++) {
80
+ // manually override the type with a sorttable_type attribute
81
+ if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
82
+ mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
83
+ if (mtch) { override = mtch[1]; }
84
+ if (mtch && typeof sorttable["sort_"+override] == 'function') {
85
+ headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
86
+ } else {
87
+ headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
88
+ }
89
+ // make it clickable to sort
90
+ headrow[i].sorttable_columnindex = i;
91
+ headrow[i].sorttable_tbody = table.tBodies[0];
92
+ dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
93
+
94
+ if (this.className.search(/\bsorttable_sorted\b/) != -1) {
95
+ // if we're already sorted by this column, just
96
+ // reverse the table, which is quicker
97
+ sorttable.reverse(this.sorttable_tbody);
98
+ this.className = this.className.replace('sorttable_sorted',
99
+ 'sorttable_sorted_reverse');
100
+ this.removeChild(document.getElementById('sorttable_sortfwdind'));
101
+ sortrevind = document.createElement('span');
102
+ sortrevind.id = "sorttable_sortrevind";
103
+ sortrevind.innerHTML = stIsIE ? '&nbsp<font face="webdings">5</font>' : '&nbsp;&#x25B4;';
104
+ this.appendChild(sortrevind);
105
+ return;
106
+ }
107
+ if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
108
+ // if we're already sorted by this column in reverse, just
109
+ // re-reverse the table, which is quicker
110
+ sorttable.reverse(this.sorttable_tbody);
111
+ this.className = this.className.replace('sorttable_sorted_reverse',
112
+ 'sorttable_sorted');
113
+ this.removeChild(document.getElementById('sorttable_sortrevind'));
114
+ sortfwdind = document.createElement('span');
115
+ sortfwdind.id = "sorttable_sortfwdind";
116
+ sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
117
+ this.appendChild(sortfwdind);
118
+ return;
119
+ }
120
+
121
+ // remove sorttable_sorted classes
122
+ theadrow = this.parentNode;
123
+ forEach(theadrow.childNodes, function(cell) {
124
+ if (cell.nodeType == 1) { // an element
125
+ cell.className = cell.className.replace('sorttable_sorted_reverse','');
126
+ cell.className = cell.className.replace('sorttable_sorted','');
127
+ }
128
+ });
129
+ sortfwdind = document.getElementById('sorttable_sortfwdind');
130
+ if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
131
+ sortrevind = document.getElementById('sorttable_sortrevind');
132
+ if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
133
+
134
+ this.className += ' sorttable_sorted';
135
+ sortfwdind = document.createElement('span');
136
+ sortfwdind.id = "sorttable_sortfwdind";
137
+ sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
138
+ this.appendChild(sortfwdind);
139
+
140
+ // build an array to sort. This is a Schwartzian transform thing,
141
+ // i.e., we "decorate" each row with the actual sort key,
142
+ // sort based on the sort keys, and then put the rows back in order
143
+ // which is a lot faster because you only do getInnerText once per row
144
+ row_array = [];
145
+ col = this.sorttable_columnindex;
146
+ rows = this.sorttable_tbody.rows;
147
+ for (var j=0; j<rows.length; j++) {
148
+ row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
149
+ }
150
+ /* If you want a stable sort, uncomment the following line */
151
+ sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
152
+ /* and comment out this one */
153
+
154
+ /* row_array.sort(this.sorttable_sortfunction); */
155
+
156
+ tb = this.sorttable_tbody;
157
+ for (var j=0; j<row_array.length; j++) {
158
+ tb.appendChild(row_array[j][1]);
159
+ }
160
+
161
+ delete row_array;
162
+ });
163
+ }
164
+ }
165
+ },
166
+
167
+ guessType: function(table, column) {
168
+ // guess the type of a column based on its first non-blank row
169
+ sortfn = sorttable.sort_alpha;
170
+ for (var i=0; i<table.tBodies[0].rows.length; i++) {
171
+ text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
172
+ if (text != '') {
173
+ if (text.match(/^-?[�$�]?[\d,.]+%?$/)) {
174
+ return sorttable.sort_numeric;
175
+ }
176
+ // check for a date: dd/mm/yyyy or dd/mm/yy
177
+ // can have / or . or - as separator
178
+ // can be mm/dd as well
179
+ possdate = text.match(sorttable.DATE_RE)
180
+ if (possdate) {
181
+ // looks like a date
182
+ first = parseInt(possdate[1]);
183
+ second = parseInt(possdate[2]);
184
+ if (first > 12) {
185
+ // definitely dd/mm
186
+ return sorttable.sort_ddmm;
187
+ } else if (second > 12) {
188
+ return sorttable.sort_mmdd;
189
+ } else {
190
+ // looks like a date, but we can't tell which, so assume
191
+ // that it's mm/dd (American imperialism!) and keep looking
192
+ sortfn = sorttable.sort_mmdd;
193
+ }
194
+ }
195
+ }
196
+ }
197
+ return sortfn;
198
+ },
199
+
200
+ getInnerText: function(node) {
201
+ // gets the text we want to use for sorting for a cell.
202
+ // strips leading and trailing whitespace.
203
+ // this is *not* a generic getInnerText function; it's special to sorttable.
204
+ // for example, you can override the cell text with a customkey attribute.
205
+ // it also gets .value for <input> fields.
206
+
207
+ if (!node) return "";
208
+
209
+ hasInputs = (typeof node.getElementsByTagName == 'function') &&
210
+ node.getElementsByTagName('input').length;
211
+
212
+ if (node.getAttribute("sorttable_customkey") != null) {
213
+ return node.getAttribute("sorttable_customkey");
214
+ }
215
+ else if (typeof node.textContent != 'undefined' && !hasInputs) {
216
+ return node.textContent.replace(/^\s+|\s+$/g, '');
217
+ }
218
+ else if (typeof node.innerText != 'undefined' && !hasInputs) {
219
+ return node.innerText.replace(/^\s+|\s+$/g, '');
220
+ }
221
+ else if (typeof node.text != 'undefined' && !hasInputs) {
222
+ return node.text.replace(/^\s+|\s+$/g, '');
223
+ }
224
+ else {
225
+ switch (node.nodeType) {
226
+ case 3:
227
+ if (node.nodeName.toLowerCase() == 'input') {
228
+ return node.value.replace(/^\s+|\s+$/g, '');
229
+ }
230
+ case 4:
231
+ return node.nodeValue.replace(/^\s+|\s+$/g, '');
232
+ break;
233
+ case 1:
234
+ case 11:
235
+ var innerText = '';
236
+ for (var i = 0; i < node.childNodes.length; i++) {
237
+ innerText += sorttable.getInnerText(node.childNodes[i]);
238
+ }
239
+ return innerText.replace(/^\s+|\s+$/g, '');
240
+ break;
241
+ default:
242
+ return '';
243
+ }
244
+ }
245
+ },
246
+
247
+ reverse: function(tbody) {
248
+ // reverse the rows in a tbody
249
+ newrows = [];
250
+ for (var i=0; i<tbody.rows.length; i++) {
251
+ newrows[newrows.length] = tbody.rows[i];
252
+ }
253
+ for (var i=newrows.length-1; i>=0; i--) {
254
+ tbody.appendChild(newrows[i]);
255
+ }
256
+ delete newrows;
257
+ },
258
+
259
+ /* sort functions
260
+ each sort function takes two parameters, a and b
261
+ you are comparing a[0] and b[0] */
262
+ sort_numeric: function(a,b) {
263
+ aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
264
+ if (isNaN(aa)) aa = 0;
265
+ bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
266
+ if (isNaN(bb)) bb = 0;
267
+ return aa-bb;
268
+ },
269
+ sort_alpha: function(a,b) {
270
+ if (a[0]==b[0]) return 0;
271
+ if (a[0]<b[0]) return -1;
272
+ return 1;
273
+ },
274
+ sort_ddmm: function(a,b) {
275
+ mtch = a[0].match(sorttable.DATE_RE);
276
+ y = mtch[3]; m = mtch[2]; d = mtch[1];
277
+ if (m.length == 1) m = '0'+m;
278
+ if (d.length == 1) d = '0'+d;
279
+ dt1 = y+m+d;
280
+ mtch = b[0].match(sorttable.DATE_RE);
281
+ y = mtch[3]; m = mtch[2]; d = mtch[1];
282
+ if (m.length == 1) m = '0'+m;
283
+ if (d.length == 1) d = '0'+d;
284
+ dt2 = y+m+d;
285
+ if (dt1==dt2) return 0;
286
+ if (dt1<dt2) return -1;
287
+ return 1;
288
+ },
289
+ sort_mmdd: function(a,b) {
290
+ mtch = a[0].match(sorttable.DATE_RE);
291
+ y = mtch[3]; d = mtch[2]; m = mtch[1];
292
+ if (m.length == 1) m = '0'+m;
293
+ if (d.length == 1) d = '0'+d;
294
+ dt1 = y+m+d;
295
+ mtch = b[0].match(sorttable.DATE_RE);
296
+ y = mtch[3]; d = mtch[2]; m = mtch[1];
297
+ if (m.length == 1) m = '0'+m;
298
+ if (d.length == 1) d = '0'+d;
299
+ dt2 = y+m+d;
300
+ if (dt1==dt2) return 0;
301
+ if (dt1<dt2) return -1;
302
+ return 1;
303
+ },
304
+
305
+ shaker_sort: function(list, comp_func) {
306
+ // A stable sort function to allow multi-level sorting of data
307
+ // see: http://en.wikipedia.org/wiki/Cocktail_sort
308
+ // thanks to Joseph Nahmias
309
+ var b = 0;
310
+ var t = list.length - 1;
311
+ var swap = true;
312
+
313
+ while(swap) {
314
+ swap = false;
315
+ for(var i = b; i < t; ++i) {
316
+ if ( comp_func(list[i], list[i+1]) > 0 ) {
317
+ var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
318
+ swap = true;
319
+ }
320
+ } // for
321
+ t--;
322
+
323
+ if (!swap) break;
324
+
325
+ for(var i = t; i > b; --i) {
326
+ if ( comp_func(list[i], list[i-1]) < 0 ) {
327
+ var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
328
+ swap = true;
329
+ }
330
+ } // for
331
+ b++;
332
+
333
+ } // while(swap)
334
+ }
335
+ }
336
+
337
+ /* ******************************************************************
338
+ Supporting functions: bundled here to avoid depending on a library
339
+ ****************************************************************** */
340
+
341
+ // Dean Edwards/Matthias Miller/John Resig
342
+
343
+ /* for Mozilla/Opera9 */
344
+ if (document.addEventListener) {
345
+ document.addEventListener("DOMContentLoaded", sorttable.init, false);
346
+ }
347
+
348
+ /* for Internet Explorer */
349
+ /*@cc_on @*/
350
+ /*@if (@_win32)
351
+ document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
352
+ var script = document.getElementById("__ie_onload");
353
+ script.onreadystatechange = function() {
354
+ if (this.readyState == "complete") {
355
+ sorttable.init(); // call the onload handler
356
+ }
357
+ };
358
+ /*@end @*/
359
+
360
+ /* for Safari */
361
+ if (/WebKit/i.test(navigator.userAgent)) { // sniff
362
+ var _timer = setInterval(function() {
363
+ if (/loaded|complete/.test(document.readyState)) {
364
+ sorttable.init(); // call the onload handler
365
+ }
366
+ }, 10);
367
+ }
368
+
369
+ /* for other browsers */
370
+ window.onload = sorttable.init;
371
+
372
+ // written by Dean Edwards, 2005
373
+ // with input from Tino Zijdel, Matthias Miller, Diego Perini
374
+
375
+ // http://dean.edwards.name/weblog/2005/10/add-event/
376
+
377
+ function dean_addEvent(element, type, handler) {
378
+ if (element.addEventListener) {
379
+ element.addEventListener(type, handler, false);
380
+ } else {
381
+ // assign each event handler a unique ID
382
+ if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
383
+ // create a hash table of event types for the element
384
+ if (!element.events) element.events = {};
385
+ // create a hash table of event handlers for each element/event pair
386
+ var handlers = element.events[type];
387
+ if (!handlers) {
388
+ handlers = element.events[type] = {};
389
+ // store the existing event handler (if there is one)
390
+ if (element["on" + type]) {
391
+ handlers[0] = element["on" + type];
392
+ }
393
+ }
394
+ // store the event handler in the hash table
395
+ handlers[handler.$$guid] = handler;
396
+ // assign a global event handler to do all the work
397
+ element["on" + type] = handleEvent;
398
+ }
399
+ };
400
+ // a counter used to create unique IDs
401
+ dean_addEvent.guid = 1;
402
+
403
+ function removeEvent(element, type, handler) {
404
+ if (element.removeEventListener) {
405
+ element.removeEventListener(type, handler, false);
406
+ } else {
407
+ // delete the event handler from the hash table
408
+ if (element.events && element.events[type]) {
409
+ delete element.events[type][handler.$$guid];
410
+ }
411
+ }
412
+ };
413
+
414
+ function handleEvent(event) {
415
+ var returnValue = true;
416
+ // grab the event object (IE uses a global event object)
417
+ event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
418
+ // get a reference to the hash table of event handlers
419
+ var handlers = this.events[event.type];
420
+ // execute each event handler
421
+ for (var i in handlers) {
422
+ this.$$handleEvent = handlers[i];
423
+ if (this.$$handleEvent(event) === false) {
424
+ returnValue = false;
425
+ }
426
+ }
427
+ return returnValue;
428
+ };
429
+
430
+ function fixEvent(event) {
431
+ // add W3C standard event methods
432
+ event.preventDefault = fixEvent.preventDefault;
433
+ event.stopPropagation = fixEvent.stopPropagation;
434
+ return event;
435
+ };
436
+ fixEvent.preventDefault = function() {
437
+ this.returnValue = false;
438
+ };
439
+ fixEvent.stopPropagation = function() {
440
+ this.cancelBubble = true;
441
+ }
442
+
443
+ // Dean's forEach: http://dean.edwards.name/base/forEach.js
444
+ /*
445
+ forEach, version 1.0
446
+ Copyright 2006, Dean Edwards
447
+ License: http://www.opensource.org/licenses/mit-license.php
448
+ */
449
+
450
+ // array-like enumeration
451
+ if (!Array.forEach) { // mozilla already supports this
452
+ Array.forEach = function(array, block, context) {
453
+ for (var i = 0; i < array.length; i++) {
454
+ block.call(context, array[i], i, array);
455
+ }
456
+ };
457
+ }
458
+
459
+ // generic enumeration
460
+ Function.prototype.forEach = function(object, block, context) {
461
+ for (var key in object) {
462
+ if (typeof this.prototype[key] == "undefined") {
463
+ block.call(context, object[key], key, object);
464
+ }
465
+ }
466
+ };
467
+
468
+ // character enumeration
469
+ String.forEach = function(string, block, context) {
470
+ Array.forEach(string.split(""), function(chr, index) {
471
+ block.call(context, chr, index, string);
472
+ });
473
+ };
474
+
475
+ // globally resolve forEach enumeration
476
+ var forEach = function(object, block, context) {
477
+ if (object) {
478
+ var resolve = Object; // default
479
+ if (object instanceof Function) {
480
+ // functions have a "length" property
481
+ resolve = Function;
482
+ } else if (object.forEach instanceof Function) {
483
+ // the object implements a custom forEach method so use that
484
+ object.forEach(block, context);
485
+ return;
486
+ } else if (typeof object == "string") {
487
+ // the object is a string
488
+ resolve = String;
489
+ } else if (typeof object.length == "number") {
490
+ // the object is array-like
491
+ resolve = Array;
492
+ }
493
+ resolve.forEach(object, block, context);
494
+ }
495
+ };
496
+
@@ -0,0 +1,72 @@
1
+ {% extends "master.html" %}
2
+ {% import 'macros.html' as mcr %}
3
+
4
+ {% set active_page = "allMetricResults" %}
5
+
6
+ {% set run = runlist.get_run(runId) %}
7
+
8
+ {% set metrics = run.metrics %}
9
+
10
+ {% block moresidebar %}
11
+
12
+ <ul>
13
+ {% for g in run.groups.keys() %}
14
+ <li>
15
+ <a href="#{{ g|escape }}">{{ g|escape }}</a> </br>
16
+ {% for sg in run.groups[g] %}
17
+ <div id='smallindent'><a href="#{{g|escape}}_{{sg|escape}}">{{sg|escape}}</a></div>
18
+ {% endfor %}
19
+ </li>
20
+ {% endfor %}
21
+ </ul>
22
+ {% endblock %}
23
+
24
+
25
+ {% block content %}
26
+
27
+ {# Show all metric results, including summary stats in a table rather
28
+ than per metric. #}
29
+
30
+ {% set metricInfo = run.metric_info() %}
31
+
32
+ {% for g in run.groups.keys() %}
33
+ {% set groupstart = True %}
34
+ {% for sg in run.groups[g] %}
35
+ {% if groupstart == True %}
36
+ <a name = "{{g|escape}}" ></a>
37
+ {% set groupstart = False %}
38
+ {% endif %}
39
+ <p>
40
+ <a name = "{{g|escape}}_{{sg|escape}}"><i>Group: {{g|escape}}; Subgroup: {{sg|escape}}</i> </a>
41
+ </p>
42
+ {% set subsetMetrics = run.metrics_in_subgroup(g, sg) %}
43
+ <div id="metricset">
44
+ {% for metric in subsetMetrics %}
45
+ {% set metricInfo = run.metric_info(metric) %}
46
+ {% set metricPlots = run.plots_for_metric(metric) %}
47
+ {# Only show anything here for this metric if it had plots #}
48
+ {% if metricPlots|length > 0 %}
49
+ {# Print the metric info #}
50
+ {{ mcr.PrintMetricInfo(runId, metric, metricInfo) }}
51
+ {# Add the plots for this metric #}
52
+ {{ mcr.MakePlotTable(metricPlots, run) }}
53
+ <p>
54
+ {% set caption = run.caption_for_metric(metric) %}
55
+ {{ caption|escape }}
56
+ </p>
57
+ {% endif %}
58
+
59
+ {% endfor %}
60
+
61
+ {# Add a table with the summary stats for all the metrics in this subgroup #}
62
+
63
+ {% set statNames = run.all_stat_names(subsetMetrics) %}
64
+
65
+ {{ mcr.MakeStatTable(subsetMetrics, g, sg, run) }}
66
+
67
+ </div>
68
+
69
+ {% endfor %}
70
+ {% endfor %}
71
+
72
+ {% endblock %}