import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import healpy as hp
import rubin_sim.maf as maf
import rubin_sim
rubin_sim.version
<module 'rubin_sim.version' from '/Users/lynnej/lsst_repos/rubin_sim/rubin_sim/version.py'>
families = maf.archive.get_family_descriptions('runs_v2.2.json')
family_list = families.index.values
summary_source = 'summary_2022_11_16.csv'
summaries = maf.get_metric_summaries(summary_source=summary_source)
metrics_source = 'metric_sets.json'
metric_sets = maf.get_metric_sets(metrics_source)
# list the metric sets
msets = list(metric_sets.groupby('metric set').first().index)
fig, ax = maf.archive.describe_families(
families.loc[['draft v3'], :],
summary=summaries,
table_metric_set=metric_sets.loc["short description"],
plot_metric_set=metric_sets.loc["plot areas"],
baseline_run=families.loc['draft v3', "reference"],
)
ax.set_ylim(0.8, 1.2)
draft v3 : Draft versions of simulations incorporating the SCOC Phase 2 recommendations for survey strategy.
version: 2.99
runs:
brief | Area with >825 visits/pointing (fO_Area) | Unextincted area i>25.9 | Nvisits total | Median Nvis over top 18k (fO_Nv Med) | Median Nvis u band | Median Nvis g band | Median Nvis r band | Median Nvis i band | Median Nvis z band | Median Nvis y band | |
---|---|---|---|---|---|---|---|---|---|---|---|
run | |||||||||||
draft_connected_v2.99_10yrs | DDF at 7.5%, twilight NEO microsurvey, priority GP footprint. | 1953.04 | 16988.14 | 2076864.0 | 792.0 | 46.0 | 63.0 | 173.0 | 177.0 | 152.0 | 158.0 |
draft_v2.99_10yrs | Less connected, agg_level 1.5, galactic plane footprint. Otherwise like draft_connected. | 2112.50 | 16997.37 | 2076066.0 | 790.0 | 45.0 | 62.0 | 171.0 | 174.0 | 152.0 | 159.0 |
roll_early_v2.99_10yrs | Starting rolling early and increase suppress revisit weight. DDF at 7.5%, twilight NEO microsurvey, priority GP footprint. | 1945.48 | 16893.30 | 2077239.0 | 792.0 | 45.0 | 64.0 | 173.0 | 177.0 | 152.0 | 158.0 |
dd6_v2.99_10yrs | DDF at 5%, twilight NEO microsurvey, priority GP footprint. | 5309.37 | 17109.84 | 2077797.0 | 810.0 | 46.0 | 65.0 | 177.0 | 180.0 | 155.0 | 162.0 |
low_gp_v2.99_10yrs | DDF at 7.5%, twilight NEO microsurvey, priority GP footprint but low nvisits. | 8264.52 | 17135.02 | 2077254.0 | 822.0 | 47.0 | 65.0 | 177.0 | 181.0 | 158.0 | 164.0 |
more_z_v2.99_10yrs | Like draft_connected but swap u/z/y instead of just u/z. | 1371.41 | 16962.96 | 2075596.0 | 785.0 | 45.0 | 63.0 | 171.0 | 175.0 | 151.0 | 157.0 |
light_roll_v2.99_10yrs | Draft_connected footprint but full strength near-sun twilight microsurvey. Rolling flipped, roll strength 0.5, higher suppress revisits weight, more g in SCP/GP. | 650.45 | 16876.52 | 2082888.0 | 776.0 | 45.0 | 62.0 | 172.0 | 176.0 | 152.0 | 155.0 |
draft2_rw0.5_v2.99_10yrs | Draft connected footprint, rolling weight 0.5, downweighted GP, more g in SCP/GP, DDF 7%, rolling flipped + extra season at end, swap u/z/y, full strength near-sun twilight microsurvey. | 1545.14 | 17004.93 | 2082209.0 | 789.0 | 45.0 | 63.0 | 176.0 | 179.0 | 154.0 | 159.0 |
draft2_rw0.9_v2.99_10yrs | Draft connected footprint, rolling weight 0.9, downweighted GP, more g in SCP/GP, DDF 7%, rolling flipped + extra season at end, swap u/z/y, full strength near-sun twilight microsurvey. | 2368.49 | 16947.86 | 2085283.0 | 791.0 | 44.0 | 64.0 | 176.0 | 180.0 | 155.0 | 159.0 |
draft2_rw0.9_uz_v2.99_10yrs | Draft connected footprint, rolling weight 0.9, downweighted GP, more g in SCP/GP, DDF 7%, rolling flipped + extra season at end, swap ONLY u/z, full strength near-sun twilight microsurvey. | 2921.58 | 16896.66 | 2086079.0 | 795.0 | 44.0 | 63.0 | 178.0 | 182.0 | 154.0 | 160.0 |
(0.8, 1.2)
ddir = os.getenv("OPSIM_DB_DIR")
if ddir is None:
ddir = '/Users/lynnej/opsim'
draft_runs = list(families.explode('run').loc['draft v3', 'run'])
draft_runs
['draft_connected_v2.99_10yrs', 'draft_v2.99_10yrs', 'roll_early_v2.99_10yrs', 'dd6_v2.99_10yrs', 'low_gp_v2.99_10yrs', 'more_z_v2.99_10yrs', 'light_roll_v2.99_10yrs', 'draft2_rw0.5_v2.99_10yrs', 'draft2_rw0.9_v2.99_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']
opsdb = {}
t = families.explode(['run', 'filepath']).loc['draft v3', ['run', 'filepath']].set_index('run')
for r in draft_runs:
fpath = os.path.join(ddir, t.loc[r, 'filepath'])
if os.path.isfile(fpath):
opsdb[r] = fpath
else:
print(f'No file at {fpath}')
t = families.explode(['run', 'filepath']).loc['baseline', ['run', 'filepath']].set_index('run')
for r in ['baseline_v2.2_10yrs']:
fpath = os.path.join(ddir, t.loc[r, 'filepath'])
if os.path.isfile(fpath):
opsdb[r] = fpath
else:
print(f'No file at {fpath}')
outDir = 'draft_temp'
nside=64
bundles = {}
filterlist, colors, orders, sqls, info_labels = maf.filter_list(all=True)
recalculate = False
metric = maf.CountMetric(col='observationStartMJD', metric_name='Nvisits')
s = maf.HealpixSlicer(nside=nside)
for r in draft_runs:
bundles[r] = {}
for f in filterlist:
bundles[r][f] = maf.MetricBundle(metric, s, sqls[f], info_label=info_labels[f], run_name=r)
if recalculate:
g = maf.MetricBundleGroup(bundles[r], opsdb[r], out_dir=outDir)
g.run_all()
else:
for f in filterlist:
bundles[r][f].read(os.path.join(outDir, bundles[r][f].file_root + '.npz'))
for r in ['baseline_v2.0_10yrs', 'baseline_v2.2_10yrs']:
bundles[r] = {}
for f in filterlist:
bundles[r][f] = maf.MetricBundle(metric, s, sqls[f], info_label=info_labels[f], run_name=r)
if recalculate:
g = maf.MetricBundleGroup(bundles[r], opsdb[r], out_dir=outDir)
g.run_all()
else:
for f in filterlist:
bundles[r][f].read(os.path.join(outDir, bundles[r][f].file_root + '.npz'))
Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes
/Users/lynnej/lsst_repos/rubin_sim/rubin_sim/maf/slicers/base_slicer.py:412: FutureWarning: Reading pre-v1.0 metric data. To be deprecated in a future release. warnings.warn(
Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes
recalculate = False
s = maf.HealpixSlicer(nside=nside)
for r in ['draft2_rw0.9_uz_v2.99_10yrs']:
tmp = {}
for f in ['all']:
tmp[1] = maf.MetricBundle(metric, s, 'night >= 365*2.5 and night <=365.25 * 3.5',
info_label='year 3', run_name=r)
tmp[2] = maf.MetricBundle(metric, s, 'night >= 365*3.5 and night <=365.25 * 4.5',
info_label='year 4', run_name=r)
if recalculate:
g = maf.MetricBundleGroup(tmp, opsdb[r], out_dir=outDir)
g.run_all()
else:
tmp[1].read(os.path.join(outDir, tmp[1].file_root + '.npz'))
tmp[2].read(os.path.join(outDir, tmp[2].file_root + '.npz'))
Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes
ph = maf.PlotHandler(out_dir=outDir, thumbnail=False, fig_format='png')
for r in ['draft2_rw0.9_uz_v2.99_10yrs']:
plotDict={'color_min': 0, 'color_max':200, 'figsize': (8, 6),
'labelsize': 'x-large', 'fontsize':'x-large', 'xlabel': "Nvisits"}
ph.set_metric_bundles([tmp[1]])
ph.plot(maf.HealpixSkyMap(), plot_dicts=plotDict)
plt.figtext(0.50, 0.45, 'Low-dust\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.28, 0.65, 'NES', fontsize='x-large', fontweight='bold')
plt.figtext(0.71, 0.45, 'GP\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.67, 0.55, 'Dusty\n Plane', fontsize='x-large', fontweight='bold')
plt.figtext(0.52, 0.26, 'SCP', fontsize='x-large', fontweight='bold')
plt.figtext(0.36, 0.4, 'DDF', fontsize='x-large', fontweight='bold')
plt.title("Baseline v3 visits in Year 3", #f'{r}',
fontsize='xx-large', fontweight='normal')
plt.savefig('v3footprint_yr3.png')
ph.set_metric_bundles([tmp[2]])
ph.plot(maf.HealpixSkyMap(), plot_dicts=plotDict)
plt.figtext(0.50, 0.45, 'Low-dust\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.28, 0.65, 'NES', fontsize='x-large', fontweight='bold')
plt.figtext(0.71, 0.45, 'GP\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.67, 0.55, 'Dusty\n Plane', fontsize='x-large', fontweight='bold')
plt.figtext(0.52, 0.26, 'SCP', fontsize='x-large', fontweight='bold')
plt.figtext(0.36, 0.4, 'DDF', fontsize='x-large', fontweight='bold')
plt.title("Baseline v3 visits in Year 4", #f'{r}',
fontsize='xx-large', fontweight='normal')
plt.savefig('v3footprint_yr4.png')
ph = maf.PlotHandler(out_dir=outDir, thumbnail=False, fig_format='png')
for r in draft_runs:
plotDict = {'color_min': 0, 'color_max': 1000}
ph.set_metric_bundles([bundles[r]['all']])
ph.plot(maf.HealpixSkyMap(), plot_dicts=plotDict)
ph = maf.PlotHandler(out_dir=outDir, thumbnail=False, fig_format='png')
for r in ['draft2_rw0.9_uz_v2.99_10yrs']:
plotDict={'color_min': 0, 'color_max':1000, 'figsize': (8, 6),
'labelsize': 'x-large', 'fontsize':'x-large', 'xlabel': "Nvisits"}
ph.set_metric_bundles([bundles[r]['all']])
ph.plot(maf.HealpixSkyMap(), plot_dicts=plotDict)
plt.figtext(0.50, 0.45, 'Low-dust\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.28, 0.65, 'NES', fontsize='x-large', fontweight='bold')
plt.figtext(0.71, 0.45, 'GP\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.67, 0.55, 'Dusty\n Plane', fontsize='x-large', fontweight='bold')
plt.figtext(0.52, 0.26, 'SCP', fontsize='x-large', fontweight='bold')
plt.figtext(0.36, 0.4, 'DDF', fontsize='x-large', fontweight='bold')
plt.figtext(0.91, 0.685, "Virgo", fontsize='x-large', fontweight='bold')
plt.title("Baseline v3 footprint", #f'{r}',
fontsize='xx-large', fontweight='normal')
plt.savefig('v3footprint.png')
ph = maf.PlotHandler(out_dir=outDir, thumbnail=False, fig_format='png')
for r in ['baseline_v2.2_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']:
plotDict={'color_min': 0, 'color_max':1000, 'figsize': (8, 6), 'coord': 'CG', 'rot': (0, 0, 0),
'labelsize': 'x-large', 'fontsize':'x-large', 'xlabel': "Nvisits"}
ph.set_metric_bundles([bundles[r]['all']])
ph.plot(maf.HealpixSkyMap(), plot_dicts=plotDict)
plt.figtext(0.55, 0.76, 'Low-dust\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.05, 0.48, 'NES', fontsize='x-large', fontweight='bold')
plt.figtext(0.45, 0.53, 'GP\n WFD', fontsize='x-large', fontweight='bold')
plt.figtext(0.82, 0.53, 'Dusty\n Plane', fontsize='x-large', fontweight='bold')
plt.figtext(0.6, 0.42, 'SCP', fontsize='x-large', fontweight='bold')
plt.figtext(0.78, 0.36, 'DDF', fontsize='x-large', fontweight='bold')
plt.title(f'{r}', fontsize='xx-large', fontweight='normal')
# Area / Nvisits
draft_colors = dict(zip(draft_runs, ['b', 'k', 'r', 'g', '']))
draft_colors['baseline_v2.2_10yrs'] = 'm'
plotDicts = []
blist = []
for r in draft_runs + ['baseline_v2.2_10yrs']:
plotDicts.append({#'color': draft_colors[r],
'x_min': 0,
'bins':np.arange(0, 1100, 2),
'legend_loc': (1.0, 0.5),
'title': "Nvisits/area all bands"})
blist.append(bundles[r]['all'])
ph.set_metric_bundles(blist)
ph.plot(maf.HealpixHistogram(), plot_dicts=plotDicts, outfile_root='nvisits_area')
plotDicts = []
plotDicts = []
blist = []
for r in draft_runs + ['baseline_v2.2_10yrs']:
plotDicts.append({#'color': draft_colors[r],
'x)min': 0,
'cumulative': -1,
'bins':np.arange(0, 1100, 1),
'legend_loc': (1.0, 0.5),
'title': "Area with >X visits, all bands"})
blist.append(bundles[r]['all'])
ph.set_metric_bundles(blist)
ph.plot(maf.HealpixHistogram(), plot_dicts=plotDicts, outfile_root='nvisits_area_cumulative')
plt.axvline(750, color='k', linestyle=':', alpha=0.5)
plt.axvline(825, color='r', linestyle=':', alpha=0.5)
yscale = hp.nside2pixarea(s.nside, degrees=True) / 1000.0
plt.axhline(18/yscale, color='r', linestyle=':', alpha=0.5)
plt.axhline(15/yscale, color='k', linestyle=':', alpha=0.5)
<matplotlib.lines.Line2D at 0x1a64c9850>
from rubin_sim.scheduler.utils import SkyAreaGenerator, SkyAreaGeneratorGalplane
# Pull down target footprint information
# Originally from - but this works only with v<1.0 rubin_sim
rooturl = 'https://raw.githubusercontent.com/lsst-sims/sims_featureScheduler_runs3.0/main/draft/'
sky = SkyAreaGeneratorGalplane(nside=nside, smc_radius=4, lmc_radius=6)
footprints, labels = sky.return_maps(
bulge_ratios={"u": 0.23, "g": 0.43, "r": 1.22, "i": 1.17, "z": 0.82, "y": 0.65},
dusty_plane_ratios={
"u": 0.08,
"g": 0.12,
"r": 0.31,
"i": 0.31,
"z": 0.28,
"y": 0.22,
},
)
total_fp = np.zeros(len(footprints['r']))
for f in 'ugrizy':
total_fp += footprints[f]
#hp.mollview(total_fp)
np.unique(labels)
sky_v2 = SkyAreaGenerator(nside=nside)
footprints_v2, labels_v2 = sky_v2.return_maps()
# Count median visits per pointing in each of these regions within the footprint
# To swap to number of visits in a particular filter - change 'f'
f = 'all'
median_nvisits = {}
for r in draft_runs:
median_nvisits[r] = {}
for l in np.unique(labels):
if l == '':
continue
median_nvisits[r][l] = np.median(bundles[r][f].metric_values.filled(0)[np.where(labels == l)])
for r in ['baseline_v2.2_10yrs', 'baseline_v2.0_10yrs']:
median_nvisits[r] = {}
for l in np.unique(labels_v2):
if l == '':
continue
l_assign = l
if l == 'bulge':
l_assign = 'bulgy'
median_nvisits[r][l_assign] = np.median(bundles[r][f].metric_values.filled(0)[np.where(labels_v2 == l)])
pd.DataFrame(median_nvisits)[['baseline_v2.0_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']]
baseline_v2.0_10yrs | draft2_rw0.9_uz_v2.99_10yrs | |
---|---|---|
LMC_SMC | 837.0 | 793.0 |
bulgy | 852.0 | 783.0 |
dusty_plane | 259.0 | 257.0 |
lowdust | 837.0 | 812.0 |
nes | 242.0 | 195.0 |
scp | 175.5 | 123.0 |
virgo | 23.0 | 788.0 |
# Count median visits per pointing in each of these regions within the footprint per filter
median_nvisits = {}
for r in draft_runs:
median_nvisits[r] = {}
for l in np.unique(labels):
if l == '':
continue
for f in 'ugrizy':
median_nvisits[r][f'{l} {f}'] = np.median(bundles[r][f].metric_values.filled(0)[np.where(labels == l)])
for r in ['baseline_v2.2_10yrs', 'baseline_v2.0_10yrs']:
median_nvisits[r] = {}
for l in np.unique(labels_v2):
if l == '':
continue
l_assign = l
if l == 'bulge':
l_assign = 'bulgy'
for f in 'ugrizy':
median_nvisits[r][f'{l_assign} {f}'] = np.median(bundles[r][f].metric_values.filled(0)[np.where(labels_v2 == l)])
d = pd.DataFrame(median_nvisits)
#d / d.loc['lowdust r', 'draft_connected_v2.99_10yrs']
regions = [f'bulgy {f}' for f in 'ugrizy'] + [f'dusty_plane {f}' for f in 'ugrizy']
d.loc[regions,
['baseline_v2.0_10yrs', 'baseline_v2.2_10yrs', 'draft_connected_v2.99_10yrs',
'draft2_rw0.9_v2.99_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']]
d
draft_connected_v2.99_10yrs | draft_v2.99_10yrs | roll_early_v2.99_10yrs | dd6_v2.99_10yrs | low_gp_v2.99_10yrs | more_z_v2.99_10yrs | light_roll_v2.99_10yrs | draft2_rw0.5_v2.99_10yrs | draft2_rw0.9_v2.99_10yrs | draft2_rw0.9_uz_v2.99_10yrs | baseline_v2.2_10yrs | baseline_v2.0_10yrs | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
LMC_SMC u | 47.0 | 47.0 | 47.0 | 48.0 | 49.0 | 48.0 | 47.0 | 48.0 | 47.0 | 47.0 | 52.0 | 56.0 |
LMC_SMC g | 65.0 | 65.0 | 66.0 | 66.0 | 68.0 | 65.0 | 64.0 | 65.0 | 66.0 | 68.0 | 68.0 | 73.0 |
LMC_SMC r | 175.0 | 176.0 | 174.0 | 178.0 | 181.0 | 171.0 | 171.0 | 172.0 | 171.0 | 174.0 | 184.0 | 183.0 |
LMC_SMC i | 179.0 | 178.0 | 179.0 | 185.0 | 185.0 | 177.0 | 174.0 | 177.0 | 176.0 | 180.0 | 187.0 | 187.0 |
LMC_SMC z | 157.0 | 157.0 | 156.0 | 161.0 | 163.0 | 156.0 | 154.0 | 158.0 | 159.0 | 157.0 | 164.0 | 165.0 |
LMC_SMC y | 162.0 | 164.0 | 164.0 | 167.0 | 167.0 | 161.0 | 161.0 | 163.0 | 162.0 | 164.0 | 172.0 | 171.0 |
bulgy u | 36.0 | 23.0 | 36.0 | 36.0 | 22.0 | 36.0 | 33.0 | 31.0 | 29.0 | 30.0 | 33.0 | 34.0 |
bulgy g | 72.0 | 44.0 | 74.0 | 74.5 | 38.0 | 73.0 | 102.0 | 97.0 | 96.0 | 98.0 | 186.0 | 187.0 |
bulgy r | 220.0 | 135.0 | 219.0 | 226.0 | 115.0 | 217.0 | 214.0 | 209.0 | 208.0 | 209.0 | 196.0 | 194.0 |
bulgy i | 215.0 | 137.0 | 215.0 | 220.0 | 113.0 | 213.0 | 199.0 | 196.0 | 196.0 | 196.0 | 200.0 | 203.0 |
bulgy z | 145.0 | 91.0 | 146.0 | 149.0 | 75.0 | 144.0 | 144.0 | 141.0 | 140.0 | 139.0 | 183.0 | 182.0 |
bulgy y | 120.0 | 77.5 | 120.0 | 123.0 | 66.0 | 120.0 | 108.0 | 107.0 | 106.0 | 106.0 | 53.0 | 49.0 |
dusty_plane u | 17.0 | 17.0 | 17.0 | 17.0 | 17.0 | 17.0 | 17.0 | 16.0 | 14.0 | 15.0 | 20.0 | 22.0 |
dusty_plane g | 24.0 | 25.0 | 24.0 | 25.0 | 24.0 | 24.0 | 29.0 | 27.0 | 27.0 | 27.0 | 48.0 | 47.0 |
dusty_plane r | 62.0 | 68.0 | 62.0 | 63.0 | 62.0 | 60.0 | 65.0 | 60.0 | 61.0 | 61.0 | 54.0 | 54.0 |
dusty_plane i | 65.0 | 71.0 | 67.0 | 68.0 | 67.0 | 65.0 | 68.0 | 65.0 | 66.0 | 66.0 | 57.0 | 58.0 |
dusty_plane z | 51.0 | 54.0 | 53.0 | 53.0 | 52.0 | 52.0 | 53.0 | 50.0 | 49.0 | 50.0 | 52.0 | 49.0 |
dusty_plane y | 51.0 | 52.0 | 50.0 | 51.0 | 50.0 | 50.0 | 48.0 | 45.0 | 46.0 | 46.0 | 31.0 | 30.0 |
lowdust u | 48.0 | 47.0 | 47.0 | 48.0 | 50.0 | 47.0 | 47.0 | 47.0 | 46.0 | 47.0 | 50.0 | 56.0 |
lowdust g | 66.0 | 66.0 | 67.0 | 68.0 | 70.0 | 66.0 | 65.0 | 66.0 | 66.0 | 66.0 | 70.0 | 73.0 |
lowdust r | 178.0 | 178.0 | 177.0 | 182.0 | 185.0 | 176.0 | 178.0 | 181.0 | 181.0 | 184.0 | 183.0 | 183.0 |
lowdust i | 181.0 | 181.0 | 181.0 | 185.0 | 189.0 | 179.0 | 181.0 | 184.0 | 186.0 | 188.0 | 187.0 | 186.0 |
lowdust z | 158.0 | 158.0 | 158.0 | 162.0 | 164.0 | 157.0 | 158.0 | 161.0 | 161.0 | 160.0 | 165.0 | 166.0 |
lowdust y | 163.0 | 164.0 | 163.0 | 167.0 | 170.0 | 162.0 | 160.0 | 164.0 | 165.0 | 166.0 | 172.0 | 172.0 |
nes u | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
nes g | 36.0 | 42.0 | 35.0 | 37.0 | 37.0 | 35.0 | 36.0 | 35.0 | 34.0 | 34.0 | 46.0 | 47.0 |
nes r | 58.0 | 69.0 | 56.0 | 58.0 | 60.0 | 56.0 | 59.0 | 59.0 | 57.0 | 59.0 | 68.0 | 71.0 |
nes i | 62.0 | 73.0 | 62.0 | 63.0 | 64.0 | 61.0 | 63.0 | 62.0 | 62.0 | 64.0 | 74.0 | 74.0 |
nes z | 38.0 | 45.0 | 37.0 | 39.0 | 40.0 | 39.0 | 40.0 | 40.0 | 39.0 | 38.0 | 48.0 | 46.0 |
nes y | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
scp u | 17.0 | 16.0 | 16.0 | 17.0 | 18.0 | 17.0 | 16.0 | 16.0 | 14.0 | 15.0 | 19.0 | 20.5 |
scp g | 16.0 | 17.0 | 16.0 | 17.0 | 18.0 | 17.0 | 21.0 | 21.0 | 20.0 | 21.0 | 17.0 | 28.0 |
scp r | 20.0 | 24.0 | 20.0 | 20.0 | 21.0 | 20.0 | 20.0 | 19.0 | 19.0 | 19.0 | 22.0 | 34.0 |
scp i | 23.0 | 25.0 | 24.0 | 23.0 | 25.0 | 23.0 | 27.0 | 28.0 | 27.0 | 27.0 | 24.0 | 34.0 |
scp z | 22.0 | 22.0 | 21.0 | 23.0 | 23.0 | 21.0 | 22.0 | 21.0 | 22.0 | 21.0 | 22.0 | 32.0 |
scp y | 26.0 | 29.0 | 27.0 | 27.0 | 28.0 | 27.0 | 21.0 | 22.0 | 20.0 | 22.0 | 30.0 | 27.0 |
virgo u | 44.0 | 45.0 | 46.0 | 46.0 | 47.0 | 45.0 | 43.0 | 44.0 | 42.0 | 44.0 | 48.0 | 1.0 |
virgo g | 63.0 | 64.0 | 65.0 | 65.0 | 67.0 | 62.0 | 62.0 | 61.0 | 62.0 | 62.0 | 65.0 | 2.0 |
virgo r | 170.0 | 173.0 | 171.0 | 177.0 | 177.0 | 168.0 | 179.0 | 182.0 | 173.0 | 177.0 | 177.0 | 5.0 |
virgo i | 176.0 | 176.0 | 174.0 | 180.0 | 181.0 | 175.0 | 185.0 | 181.0 | 186.0 | 186.0 | 184.0 | 6.0 |
virgo z | 154.0 | 155.0 | 152.0 | 158.0 | 163.0 | 152.0 | 158.0 | 163.0 | 162.0 | 156.0 | 162.0 | 4.0 |
virgo y | 156.0 | 157.0 | 159.0 | 164.0 | 170.0 | 152.0 | 155.0 | 160.0 | 157.0 | 158.0 | 163.0 | 6.0 |
# Count fraction of survey visits in various parts of the sky
bundles2 = {}
recalculate = False
for r in draft_runs:
bundles2[r] = {}
for l in np.unique(labels):
if l == '':
continue
footprint = np.where(labels == l, 1, 0)
bdict = maf.nvisitsPerSubset(runName=r, constraint=None, footprintConstraint=footprint,
extraInfoLabel= l)
k = list(bdict.keys())[0]
bundles2[r][l] = bdict[k]
if recalculate:
g = maf.MetricBundleGroup(bundles2[r], opsdb[r], out_dir=outDir)
g.runAll()
else:
for l in bundles2[r]:
bundles2[r][l].read(os.path.join(outDir, bundles2[r][l].file_root + ".npz"))
for r in ['baseline_v2.2_10yrs', 'baseline_v2.0_10yrs']:
bundles2[r] = {}
for l in np.unique(labels_v2):
if l == '':
continue
footprint = np.where(labels_v2 == l, 1, 0)
bdict = maf.nvisitsPerSubset(runName=r, constraint=None, footprintConstraint=footprint,
extraInfoLabel= l)
k = list(bdict.keys())[0]
bundles2[r][l] = bdict[k]
if recalculate:
g = maf.MetricBundleGroup(bundles2[r], opsdb[r], out_dir=outDir)
g.runAll()
else:
for l in bundles2[r]:
bundles2[r][l].read(os.path.join(outDir, bundles2[r][l].file_root + ".npz"))
/Users/lynnej/lsst_repos/rubin_sim/rubin_sim/maf/slicers/base_slicer.py:412: FutureWarning: Reading pre-v1.0 metric data. To be deprecated in a future release. warnings.warn(
bundles2['draft_connected_v2.99_10yrs']['LMC_SMC'].metric_values[0]
33601.0
# Fractions of visits in different footprint regions.
visit_fractions = {}
for r in bundles2:
visit_fractions[r] = {}
for l in bundles2[r]:
l_assign = l
if l == 'bulge':
l_assign = 'bulgy'
visit_fractions[r][l_assign] = bundles2[r][l].metric_values[0]
visit_fractions[r]['DDF'] = summaries.loc[r, 'Nvisits DDF']
d = pd.DataFrame(visit_fractions)/summaries.loc[list(bundles2.keys()), 'Nvisits All visits'] * 100
d.round(2)[['baseline_v2.0_10yrs', 'baseline_v2.2_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']]
baseline_v2.0_10yrs | baseline_v2.2_10yrs | draft2_rw0.9_uz_v2.99_10yrs | |
---|---|---|---|
LMC_SMC | 2.22 | 2.21 | 1.63 |
bulgy | 4.14 | 4.15 | 6.62 |
dusty_plane | 6.92 | 6.94 | 6.29 |
lowdust | 77.67 | 77.26 | 75.69 |
nes | 4.62 | 4.54 | 3.86 |
scp | 1.11 | 0.93 | 0.91 |
virgo | 0.09 | 0.39 | 0.37 |
DDF | 4.52 | 5.01 | 6.37 |
# Fraction in GP region together
d.loc['bulgy'] + d.loc['dusty_plane']
draft_connected_v2.99_10yrs 13.371217 draft_v2.99_10yrs 10.837998 roll_early_v2.99_10yrs 13.404187 dd6_v2.99_10yrs 13.683724 low_gp_v2.99_10yrs 9.791629 more_z_v2.99_10yrs 13.269297 light_roll_v2.99_10yrs 13.345173 draft2_rw0.5_v2.99_10yrs 12.925360 draft2_rw0.9_v2.99_10yrs 12.844060 draft2_rw0.9_uz_v2.99_10yrs 12.911975 baseline_v2.2_10yrs 11.095845 baseline_v2.0_10yrs 11.057701 dtype: float64
# Count the visits taken for particular special survey reasons, or in the WFD region (total WFD)
import sqlite3
t = families.explode(['run', 'filepath']).loc['draft v3', ['run', 'filepath']].set_index('run')
specials = ['twilight_neo', 'long']
count = {}
for r in draft_runs:
print(r)
count[r] = {}
conn = sqlite3.connect(opsdb[r])
cursor = conn.cursor()
for s in specials:
query = f'select count(*) from observations where note like "%{s}%"'
results = cursor.execute(query).fetchall()
count[r][s] = int(results[0][0])
conn.close()
pd.concat([pd.DataFrame(count),
summaries.loc[draft_runs, ['Nvisits DDF', 'Nvisits WFD', 'Nvisits All visits']].T])
draft_connected_v2.99_10yrs draft_v2.99_10yrs roll_early_v2.99_10yrs dd6_v2.99_10yrs low_gp_v2.99_10yrs more_z_v2.99_10yrs light_roll_v2.99_10yrs draft2_rw0.5_v2.99_10yrs draft2_rw0.9_v2.99_10yrs draft2_rw0.9_uz_v2.99_10yrs
draft_connected_v2.99_10yrs | draft_v2.99_10yrs | roll_early_v2.99_10yrs | dd6_v2.99_10yrs | low_gp_v2.99_10yrs | more_z_v2.99_10yrs | light_roll_v2.99_10yrs | draft2_rw0.5_v2.99_10yrs | draft2_rw0.9_v2.99_10yrs | draft2_rw0.9_uz_v2.99_10yrs | |
---|---|---|---|---|---|---|---|---|---|---|
twilight_neo | 18861.0 | 17963.0 | 18529.0 | 18591.0 | 18182.0 | 17745.0 | 42860.0 | 43976.0 | 44169.0 | 45835.0 |
long | 90116.0 | 87051.0 | 90075.0 | 94084.0 | 90276.0 | 90344.0 | 90392.0 | 91210.0 | 91262.0 | 92049.0 |
Nvisits DDF | 150590.0 | 181128.0 | 150689.0 | 107076.0 | 150535.0 | 165288.0 | 165357.0 | 144973.0 | 144947.0 | 132976.0 |
Nvisits WFD | 1662976.0 | 1579449.0 | 1664976.0 | 1712919.0 | 1611317.0 | 1644212.0 | 1609163.0 | 1644937.0 | 1643727.0 | 1660059.0 |
Nvisits All visits | 2076864.0 | 2076066.0 | 2077239.0 | 2077797.0 | 2077254.0 | 2075596.0 | 2082888.0 | 2082209.0 | 2085283.0 | 2086079.0 |
families.explode(['run', 'brief']).loc['baseline'][['run', 'brief']]
run | brief | |
---|---|---|
family | ||
baseline | baseline_v3.0_10yrs | V3 baseline simulation. This is the same as dr... |
baseline | baseline_v2.2_10yrs | v2.2 baseline (prescheduled DDFs) |
baseline | baseline_v2.1_10yrs | v2.1 baseline (+Virgo, good seeing) |
baseline | baseline_v2.0_10yrs | v2.0 baseline |
baseline | baseline_retrofoot_v2.0_10yrs | v1.x footprint but new code capabilities |
baseline | retro_baseline_v2.0_10yrs | v1.x baseline with rubin_sim (without new code... |
rr = ['retro_baseline_v2.0_10yrs', 'baseline_v2.0_10yrs', 'baseline_v2.2_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']
s = summaries.loc[rr, metric_sets.loc['SRD']['metric']]
d = maf.normalize_metric_summaries('retro_baseline_v2.0_10yrs', s, metric_sets=metric_sets.loc['SRD'])
d
metric | fONv MedianNvis fO All sky HealpixSlicer | Median Parallax Uncert (18k) Parallax Uncert @ 22.4 All sky HealpixSlicer | Median Parallax Uncert (18k) Parallax Uncert @ 24.0 All sky HealpixSlicer | Median Proper Motion Uncert (18k) Proper Motion Uncert @ 20.5 All sky HealpixSlicer | Median Proper Motion Uncert (18k) Proper Motion Uncert @ 24.0 All sky HealpixSlicer |
---|---|---|---|---|---|
run | |||||
retro_baseline_v2.0_10yrs | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
baseline_v2.0_10yrs | 0.989387 | 0.953111 | 0.948440 | 0.967560 | 0.936190 |
baseline_v2.2_10yrs | 0.978774 | 1.018414 | 1.029846 | 0.987997 | 1.000693 |
draft2_rw0.9_uz_v2.99_10yrs | 0.937500 | 0.970989 | 0.972561 | 0.943833 | 0.933036 |
# Comparisons of metrics
baseline_run = 'baseline_v2.0_10yrs'
these_runs = ['baseline_v2.0_10yrs',
'baseline_v2.1_10yrs', 'baseline_v2.2_10yrs'] + draft_runs
# We can plot them all together, but need to remove duplicates
non_dd = [m for m in msets if 'DD' not in m]
msub = metric_sets.loc[non_dd].reset_index(drop=True).drop('style', axis=1).drop('short_name', axis=1)
msub = msub.drop_duplicates().set_index('metric', drop=False, verify_integrity=True)
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
#metric_label_map=msub['short_name'],
metric_set=msub,
color_range=1)
fig.set_figwidth(24)
fig.set_figheight(60)
msub = metric_sets.loc['SCOC']
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=1)
ax.axvline(3, color='k', alpha=0.3)
fig.set_figwidth(15)
fig.set_figheight(10)
# Very basic metrics
baseline_run = 'baseline_v2.2_10yrs' #'draft_connected_v2.99_10yrs'
msub = metric_sets.loc[['SRD', 'WFD Depths']].reset_index('metric set')
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
msub = metric_sets.loc['SRD']
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, msub['metric']],
baseline_run=baseline_run,
metric_set=msub,
horizontal_quantity='run',
vertical_quantity='value')
msub = metric_sets.loc['WFD Depths']
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, msub['metric']],
baseline_run=baseline_run,
metric_set=msub,
horizontal_quantity='run',
vertical_quantity='value')
msub = metric_sets.loc['WFD Depths'].query('metric.str.contains("fiveSigma")')
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, msub['metric']],
baseline_run=baseline_run,
metric_set=msub,
horizontal_quantity='run',
vertical_quantity='value')
msubm = list(metric_sets.loc['WFD Depths'].query('metric.str.contains("NVisits")',
engine='python')['metric'].values)
msubm.append('Median NVisits WFD all bands HealpixSubsetSlicer')
def func(x):
return x.replace(' HealpixSubsetSlicer', '')
summaries.loc[draft_runs, msubm].rename(mapper=func, axis=1).T
run | draft_connected_v2.99_10yrs | draft_v2.99_10yrs | roll_early_v2.99_10yrs | dd6_v2.99_10yrs | low_gp_v2.99_10yrs | more_z_v2.99_10yrs | light_roll_v2.99_10yrs | draft2_rw0.5_v2.99_10yrs | draft2_rw0.9_v2.99_10yrs | draft2_rw0.9_uz_v2.99_10yrs |
---|---|---|---|---|---|---|---|---|---|---|
metric | ||||||||||
Median NVisits WFD u band | 48.0 | 47.0 | 47.0 | 48.0 | 50.0 | 47.0 | 47.0 | 47.0 | 46.0 | 47.0 |
Median NVisits WFD g band | 67.0 | 67.0 | 67.0 | 68.0 | 70.0 | 67.0 | 66.0 | 67.0 | 67.0 | 67.0 |
Median NVisits WFD r band | 180.0 | 179.0 | 179.0 | 183.0 | 185.0 | 178.0 | 180.0 | 182.0 | 183.0 | 185.0 |
Median NVisits WFD i band | 183.0 | 182.0 | 183.0 | 187.0 | 189.0 | 182.0 | 183.0 | 186.0 | 187.0 | 190.0 |
Median NVisits WFD z band | 158.0 | 159.0 | 158.0 | 161.0 | 165.0 | 157.0 | 159.0 | 161.0 | 162.0 | 161.0 |
Median NVisits WFD y band | 163.0 | 165.0 | 163.0 | 166.0 | 170.0 | 162.0 | 161.0 | 164.0 | 165.0 | 166.0 |
Median NVisits WFD all bands | 799.0 | 798.0 | 798.0 | 815.0 | 828.0 | 794.0 | 797.0 | 806.0 | 809.0 | 813.0 |
msubm = metric_sets.loc['WFD Depths'].query('metric.str.contains("CoaddM5")',
engine='python')
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, msubm['metric']],
baseline_run=baseline_run,
metric_set=msubm,
metric_label_map=msubm['short_name'],
horizontal_quantity='run',
vertical_quantity='value')
# Stars and Galaxy counts metrics
k_sets = ['Stars', 'galaxies']
for k in k_sets:
msub = metric_sets.loc[k]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value',
shade_fraction=0.1)
fig.set_figwidth(15)
ylim = list(ax.get_ylim())
ax.set_ylim(max(0.2, ylim[0]), min(2, ylim[1]))
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
# DESC metrics
k_sets = [k for k in msets if k.startswith('DESC') and not k.endswith('DDF')]
for k in k_sets:
msub = metric_sets.loc[k]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value')
fig.set_figwidth(15)
#ax.set_ylim(0.5, 1.5)
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
# sso metrics
k_sets = ['SSO discovery', 'SSO lightcurve inversion']
msub = metric_sets.loc[k_sets].reset_index('metric set')
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs, msub['metric']],
baseline_run=baseline_run,
#metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
for k in k_sets:
print(k)
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value')
fig.set_figwidth(15)
#ax.set_ylim(0.5, 1.5)
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
SSO discovery SSO lightcurve inversion
m = 'Sum PrestoKNe__presto_color_detect UserPointsSlicer'
mall = [m for m in summaries if 'Presto' in m and 'Median' not in m]
summaries.loc[these_runs,mall]/summaries.loc[these_runs, [m]].values
metric | Sum PrestoKNe__presto_color_detect UserPointsSlicer | Sum PrestoKNe__scoreP UserPointsSlicer | Sum PrestoKNe__scoreS UserPointsSlicer |
---|---|---|---|
run | |||
baseline_v2.0_10yrs | 1.0 | 0.531712 | 0.395960 |
baseline_v2.1_10yrs | 1.0 | 0.525245 | 0.418103 |
baseline_v2.2_10yrs | 1.0 | 0.503999 | 0.392931 |
draft_connected_v2.99_10yrs | 1.0 | 0.506875 | 0.392544 |
draft_v2.99_10yrs | 1.0 | 0.524647 | 0.415888 |
roll_early_v2.99_10yrs | 1.0 | 0.523858 | 0.451111 |
dd6_v2.99_10yrs | 1.0 | 0.564329 | 0.458427 |
low_gp_v2.99_10yrs | 1.0 | 0.548305 | 0.445396 |
more_z_v2.99_10yrs | 1.0 | 0.544022 | 0.447115 |
light_roll_v2.99_10yrs | 1.0 | 0.448813 | 0.352941 |
draft2_rw0.5_v2.99_10yrs | 1.0 | 0.463821 | 0.394678 |
draft2_rw0.9_v2.99_10yrs | 1.0 | 0.452767 | 0.372998 |
draft2_rw0.9_uz_v2.99_10yrs | 1.0 | 0.504258 | 0.441501 |
# TVS metrics
k_sets = [k for k in msets if k.startswith('TVS') and (k.endswith('short') or ('Tgaps' in k) or ('anomalies' in k)) ]
for k in k_sets:
msub = metric_sets.loc[k]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value',
shade_fraction=0.1)
fig.set_figwidth(15)
ylim = list(ax.get_ylim())
ax.set_ylim(max(0.2, ylim[0]), min(3, ylim[1]))
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
k = 'AGN short'
# AGN metrics
k_sets = ['AGN short']
msub = metric_sets.loc[k_sets].reset_index('metric set')
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
for k in k_sets:
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value',
shade_fraction=0)
ylims = ax.get_ylim()
ax.set_ylim(max(0.2, ylims[0]), min(2, ylims[1]))
fig.set_figwidth(15)
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
# StrongLensing metrics
k_sets = [k for k in msets if k.startswith('SL')]
msub = metric_sets.loc[k_sets].reset_index('metric set')
# Add the strong lensed supernova metric
msub = pd.concat([msub,
metric_sets.loc['DESC WFD'].query('metric.str.contains("SNSL")', engine='python')])
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
for k in k_sets:
msub = metric_sets.loc[k]
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, msub['metric']],
baseline_run=baseline_run,
metric_set=msub,
metric_label_map=msub['short_name'],
horizontal_quantity='run',
vertical_quantity='value')
fig.set_figwidth(15)
#ax.set_ylim(0.5, 1.5)
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
# GP footprint metrics
k_sets = [k for k in msets if k.startswith('GP') and 'filter' not in k]
for k in k_sets:
msub = metric_sets.loc[k]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs,msub['metric']],
baseline_run=baseline_run,
metric_label_map=msub['short_name'],
metric_set=msub,
color_range=0.5)
fig.set_figwidth(15)
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, metric_sets.loc[k]['metric']],
baseline_run=baseline_run,
metric_set=metric_sets.loc[k],
metric_label_map=metric_sets.loc[k]['short_name'],
horizontal_quantity='run',
vertical_quantity='value')
fig.set_figwidth(15)
#ax.set_ylim(0.5, 1.5)
lgd = plt.legend(loc=(1.01, 0.0), fancybox=True, numpoints=1, fontsize='medium')
Some of the trades above are due to DDF increases in time and adding the twilight NEO microsurvey, so let's check those benefits. (there are also trades due to changing the intranight cadence with triplets, but those should be reflected in the other metrics above, and likewise for the galactic plane footprint).
# microsurvey - vatira
micro_discovery = [m for m in summaries if 'Vatira' in m and '1 quad in 1 night' in m ]
micro_discovery += [m for m in summaries if "PHA" in m and '1 quad in 1 night' in m and 'Nobj' not in m]
fig, ax = maf.plot_run_metric(summaries.loc[these_runs, micro_discovery].dropna(),
baseline_run='baseline_v2.2_10yrs',
linestyles=['-'],
markers=[''],
horizontal_quantity='run',
vertical_quantity='value')
# DDF -- compare to v2.2 as this was the first version with pre-scheduled DDFs
# (v2.0/v2.1 are "non-prescheduled")
# Fraction of visits in DDFs
these_runs = ['baseline_v2.0_10yrs', 'baseline_v2.1_10yrs', 'baseline_v2.2_10yrs'] + draft_runs
pd.DataFrame(summaries.loc[these_runs, 'Nvisits DDF']/summaries.loc[these_runs, 'Nvisits All visits'],
columns=['Fraction DDF']).round(3)
Fraction DDF | |
---|---|
run | |
baseline_v2.0_10yrs | 0.045 |
baseline_v2.1_10yrs | 0.045 |
baseline_v2.2_10yrs | 0.050 |
draft_connected_v2.99_10yrs | 0.073 |
draft_v2.99_10yrs | 0.087 |
roll_early_v2.99_10yrs | 0.073 |
dd6_v2.99_10yrs | 0.052 |
low_gp_v2.99_10yrs | 0.072 |
more_z_v2.99_10yrs | 0.080 |
light_roll_v2.99_10yrs | 0.079 |
draft2_rw0.5_v2.99_10yrs | 0.070 |
draft2_rw0.9_v2.99_10yrs | 0.070 |
draft2_rw0.9_uz_v2.99_10yrs | 0.064 |
baseline = 'baseline_v2.2_10yrs'
these_runs = ['baseline_v2.0_10yrs', 'baseline_v2.1_10yrs', 'baseline_v2.2_10yrs'] + draft_runs
for m in ['DDF Depths', 'DDF Cadence']:
metrics = metric_sets.loc[m]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs, metrics['metric']],
baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
color_range=1)
fig.set_figwidth(20)
fig.set_figheight(12)
msubm = metric_sets.loc['DDF Cadence'].query('metric.str.contains("Inter-Night")')
summaries.loc[these_runs, msubm['metric']]
metric | Mean DD:ELAISS1 Median Inter-Night Gap u band UserPointsSlicer | Mean DD:ELAISS1 Median Inter-Night Gap g band UserPointsSlicer | Mean DD:ELAISS1 Median Inter-Night Gap r band UserPointsSlicer | Mean DD:ELAISS1 Median Inter-Night Gap i band UserPointsSlicer | Mean DD:ELAISS1 Median Inter-Night Gap z band UserPointsSlicer | Mean DD:ELAISS1 Median Inter-Night Gap y band UserPointsSlicer | Mean DD:XMM_LSS Median Inter-Night Gap u band UserPointsSlicer | Mean DD:XMM_LSS Median Inter-Night Gap g band UserPointsSlicer | Mean DD:XMM_LSS Median Inter-Night Gap r band UserPointsSlicer | Mean DD:XMM_LSS Median Inter-Night Gap i band UserPointsSlicer | ... | Mean DD:EDFS Median Inter-Night Gap r band UserPointsSlicer | Mean DD:EDFS Median Inter-Night Gap i band UserPointsSlicer | Mean DD:EDFS Median Inter-Night Gap z band UserPointsSlicer | Mean DD:EDFS Median Inter-Night Gap y band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap u band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap g band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap r band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap i band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap z band UserPointsSlicer | Mean DD:WFD Median Inter-Night Gap y band UserPointsSlicer |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
run | |||||||||||||||||||||
baseline_v2.0_10yrs | 3.000622 | 2.982181 | 2.979590 | 2.979589 | 24.940272 | 2.983836 | 2.982749 | 2.992879 | 2.991340 | 2.983401 | ... | 3.955857 | 4.480980 | 31.939816 | 3.990780 | 26.704517 | 20.924252 | 5.879806 | 7.211764 | 8.129445 | 19.314549 |
baseline_v2.1_10yrs | 3.960647 | 2.991370 | 2.997909 | 2.984199 | 20.043378 | 2.993568 | 3.018786 | 3.978624 | 3.986188 | 3.080698 | ... | 3.973718 | 3.973123 | 29.455027 | 3.976269 | 24.434070 | 20.787144 | 6.855045 | 7.370982 | 8.066323 | 14.880234 |
baseline_v2.2_10yrs | 25.763470 | 8.996258 | 8.976109 | 8.982109 | 16.651533 | 8.957424 | 25.001728 | 8.975515 | 8.971518 | 8.971518 | ... | 8.931479 | 8.940015 | 16.520146 | 8.943705 | 21.903958 | 19.975326 | 5.528899 | 7.300853 | 7.518991 | 13.426797 |
draft_connected_v2.99_10yrs | 21.965891 | 7.788870 | 7.769368 | 7.780970 | 13.900069 | 7.772177 | 22.806873 | 7.970165 | 7.152416 | 7.950335 | ... | 7.137793 | 7.151093 | 13.984842 | 7.147999 | 23.424837 | 24.943913 | 5.930708 | 6.986769 | 7.983244 | 12.045625 |
draft_v2.99_10yrs | 18.828872 | 5.987152 | 5.981491 | 5.981892 | 8.887227 | 5.965963 | 21.901029 | 5.996286 | 5.986104 | 5.992085 | ... | 5.890328 | 5.901035 | 6.695727 | 5.900271 | 24.939648 | 21.109552 | 5.008872 | 7.977146 | 8.972138 | 15.862684 |
roll_early_v2.99_10yrs | 21.966948 | 7.803122 | 7.789126 | 7.809702 | 12.932698 | 7.769287 | 22.860319 | 7.970541 | 7.143079 | 7.927617 | ... | 7.153793 | 7.158248 | 13.877624 | 7.147844 | 24.884603 | 16.854503 | 6.027494 | 6.733435 | 7.986332 | 13.034799 |
dd6_v2.99_10yrs | 25.001588 | 9.001489 | 8.995575 | 8.997300 | 16.112292 | 8.999978 | 25.767572 | 8.975256 | 8.969402 | 8.971276 | ... | 8.797932 | 8.824703 | 16.000548 | 8.832839 | 22.899410 | 23.877785 | 6.935360 | 6.021458 | 7.924008 | 10.393284 |
low_gp_v2.99_10yrs | 21.966951 | 7.802977 | 7.785121 | 7.801196 | 12.932866 | 7.755392 | 22.743936 | 7.949669 | 7.138505 | 7.927509 | ... | 7.142914 | 7.162457 | 13.858301 | 7.132945 | 22.070228 | 22.042074 | 6.961067 | 8.061400 | 8.065987 | 11.111852 |
more_z_v2.99_10yrs | 21.944247 | 7.774592 | 7.710855 | 7.771647 | 7.934185 | 7.882990 | 22.870880 | 7.949174 | 7.138114 | 7.926920 | ... | 7.148129 | 7.163464 | 7.901884 | 7.813518 | 26.912498 | 20.917322 | 6.970137 | 7.801016 | 7.985169 | 13.057259 |
light_roll_v2.99_10yrs | 21.943694 | 7.778281 | 7.758113 | 7.771251 | 7.936153 | 7.917743 | 21.989013 | 7.931222 | 7.141975 | 7.808284 | ... | 7.128453 | 7.142838 | 7.893313 | 7.811045 | 19.319881 | 23.693347 | 6.962938 | 6.976893 | 10.926771 | 13.991426 |
draft2_rw0.5_v2.99_10yrs | 21.948692 | 7.787408 | 7.773822 | 7.783241 | 7.940527 | 7.944497 | 22.755114 | 7.838254 | 7.138017 | 7.911715 | ... | 7.153243 | 7.158520 | 7.900474 | 7.817405 | 22.927683 | 21.037993 | 9.592980 | 8.874410 | 9.011204 | 15.910838 |
draft2_rw0.9_v2.99_10yrs | 21.945290 | 7.793823 | 7.752854 | 7.789656 | 7.934361 | 7.920136 | 21.987050 | 7.812126 | 7.135220 | 7.789029 | ... | 7.137621 | 7.151063 | 7.878763 | 7.811819 | 24.701794 | 22.998526 | 5.996528 | 5.998988 | 8.975582 | 12.033114 |
draft2_rw0.9_uz_v2.99_10yrs | 21.987895 | 7.871278 | 7.812795 | 7.877678 | 11.959911 | 7.806387 | 21.987542 | 7.812278 | 7.112872 | 7.788615 | ... | 7.156879 | 7.165931 | 13.993614 | 7.157510 | 21.464688 | 18.861385 | 5.965913 | 6.078415 | 7.943913 | 10.921724 |
13 rows × 36 columns
for m in ['AGN TimeLag 100 days DDF', 'AGN TimeLag 5 days DDF',
'AGN SF DDF']:
metrics = metric_sets.loc[m]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs, metrics['metric']],
baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
color_range=1)
fig.set_figwidth(20)
fig.set_figheight(12)
m = 'SNIa DDF'
these_runs = ['baseline_v2.0_10yrs', 'baseline_v2.1_10yrs', 'baseline_v2.2_10yrs'] + draft_runs
metrics = metric_sets.loc[m]
# the SN summary values default to -1.6e30 for 'bad values' but this screws up normalization, so replace.
t = summaries.loc[these_runs, metrics['metric']].copy()
t[t < 0] = 1e-30
# the SNIa metric reports 0 SN in many of the DDFs in the standard baselines,
# which makes this plot hard to interpret when normalized
metrics = metric_sets.loc[m]
fig, ax = maf.plot_run_metric_mesh(t,
baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
color_range=1)
fig.set_figwidth(20)
fig.set_figheight(12)
metrics = metric_sets.loc[m].query('metric.str.contains("Sum")', engine='python')
t = summaries.loc[these_runs, metrics['metric']].copy()
t[t < 0] = np.nan
fig, ax = maf.plot_run_metric_mesh(t.loc[these_runs, metrics['metric']],
#baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
cmap='cet_coolwarm_r',
color_range=[0, 100])
fig.set_figwidth(20)
fig.set_figheight(3)
metrics = metric_sets.loc[m].query('metric.str.contains("zlim")', engine='python')
t = summaries.loc[these_runs, metrics['metric']].copy()
t[t < 0] = np.nan
fig, ax = maf.plot_run_metric_mesh(t.loc[these_runs, metrics['metric']],
#baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
cmap='cet_coolwarm_r',
color_range=[0.5, 0.65])
fig.set_figwidth(20)
fig.set_figheight(3)
metrics = pd.concat([metric_sets.loc[m].query('metric.str.contains("Sum")', engine='python'),
metric_sets.loc[m].query('metric.str.contains("zlim")', engine='python')])
t = summaries.loc[these_runs, metrics['metric']].copy().round(2)
t
metric | Sum SNNSNMetric DD:ELAISS1_nSN DD:ELAISS1 all bands HealpixSubsetSlicer | Sum SNNSNMetric DD:XMM_LSS_nSN DD:XMM_LSS all bands HealpixSubsetSlicer | Sum SNNSNMetric DD:COSMOS_nSN DD:COSMOS all bands HealpixSubsetSlicer | Sum SNNSNMetric DD:ECDFS_nSN DD:ECDFS all bands HealpixSubsetSlicer | Sum SNNSNMetric DD:EDFS_nSN DD:EDFS all bands HealpixSubsetSlicer | Sum SNNSNMetric DD:WFD_nSN DD:WFD all bands HealpixSubsetSlicer | Median SNNSNMetric DD:ELAISS1_zlim DD:ELAISS1 all bands HealpixSubsetSlicer | Median SNNSNMetric DD:XMM_LSS_zlim DD:XMM_LSS all bands HealpixSubsetSlicer | Median SNNSNMetric DD:COSMOS_zlim DD:COSMOS all bands HealpixSubsetSlicer | Median SNNSNMetric DD:ECDFS_zlim DD:ECDFS all bands HealpixSubsetSlicer | Median SNNSNMetric DD:EDFS_zlim DD:EDFS all bands HealpixSubsetSlicer | Median SNNSNMetric DD:WFD_zlim DD:WFD all bands HealpixSubsetSlicer |
---|---|---|---|---|---|---|---|---|---|---|---|---|
run | ||||||||||||
baseline_v2.0_10yrs | 8.144000e+01 | -1.637500e+30 | 47.33 | 5.22 | -1.637500e+30 | 63.57 | 5.900000e-01 | -1.637500e+30 | 0.60 | 0.54 | -1.637500e+30 | 0.27 |
baseline_v2.1_10yrs | 4.021000e+01 | -1.637500e+30 | 21.90 | 2.59 | -1.637500e+30 | 64.24 | 5.900000e-01 | -1.637500e+30 | 0.59 | 0.55 | -1.637500e+30 | 0.28 |
baseline_v2.2_10yrs | 3.750000e+00 | -1.637500e+30 | 13.65 | 6.88 | -1.637500e+30 | 81.81 | 6.000000e-01 | -1.637500e+30 | 0.51 | 0.58 | -1.637500e+30 | 0.29 |
draft_connected_v2.99_10yrs | 3.430000e+01 | 6.330000e+01 | 497.97 | 73.08 | 8.074000e+01 | 73.45 | 5.500000e-01 | 5.400000e-01 | 0.60 | 0.58 | 5.300000e-01 | 0.30 |
draft_v2.99_10yrs | 2.975100e+02 | 2.870600e+02 | 598.43 | 406.50 | 6.645900e+02 | 60.07 | 5.900000e-01 | 5.700000e-01 | 0.60 | 0.59 | 5.400000e-01 | 0.29 |
roll_early_v2.99_10yrs | 4.118000e+01 | 6.145000e+01 | 497.31 | 75.26 | 9.451000e+01 | 90.20 | 5.500000e-01 | 5.400000e-01 | 0.60 | 0.58 | 5.200000e-01 | 0.30 |
dd6_v2.99_10yrs | -1.637500e+30 | 1.050000e+00 | 252.62 | 12.36 | -1.637500e+30 | 69.20 | -1.637500e+30 | 5.400000e-01 | 0.59 | 0.55 | -1.637500e+30 | 0.29 |
low_gp_v2.99_10yrs | 4.157000e+01 | 6.221000e+01 | 497.51 | 70.15 | 7.852000e+01 | 74.15 | 5.500000e-01 | 5.400000e-01 | 0.60 | 0.57 | 5.300000e-01 | 0.29 |
more_z_v2.99_10yrs | 2.027600e+02 | 2.121500e+02 | 564.50 | 274.69 | 4.855300e+02 | 66.16 | 5.800000e-01 | 5.600000e-01 | 0.60 | 0.59 | 5.300000e-01 | 0.30 |
light_roll_v2.99_10yrs | 1.974100e+02 | 2.149500e+02 | 568.99 | 271.89 | 4.858800e+02 | 77.91 | 5.700000e-01 | 5.700000e-01 | 0.60 | 0.59 | 5.300000e-01 | 0.28 |
draft2_rw0.5_v2.99_10yrs | 1.917000e+02 | 2.006700e+02 | 512.53 | 263.07 | 4.582900e+02 | 81.50 | 5.700000e-01 | 5.600000e-01 | 0.59 | 0.59 | 5.200000e-01 | 0.29 |
draft2_rw0.9_v2.99_10yrs | 1.980300e+02 | 2.021300e+02 | 513.47 | 263.14 | 4.598600e+02 | 86.11 | 5.700000e-01 | 5.600000e-01 | 0.59 | 0.59 | 5.200000e-01 | 0.31 |
draft2_rw0.9_uz_v2.99_10yrs | 3.738000e+01 | 6.036000e+01 | 362.73 | 72.38 | 7.473000e+01 | 73.65 | 5.500000e-01 | 5.400000e-01 | 0.59 | 0.58 | 5.300000e-01 | 0.29 |
# The strong lensed SN are just very rare, so they show slight changes here but the actual values are likely
# equivalent
for m in ['SNSL DDF']:
metrics = metric_sets.loc[m]
fig, ax = maf.plot_run_metric_mesh(summaries.loc[these_runs, metrics['metric']],
baseline_run=baseline,
metric_label_map=metrics['short_name'],
metric_set=metrics,
color_range=1)
fig.set_figwidth(20)
fig.set_figheight(12)
summaries.loc[these_runs, metric_sets.loc['SNSL DDF']['metric']]
metric | Sum SNSLMetric DD:ELAISS1 all bands HealpixSubsetSlicer | Sum SNSLMetric DD:XMM_LSS all bands HealpixSubsetSlicer | Sum SNSLMetric DD:COSMOS all bands HealpixSubsetSlicer | Sum SNSLMetric DD:ECDFS all bands HealpixSubsetSlicer | Sum SNSLMetric DD:EDFS all bands HealpixSubsetSlicer | Sum SNSLMetric DD:WFD all bands HealpixSubsetSlicer |
---|---|---|---|---|---|---|
run | ||||||
baseline_v2.0_10yrs | 0.015108 | 0.014272 | 0.014076 | 0.014287 | 0.023664 | 0.008779 |
baseline_v2.1_10yrs | 0.013812 | 0.013001 | 0.012324 | 0.013522 | 0.024114 | 0.009340 |
baseline_v2.2_10yrs | 0.013993 | 0.014243 | 0.014460 | 0.014000 | 0.027733 | 0.011644 |
draft_connected_v2.99_10yrs | 0.013139 | 0.013669 | 0.018334 | 0.013325 | 0.025336 | 0.010677 |
draft_v2.99_10yrs | 0.015371 | 0.015259 | 0.018222 | 0.015407 | 0.027099 | 0.008598 |
roll_early_v2.99_10yrs | 0.014772 | 0.014703 | 0.018517 | 0.013550 | 0.027485 | 0.009803 |
dd6_v2.99_10yrs | 0.013549 | 0.012668 | 0.013877 | 0.012821 | 0.026534 | 0.009501 |
low_gp_v2.99_10yrs | 0.014230 | 0.013412 | 0.018918 | 0.013692 | 0.026091 | 0.009753 |
more_z_v2.99_10yrs | 0.014692 | 0.014479 | 0.019207 | 0.014351 | 0.028084 | 0.009205 |
light_roll_v2.99_10yrs | 0.017193 | 0.016170 | 0.020104 | 0.015637 | 0.029767 | 0.011516 |
draft2_rw0.5_v2.99_10yrs | 0.017311 | 0.016584 | 0.019574 | 0.016635 | 0.030602 | 0.011919 |
draft2_rw0.9_v2.99_10yrs | 0.015660 | 0.015657 | 0.019336 | 0.015015 | 0.029635 | 0.009793 |
draft2_rw0.9_uz_v2.99_10yrs | 0.014580 | 0.014764 | 0.018057 | NaN | 0.028781 | 0.010548 |
summaries.loc[these_runs,
['fONv MedianNvis fO HealpixSlicer', 'fONv MinNvis fO HealpixSlicer',
'fOArea_750 fO All sky HealpixSlicer', 'fOArea fO HealpixSlicer']]
metric | fONv MedianNvis fO HealpixSlicer | fONv MinNvis fO HealpixSlicer | fOArea_750 fO All sky HealpixSlicer | fOArea fO HealpixSlicer |
---|---|---|---|---|
run | ||||
baseline_v2.0_10yrs | 839.0 | 787.0 | 18620.568813 | 12893.228978 |
baseline_v2.1_10yrs | 838.0 | 784.0 | 18676.801487 | 12434.135354 |
baseline_v2.2_10yrs | 830.0 | 779.0 | 18627.283162 | 10569.224874 |
draft_connected_v2.99_10yrs | 792.0 | 748.0 | 17912.204976 | 1953.036312 |
draft_v2.99_10yrs | 790.0 | 729.0 | 16988.142673 | 2112.502105 |
roll_early_v2.99_10yrs | 792.0 | 750.0 | 18028.866793 | 1945.482670 |
dd6_v2.99_10yrs | 810.0 | 766.0 | 18816.963526 | 5309.371600 |
low_gp_v2.99_10yrs | 822.0 | 667.0 | 17626.005843 | 8264.524524 |
more_z_v2.99_10yrs | 785.0 | 742.0 | 17199.644671 | 1371.405816 |
light_roll_v2.99_10yrs | 776.0 | 735.0 | 16148.009734 | 650.452575 |
draft2_rw0.5_v2.99_10yrs | 789.0 | 745.0 | 17630.202311 | 1545.139601 |
draft2_rw0.9_v2.99_10yrs | 791.0 | 744.0 | 17490.040273 | 2368.486667 |
draft2_rw0.9_uz_v2.99_10yrs | 795.0 | 747.0 | 17809.811151 | 2921.581179 |
summaries.loc[these_runs, metric_sets.loc['SRD']['metric']]
metric | fONv MedianNvis fO All sky HealpixSlicer | Median Parallax Uncert (18k) Parallax Uncert @ 22.4 All sky HealpixSlicer | Median Parallax Uncert (18k) Parallax Uncert @ 24.0 All sky HealpixSlicer | Median Proper Motion Uncert (18k) Proper Motion Uncert @ 20.5 All sky HealpixSlicer | Median Proper Motion Uncert (18k) Proper Motion Uncert @ 24.0 All sky HealpixSlicer |
---|---|---|---|---|---|
run | |||||
baseline_v2.0_10yrs | 839.0 | 2.423048 | 9.831244 | 0.190588 | 2.344119 |
baseline_v2.1_10yrs | 838.0 | 2.329280 | 9.328171 | 0.188435 | 2.217359 |
baseline_v2.2_10yrs | 830.0 | 2.267676 | 9.054113 | 0.186646 | 2.193021 |
draft_connected_v2.99_10yrs | 792.0 | 2.372297 | 9.544178 | 0.190292 | 2.258448 |
draft_v2.99_10yrs | 790.0 | 2.463777 | 9.950573 | 0.191643 | 2.307288 |
roll_early_v2.99_10yrs | 792.0 | 2.384471 | 9.622518 | 0.192004 | 2.286203 |
dd6_v2.99_10yrs | 810.0 | 2.327868 | 9.372435 | 0.189157 | 2.244878 |
low_gp_v2.99_10yrs | 822.0 | 2.388575 | 9.579722 | 0.187611 | 2.216556 |
more_z_v2.99_10yrs | 785.0 | 2.380450 | 9.552361 | 0.191277 | 2.264694 |
light_roll_v2.99_10yrs | 776.0 | 2.357950 | 9.453709 | 0.191315 | 2.252909 |
draft2_rw0.5_v2.99_10yrs | 789.0 | 2.349369 | 9.435768 | 0.192852 | 2.278560 |
draft2_rw0.9_v2.99_10yrs | 791.0 | 2.385010 | 9.575185 | 0.196193 | 2.345613 |
draft2_rw0.9_uz_v2.99_10yrs | 795.0 | 2.378434 | 9.587410 | 0.195380 | 2.352043 |
Parallax uncertainties are reported in milliarcseconds, proper motion is milliarcseconds per year.
msub = metric_sets.loc[['DDF Depths', 'WFD Depths']].query('metric.str.contains("Coadd")').reset_index('metric set')
tmp = []
for f in 'ugrizy':
tmp.append(msub.query(f'metric.str.contains("{f} band")'))
msub = pd.concat(tmp)
#r = 'draft_connected_v2.99_10yrs'
r = 'draft2_rw0.9_uz_v2.99_10yrs'
y = summaries.loc[[r], msub['metric']].values[0]
x = msub['metric']
offsets = np.zeros(len(y))
ii = np.where(msub['metric'].str.contains("WFD"), 1, 0)
#offsets[np.where(ii == 1)] += 1.3
y = y + offsets
fig = plt.figure(figsize=(8, 6))
plt.bar(x, y)
plt.tick_params("x", labelrotation=90)
plt.ylim(24.5, 29)
fig.set_figwidth(15)
plt.ylabel("Coadded depth")
plt.title(r)
Text(0.5, 1.0, 'draft2_rw0.9_uz_v2.99_10yrs')
summaries.loc['draft2_rw0.9_uz_v2.99_10yrs',
metric_sets.loc['DDF Cadence'].query('metric.str.contains("NVisits")')['metric']]
metric Median DD:ELAISS1 NVisits all bands HealpixSubsetSlicer 10671.0 Median DD:XMM_LSS NVisits all bands HealpixSubsetSlicer 10845.0 Median DD:COSMOS NVisits all bands HealpixSubsetSlicer 18716.5 Median DD:ECDFS NVisits all bands HealpixSubsetSlicer 10606.5 Median DD:EDFS NVisits all bands HealpixSubsetSlicer 6668.0 Median DD:WFD NVisits all bands HealpixSubsetSlicer 817.0 Name: draft2_rw0.9_uz_v2.99_10yrs, dtype: float64
The time gaps between visits in the same and in different filters has been a strong question in the latest considerations. The "TgapsPercent" metrics above tell some of the story, and more can be seen in the "DeltaNight" and "DeltaTime" histograms on the full MAF analysis pages for each run. However, to make it easier to compare a subset of these, we recalculate and plot the outputs together here.
recalculate=True
nightgaps = {}
slicer = maf.HealpixSlicer(nside=64)
bins = np.arange(0, 20.5, 1)
metric = maf.NightgapsMetric(
bins=bins, night_col='night', metric_name="DeltaNight Histogram"
)
plotFunc = maf.SummaryHistogram()
for r in these_runs:
if r not in opsdb:
continue
nightgaps[r] = {}
for f in filterlist:
# Histogram of the number of nights between visits.
plotDict = {"bins": bins, "xlabel": "dT (nights)", 'color': colors[f]}
bundle = maf.MetricBundle(
metric,
slicer,
sqls[f],
info_label=info_labels[f],
plot_dict=plotDict,
plot_funcs=[plotFunc],
run_name=r
)
nightgaps[r][f] = bundle
if recalculate:
g = maf.MetricBundleGroup(nightgaps[r], opsdb[r], out_dir=outDir)
g.run_all()
else:
for f in filterlist:
nightgaps[r][f].read(os.path.join(outDir, nightgaps[r][f].file_root + ".npz"))
nightgaps[r][f].metric_values.fill_value=0
Healpix slicer using NSIDE=64, approximate resolution 54.967783 arcminutes
for k in [ 'TVS Tgaps']:
msub = metric_sets.loc[k].query('metric.str.contains("day")')
fig, ax = maf.plot_run_metric(summaries.loc[these_runs,msub['metric']],
baseline_run="roll_early_v2.99_10yrs",
#metric_label_map=msub['short_name'],
metric_set=msub,
horizontal_quantity='run',
vertical_quantity='value')
fig.set_figwidth(13)
fig.set_figheight(len(msub)*.5)
runs = [r for r in these_runs if r in nightgaps]
runs = ['roll_early_v2.99_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs',
'draft2_rw0.5_v2.99_10yrs', 'draft2_rw0.9_v2.99_10yrs', ]
tcolors = np.random.rand(len(runs), 3)
if len(runs) == 4:
tcolors = ['g', 'r', 'b', 'y']
for f in filterlist:
plotbundles = []
plotdicts = []
for i, r in enumerate(runs):
if i < 2:
linestyle= ':'
else:
linestyle = '-'
plotbundles.append(nightgaps[r][f])
plotdicts.append({'color': tcolors[i], 'linestyle': linestyle, 'label': r, 'metric_reduce': maf.SumMetric()})
ph.set_metric_bundles(plotbundles)
ph.plot(maf.SummaryHistogram(), plot_dicts=plotdicts, outfile_root=f'nightgaps_{f}band')
cc = {}
for f in filterlist:
cc[f] = {}
for r in ['draft2_rw0.9_v2.99_10yrs', 'draft2_rw0.9_uz_v2.99_10yrs']:
x = len(nightgaps[r][f].metric_values.compressed())
y = len(nightgaps[r][f].metric_values.compressed()[0])
c = np.concatenate(nightgaps[r][f].metric_values.compressed().copy()).ravel().reshape(x, y)
#print(r, f, 'band')
cc[f][r] = (c.sum(axis=0))[1]
pd.DataFrame(cc)
all | u | g | r | i | z | y | |
---|---|---|---|---|---|---|---|
draft2_rw0.9_v2.99_10yrs | 2633586 | 122771 | 100142 | 503026 | 449627 | 402253 | 249477 |
draft2_rw0.9_uz_v2.99_10yrs | 2644923 | 119155 | 111856 | 568662 | 482786 | 588294 | 231474 |