Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook update #46

Merged
merged 16 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
353 changes: 222 additions & 131 deletions examples/analysis_notebook.ipynb

Large diffs are not rendered by default.

81 changes: 52 additions & 29 deletions examples/example_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
io:
# ED style runlist with one run number per line
runlist: "/raid/romulus/swong/ED490/Eventdisplay_AnalysisScripts_VTS/scripts/crab_test.txt"
# Where to search for background/mimic data
search_datastore : "/raid/romulus/dl3/ed/dl3_fullenclosure_moderate2tel/"
# Where to find your runlist's DL3 files (no bkg header)
in_dir : "/raid/romulus/swong/mydl3/crabtest/"
# Where to store your DL3 files with appended bkg - this is your DataStore for the analysis
out_dir : "/raid/romulus/swong/mydl3/crabtestbkgs/"
# Where to write results & plots
results_dir: "/raid/romulus/swong/mydl3/crabtest/results/"

# Whether or not to generate the background from the run
Expand All @@ -11,19 +16,21 @@ io:
from_runlist: true

binning:
# Energy binning
# Energy binning for bkg generation
e_min: 0.1
e_max: 100
e_bins: 10
# Offset/wobble binning
# Offset/wobble binning for bkg generation
off_min: 0
off_max: 2.5
off_bins: 5

config:
config:
# Number of cores to be used for parallel bkg generation
njobs : 16

exclusion:
# Star catalog for finding star exclusions
star_cat : "./Hipparcos_MAG8_1997.dat"
# Exculde region around a simbad resolveable source name
# Expecting name, exclusion
Expand All @@ -37,75 +44,91 @@ exclusion:
# Expecting ra, dec, exclusion
# exclude_source_run : [ ("287.10 deg", "6.39 deg", "3.5 deg"]


# Selection criteria for generating bkg headers
background_selection:
# el_min : 40
# el_max : 30
# Maximum difference in NSB values
nsb_diff : 1.5
# 1/sin(el) difference
el_diff : 1.5
# az difference
# Maximum 1/sin(el) difference
el_diff : 1
# Maximum azimuth difference
az_diff : 45
# Minimum number of telescopes
n_tels : 4
# Maximum time between runs in days
n_tels : 3
# Maximum time between runs in days - this doesn't need to be set if you're using same_szn
time_max : 180
# Whether or not to smooth the background
smooth : true
smooth_sigma : 1
# Whether bkgs should come from same season as data
same_szn : true
time_request : 20
# Whether or not to smooth the background & by what width (in pixel space)
smooth : true
smooth_sigma : 1
# How many hours of bkg headers to create
time_request : 50
# Whether to use KL Divergence criteria to pick nearest runs for bkgs
# If time_request is set, this must be set to true
KL_DIV: true
# Whether or not to store the nearest bkgs as FITS files
store_KL: false

run_selection:
# Runs of interests
# Source of interest
source_name : "Crab"
# Whether to get source position from the DL3 header
pos_from_DL3: true
#source_ra: 253.4675000
#source_dec: 39.7602778
# Maximum offset to select data from
# If pos_from_DL3 is set to false, provide source coordinates in deg
source_ra: 253.4675000
source_dec: 39.7602778
# Maximum offset in deg to select data from
offset_max : 3.5
# Number of telescopes to select
# Minimum number of telescopes to select as valid runs
n_tel : 3
samanthalwong marked this conversation as resolved.
Show resolved Hide resolved
# elevation min/maz
# Minimum elevation to select as valid runs
el_min : 30

spectrum :
# Energy threshold for spectral/integral flux calculations
e_min : 0.2
# Maximum energy for spectral/integral flux calculations
e_max : 30
# Number of energy bins for spectral calculations
e_bins : 8
# Spectral type
type : "PL"
#array of [normalization, spectral index]
# Spectral fit parameters (initial guess) - for power law: array of [normalization, spectral index]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Add units to normalization (I'll do this)

params : [3.45e-11,2.6]

lightcurve:
#light curve bin size in minutes
bin_size_min: 1000

sky_map:
e_min: 0.1
# Energy threshold for events to be included in the sky map
e_min: 0.01
# Maximum energy for sky map
e_max: 100
map_deg: 2.5
# Number of energy bins for the sky map
n_bins: 30
# Sky map size (deg)
map_deg: 5
# Sky map binning (deg) - ED default is 0.01, VEGAS is 0.02
# Larger bins run faster
bin_sz: 0.01
offset_max: 1.5
aeff_max_percent: 0.01
offset_max: 1.75
# Safe energy threshold (as a %) for effective area - ED doesn't use this, so it's set fairly small
aeff_max_percent: 0.1
#exclusion regions are lists of lists of [[SkyCoord, radius], [SkyCoord, radius], ...]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a comment to explicitly say degrees

