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

Update of a source-dependent config file #937

Merged
merged 2 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
87 changes: 68 additions & 19 deletions lstchain/data/lstchain_src_dep_config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source_config" : {
"EventSource": {
"allowed_tels": [1, 2, 3, 4],
"allowed_tels": [1],
"max_events": null
},
"LSTEventSource": {
Expand All @@ -18,6 +18,8 @@
"drive_report_path": null
},
"LSTR0Corrections":{
"calib_scale_high_gain":1.088,
"calib_scale_low_gain":1.004,
"drs4_pedestal_path": null,
"calibration_path": null,
"drs4_time_calibration_path": null
Expand All @@ -34,16 +36,23 @@
"leakage_intensity_width_2": [0, Infinity]
},

"tailcut": {
"picture_thresh":8,
"boundary_thresh":4,
"keep_isolated_pixels":false,
"min_number_picture_neighbors":2,
"use_only_main_island":false,
"delta_time": 2
},
"tailcuts_clean_with_pedestal_threshold": {
"picture_thresh":6,
"boundary_thresh":3,
"picture_thresh":8,
"boundary_thresh":4,
"sigma":2.5,
"keep_isolated_pixels":false,
"min_number_picture_neighbors":2,
"use_only_main_island":false,
"delta_time": 2
},

"dynamic_cleaning": {
"apply": true,
"threshold": 267,
Expand Down Expand Up @@ -86,7 +95,7 @@
"warm_start": false
},

"random_forest_particle_classifier_args": {
"random_forest_disp_classifier_args": {
"max_depth": 100,
"min_samples_leaf": 2,
"n_jobs": 4,
Expand All @@ -105,7 +114,7 @@
"class_weight": null
},

"random_forest_disp_classifier_args": {
"random_forest_particle_classifier_args": {
"max_depth": 100,
"min_samples_leaf": 2,
"n_jobs": 4,
Expand All @@ -123,7 +132,8 @@
"warm_start": false,
"class_weight": null
},



"energy_regression_features": [
"log_intensity",
"width",
Expand Down Expand Up @@ -175,28 +185,24 @@
"dist"
],


"allowed_tels": [1, 2, 3, 4],
"max_events": null,
"write_pe_image": false,
"mc_image_scaling_factor": 1,
"CameraCalibrator": {
"apply_waveform_time_shift": false
},
"image_extractor": "LocalPeakWindowSum",
"image_extractor_for_muons": "GlobalPeakWindowSum",
"image_extractor_config": {},
"gain_selector": "ThresholdGainSelector",
"gain_selector_config": {
"threshold": 3500
"CameraCalibrator": {
"apply_waveform_time_shift": false
},
"time_sampling_correction_path": "default",
"LocalPeakWindowSum":{
"window_shift": 4,
"window_width":8
"window_width": 8,
"apply_integration_correction": false
},
"GlobalPeakWindowSum":{
"window_shift": 4,
"window_width":8
"window_width": 8,
"apply_integration_correction": false
},
"timestamps_pointing":"ucts",

Expand All @@ -207,7 +213,7 @@
"mc_nominal_source_y_deg": 0.0,

"observation_mode": "wobble",
"n_off_wobble": 3,
"n_off_wobble": 1,
"source_name": "Crab Nebula",
"source_ra":83.63308333,
"source_dec":22.0145,
Expand All @@ -216,5 +222,48 @@
"algorithm": null,
"parameters": {
}
},
"calibration_product": "LSTCalibrationCalculator",

"LSTCalibrationCalculator":{
"systematic_correction_path": null,
"squared_excess_noise_factor": 1.222,
"flatfield_product": "FlasherFlatFieldCalculator",
"pedestal_product": "PedestalIntegrator",
"PedestalIntegrator":{
"sample_size": 10000,
"sample_duration":100000,
"tel_id":1,
"time_sampling_correction_path": null,
"charge_median_cut_outliers": [-10,10],
"charge_std_cut_outliers": [-10,10],
"charge_product":"FixedWindowSum",
"FixedWindowSum":{
"window_shift": 6,
"window_width":12,
"peak_index": 18,
"apply_integration_correction": false
}
},
"FlasherFlatFieldCalculator":{
"sample_size": 10000,
"sample_duration":100000,
"tel_id":1,
"time_sampling_correction_path": null,
"charge_product":"LocalPeakWindowSum",
"charge_median_cut_outliers": [-0.5,0.5],
"charge_std_cut_outliers": [-10,10],
"time_cut_outliers": [2,38],
"LocalPeakWindowSum":{
"window_shift": 5,
"window_width":12,
"apply_integration_correction": false
}
}
},
"waveform_nsb_tuning":{
"nsb_tuning": false,
"nsb_tuning_ratio": 0.52,
"spe_location": "lstchain/data/SinglePhE_ResponseInPhE_expo2Gaus.dat"
}
}
2 changes: 1 addition & 1 deletion lstchain/io/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_get_srcdep_config():
assert srcdep_config['source_dependent'] == True
assert srcdep_config['mc_nominal_source_x_deg'] == 0.4
assert srcdep_config['observation_mode'] == 'wobble'
assert srcdep_config['n_off_wobble'] == 3
assert srcdep_config['n_off_wobble'] == 1

def test_replace_config():
a = dict(toto=1, tata=2)
Expand Down
11 changes: 8 additions & 3 deletions lstchain/scripts/tests/test_lstchain_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
dl1_params_tel_mon_flat_key,
)

from lstchain.io.config import get_standard_config

from lstchain.io.config import get_standard_config, get_srcdep_config
import json


Expand Down Expand Up @@ -348,7 +347,13 @@ def test_lstchain_observed_dl1_to_dl2(observed_dl2_file):
def test_lstchain_observed_dl1_to_dl2_srcdep(observed_srcdep_dl2_file):
assert observed_srcdep_dl2_file.is_file()
dl2_srcdep_df = get_srcdep_params(observed_srcdep_dl2_file)
srcdep_assumed_positions = ['on', 'off_090', 'off_180', 'off_270']
srcdep_config = get_srcdep_config()
srcdep_assumed_positions = ['on']
n_off_wobble=srcdep_config.get('n_off_wobble')
for ioff in range(n_off_wobble):
off_angle = 2 * np.pi / (n_off_wobble + 1) * (ioff + 1)
srcdep_assumed_positions.append('off_{:03}'.format(round(np.rad2deg(off_angle))))

srcdep_dl2_params = [
'expected_src_x',
'expected_src_y',
Expand Down