-
Notifications
You must be signed in to change notification settings - Fork 0
/
runEventTrigger.py
executable file
·30 lines (29 loc) · 1.34 KB
/
runEventTrigger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
import sys
sys.path.append("/home/mike/lsst/metrics") # modify path as needed
import numpy as np
import matplotlib.pyplot as plt
import lsst.sims.maf.db as db
import lsst.sims.maf.metrics as metrics
import lsst.sims.maf.slicers as slicers
import lsst.sims.maf.metricBundles as metricBundles
from lsst.sims.maf.plots import PlotHandler
from EventTriggerMetric import EventTriggerMetric
database='astro-lsst-01_2022.db'
databasename='astro-lsst-01_2022'
opsdb = db.OpsimDatabase(database)
OutDir='Microlens/Exoplanet'
kwargs={'DelMin':48, 'DelMax':168} # Sample stellar microlensing parameter
kwargs={'DelMin':1, 'DelMax':48} # Sample exoplanet microlensing parameter
eventtriggermetric=EventTriggerMetric(**kwargs)
slicer = slicers.OpsimFieldSlicer()
Title='EventTrigger Metric for '+databasename
#plotDict={'colorMin':0.0, 'colorMax':1.0, 'xlabel':'Periodogram Purity Function', 'title':Title}
plotDict={'title':Title, 'logScale':True, 'colorMin':0.00001, 'xlabel':'Fraction'}
sqlconstraint = ''
eventtrigger = metricBundles.MetricBundle(eventtriggermetric, slicer, sqlconstraint, plotDict=plotDict, runName=databasename)
bundleDict = {'EventTrigger':eventtrigger}
resultsDb=db.ResultsDb(outDir=OutDir)
group = metricBundles.MetricBundleGroup(bundleDict, opsdb, outDir=OutDir, resultsDb=resultsDb)
group.runAll()
group.plotAll(closefigs=False)