exclusion_regions: []
#theta defines the ON region size
theta: 0.0894427191
#exclusion region around the source
on_exclusion_region: 0.35
#RBM parameters
ring_rin: "0.5333335 deg"
ring_rin: "0.6 deg"
ring_width: "0.133333 deg"
#whether or not to truncate the skymap colourbar at +/- 5 sigma
truncate: true
#safe mask max aeff %
#dimmest visual magnitude for stars to be excluded
min_star_brightness: 8

#where to save outputs
results_file: 'crab_test_results.yaml'
plot_names: 'crab_test'
plot_names: 'crab_test'
114 changes: 114 additions & 0 deletions examples/mrk_501_v5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
io:
runlist: "/raid/romulus/swong/ED490/Eventdisplay_AnalysisScripts_VTS/scripts/mrk501_v5.txt"
search_datastore : "/raid/romulus/dl3/ed/dl3_fullenclosure_moderate2tel/"
in_dir : "/raid/romulus/swong/mydl3/mrk501_v5/"
out_dir : "/raid/romulus/swong/mydl3/mrk501_v5/bkgs/" #"/raid/romulus/swong/mydl3/mrk501_v4_bkgs/"
results_dir: "/raid/romulus/swong/mydl3/mrk501_v5/results/"

# Whether or not to generate the background from the run
from_run : false
# Whether or not to analyze runs from a runlist or all runs in the results_dir
from_runlist: true

binning:
# Energy binning
e_min: 0.1
e_max: 100
e_bins: 10
# Offset/wobble binning
off_min: 0
off_max: 2.5
off_bins: 5

config:
njobs : 16

exclusion:
star_cat : "./Hipparcos_MAG8_1997.dat"
# Exculde region around a simbad resolveable source name
# Expecting name, exclusion
exclude_source_name :
# Exculde region around a given ra, dec
exclude_regions :
# Exculde region around a given ra, dec
# Exculde region around a given ra, dec
# exclude_source_pos : [ ("287.10 deg", "6.39 deg", "0.5 deg"]
# Exculde entire run within a distance to a given ra/dec
# Expecting ra, dec, exclusion
# exclude_source_run : [ ("287.10 deg", "6.39 deg", "3.5 deg"]


background_selection:
# el_min : 40
# el_max : 30
nsb_diff : 1.5
# 1/sin(el) difference
el_diff : 1.5
# az difference
az_diff : 45
# Minimum number of telescopes
n_tels : 4
# Maximum time between runs in days
time_max : 180
# Whether or not to smooth the background
smooth : true
smooth_sigma : 1
# Whether bkgs should come from same season as data
same_szn : true
time_request : 20
KL_DIV: true
#max_runs : true
#n_runs : 50


run_selection:
# Runs of interests
# Source of interest
source_name : "Mrk 501"
pos_from_DL3: false
source_ra: 253.4675000
source_dec: 39.7602778
# Maximum offset to select data from
offset_max : 3.5
# Number of telescopes to select
n_tel : 3
# elevation min/maz
el_min : 20

spectrum :
e_min : 0.2
e_max : 30
e_bins : 8
type : "PL"
#array of [normalization, spectral index]
params : [1e-11,2.72]

lightcurve:
#light curve bin size in minutes
bin_size_min: 1000

sky_map:
map_deg: 2.5
bin_sz: 0.01
e_min: 0.1
e_max: 100
offset_max: 1.5
aeff_max_percent: 0.1
#exclusion regions are lists of lists of [[SkyCoord, radius], [SkyCoord, radius], ...]
exclusion_regions: []
#theta defines the ON region size
theta: 0.0894427191
#exclusion region around the source
on_exclusion_region: 0.35
#RBM parameters
ring_rin: "0.6 deg"
ring_width: "0.133333 deg"
#whether or not to truncate the skymap colourbar at +/- 5 sigma
truncate: true
#safe mask max aeff %
#dimmest visual magnitude for stars to be excluded
min_star_brightness: 8

#where to save outputs
results_file: 'mrk501_v5_results.yaml'
plot_names: 'mrk501_v5'
Loading