gammasimtools 0.18.0__py3-none-any.whl → 0.20.0__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.
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/METADATA +24 -69
- gammasimtools-0.20.0.dist-info/RECORD +395 -0
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/entry_points.txt +11 -4
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/licenses/LICENSE +1 -1
- simtools/_version.py +16 -3
- simtools/applications/calculate_incident_angles.py +182 -0
- simtools/applications/convert_all_model_parameters_from_simtel.py +4 -3
- simtools/applications/convert_geo_coordinates_of_array_elements.py +3 -3
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +17 -14
- simtools/applications/db_add_value_from_json_to_db.py +8 -10
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +8 -13
- simtools/applications/db_generate_compound_indexes.py +65 -0
- simtools/applications/db_get_file_from_db.py +12 -24
- simtools/applications/db_get_parameter_from_db.py +4 -4
- simtools/applications/db_inspect_databases.py +20 -10
- simtools/applications/derive_mirror_rnda.py +17 -11
- simtools/applications/derive_psf_parameters.py +59 -309
- simtools/applications/derive_trigger_rates.py +91 -0
- simtools/applications/docs_produce_array_element_report.py +1 -1
- simtools/applications/docs_produce_calibration_reports.py +1 -1
- simtools/applications/docs_produce_model_parameter_reports.py +1 -1
- simtools/applications/docs_produce_simulation_configuration_report.py +1 -1
- simtools/applications/generate_corsika_histograms.py +1 -1
- simtools/applications/generate_default_metadata.py +8 -24
- simtools/applications/generate_simtel_event_data.py +11 -11
- simtools/applications/maintain_simulation_model_add_production_table.py +71 -0
- simtools/applications/maintain_simulation_model_compare_productions.py +98 -0
- simtools/applications/{verify_simulation_model_production_tables.py → maintain_simulation_model_verify_production_tables.py} +9 -1
- simtools/applications/merge_tables.py +2 -2
- simtools/applications/plot_array_layout.py +3 -3
- simtools/applications/plot_simtel_events.py +421 -0
- simtools/applications/plot_tabular_data.py +9 -2
- simtools/applications/plot_tabular_data_for_model_parameter.py +2 -1
- simtools/applications/print_version.py +8 -9
- simtools/applications/production_derive_corsika_limits.py +6 -7
- simtools/applications/production_derive_statistics.py +1 -1
- simtools/applications/production_generate_grid.py +2 -2
- simtools/applications/production_merge_corsika_limits.py +214 -0
- simtools/applications/run_application.py +47 -113
- simtools/applications/simulate_calibration_events.py +166 -0
- simtools/applications/simulate_flasher.py +141 -0
- simtools/applications/{simulate_light_emission.py → simulate_illuminator.py} +35 -99
- simtools/applications/simulate_prod.py +6 -24
- simtools/applications/simulate_prod_htcondor_generator.py +7 -0
- simtools/applications/submit_array_layouts.py +2 -1
- simtools/applications/submit_model_parameter_from_external.py +1 -1
- simtools/applications/validate_camera_efficiency.py +30 -12
- simtools/applications/validate_camera_fov.py +1 -1
- simtools/applications/validate_cumulative_psf.py +1 -1
- simtools/applications/validate_file_using_schema.py +9 -5
- simtools/applications/validate_optics.py +1 -1
- simtools/camera/camera_efficiency.py +61 -45
- simtools/camera/single_photon_electron_spectrum.py +1 -1
- simtools/configuration/commandline_parser.py +46 -11
- simtools/configuration/configurator.py +4 -4
- simtools/corsika/corsika_config.py +45 -25
- simtools/corsika/corsika_histograms.py +6 -5
- simtools/data_model/data_reader.py +2 -3
- simtools/data_model/metadata_collector.py +32 -36
- simtools/data_model/metadata_model.py +15 -12
- simtools/data_model/model_data_writer.py +13 -32
- simtools/data_model/schema.py +74 -24
- simtools/data_model/validate_data.py +42 -12
- simtools/db/db_handler.py +125 -62
- simtools/db/db_model_upload.py +14 -19
- simtools/dependencies.py +98 -30
- simtools/io/ascii_handler.py +279 -0
- simtools/{io_operations → io}/io_handler.py +25 -3
- simtools/job_execution/htcondor_script_generator.py +15 -4
- simtools/layout/array_layout.py +1 -1
- simtools/layout/array_layout_utils.py +51 -12
- simtools/model/array_model.py +41 -5
- simtools/model/flasher_model.py +106 -0
- simtools/model/model_parameter.py +4 -4
- simtools/model/model_repository.py +197 -2
- simtools/model/site_model.py +25 -0
- simtools/model/telescope_model.py +3 -1
- simtools/production_configuration/derive_corsika_limits.py +336 -427
- simtools/production_configuration/derive_production_statistics_handler.py +7 -6
- simtools/production_configuration/generate_production_grid.py +9 -11
- simtools/production_configuration/merge_corsika_limits.py +528 -0
- simtools/ray_tracing/incident_angles.py +706 -0
- simtools/ray_tracing/mirror_panel_psf.py +1 -0
- simtools/ray_tracing/psf_parameter_optimisation.py +792 -0
- simtools/ray_tracing/ray_tracing.py +6 -2
- simtools/reporting/docs_read_parameters.py +150 -62
- simtools/runners/corsika_runner.py +1 -1
- simtools/runners/corsika_simtel_runner.py +14 -5
- simtools/runners/runner_services.py +10 -5
- simtools/runners/simtools_runner.py +267 -0
- simtools/schemas/application_workflow.metaschema.yml +101 -68
- simtools/schemas/input/MST_mirror_2f_measurements.schema.yml +1 -1
- simtools/schemas/input/single_pe_spectrum.schema.yml +1 -1
- simtools/schemas/metadata.metaschema.yml +577 -3
- simtools/schemas/model_parameter.metaschema.yml +6 -6
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +4 -4
- simtools/schemas/model_parameters/adjust_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +1 -1
- simtools/schemas/model_parameters/array_layouts.schema.yml +1 -1
- simtools/schemas/model_parameters/array_triggers.schema.yml +1 -1
- simtools/schemas/model_parameters/array_window.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/axes_offsets.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_file.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_depth.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_pixels.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +1 -1
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +3 -3
- simtools/schemas/model_parameters/dark_events.schema.yml +1 -1
- simtools/schemas/model_parameters/default_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/design_model.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_start.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +2 -2
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +1 -1
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/epsg_code.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_long_event_threshold.schema.yml +35 -0
- simtools/schemas/model_parameters/fadc_long_sum_bins.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_long_sum_offset.schema.yml +38 -0
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fake_mirror_list.schema.yml +1 -1
- simtools/schemas/model_parameters/flatfielding.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/focus_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/gain_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_events.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +1 -1
- simtools/schemas/model_parameters/led_events.schema.yml +1 -1
- simtools/schemas/model_parameters/led_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/led_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +50 -1
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/min_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_class.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_list.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +1 -1
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +2 -2
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_sky_map.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +23 -30
- simtools/schemas/model_parameters/num_gains.schema.yml +1 -1
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +1 -1
- simtools/schemas/model_parameters/optics_properties.schema.yml +1 -1
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +1 -1
- simtools/schemas/model_parameters/pedestal_events.schema.yml +1 -1
- simtools/schemas/model_parameters/photon_delay.schema.yml +1 -1
- simtools/schemas/model_parameters/photons_per_run.schema.yml +1 -1
- simtools/schemas/model_parameters/pixel_cells.schema.yml +1 -1
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +1 -1
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +11 -1
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/qe_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/random_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/random_generator.schema.yml +1 -1
- simtools/schemas/model_parameters/random_mono_probability.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +1 -1
- simtools/schemas/model_parameters/sampled_output.schema.yml +1 -1
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +11 -1
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +11 -1
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/stars.schema.yml +2 -2
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +1 -1
- simtools/schemas/plot_configuration.metaschema.yml +5 -2
- simtools/schemas/production_configuration_metrics.schema.yml +12 -2
- simtools/schemas/production_tables.schema.yml +7 -2
- simtools/simtel/simtel_config_reader.py +2 -2
- simtools/simtel/simtel_config_writer.py +33 -23
- simtools/simtel/simtel_io_event_histograms.py +483 -0
- simtools/simtel/simtel_io_event_reader.py +65 -43
- simtools/simtel/simtel_io_event_writer.py +40 -20
- simtools/simtel/simtel_io_metadata.py +1 -1
- simtools/simtel/simtel_table_reader.py +95 -13
- simtools/simtel/simulator_array.py +138 -10
- simtools/simtel/simulator_camera_efficiency.py +32 -23
- simtools/simtel/simulator_light_emission.py +437 -271
- simtools/simtel/simulator_ray_tracing.py +1 -1
- simtools/simulator.py +105 -147
- simtools/telescope_trigger_rates.py +119 -0
- simtools/testing/configuration.py +24 -26
- simtools/testing/helpers.py +2 -2
- simtools/testing/log_inspector.py +52 -0
- simtools/testing/validate_output.py +87 -37
- simtools/utils/general.py +125 -255
- simtools/utils/geometry.py +56 -0
- simtools/utils/names.py +1 -1
- simtools/visualization/legend_handlers.py +180 -264
- simtools/visualization/plot_array_layout.py +20 -8
- simtools/visualization/plot_incident_angles.py +431 -0
- simtools/visualization/plot_pixels.py +1 -1
- simtools/visualization/plot_simtel_event_histograms.py +376 -0
- simtools/visualization/plot_simtel_events.py +816 -0
- simtools/visualization/plot_tables.py +133 -37
- simtools/visualization/visualize.py +1 -100
- gammasimtools-0.18.0.dist-info/RECORD +0 -376
- simtools/applications/calculate_trigger_rate.py +0 -187
- simtools/applications/generate_sim_telarray_histograms.py +0 -196
- simtools/production_configuration/derive_corsika_limits_grid.py +0 -232
- simtools/simtel/simtel_io_histogram.py +0 -621
- simtools/simtel/simtel_io_histograms.py +0 -552
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/top_level.txt +0 -0
- /simtools/{io_operations → io}/hdf5_handler.py +0 -0
- /simtools/{io_operations → io}/legacy_data_handler.py +0 -0
- /simtools/{io_operations/io_table_handler.py → io/table_handler.py} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
r"""
|
|
4
|
+
Simulate flasher devices using the light emission package.
|
|
5
|
+
|
|
6
|
+
Run the application in the command line.
|
|
7
|
+
|
|
8
|
+
Example Usage
|
|
9
|
+
-------------
|
|
10
|
+
|
|
11
|
+
1. Simulate flashers for a telescope:
|
|
12
|
+
|
|
13
|
+
.. code-block:: console
|
|
14
|
+
|
|
15
|
+
simtools-simulate-flasher --telescope MSTN-04 --site North \
|
|
16
|
+
--flasher FLSN-01 --model_version 6.0.0
|
|
17
|
+
|
|
18
|
+
Command Line Arguments
|
|
19
|
+
----------------------
|
|
20
|
+
telescope (str, required)
|
|
21
|
+
Telescope model name (e.g. LSTN-01, MSTN-04, SSTS-04, ...)
|
|
22
|
+
site (str, required)
|
|
23
|
+
Site name (North or South).
|
|
24
|
+
flasher (str, required)
|
|
25
|
+
Flasher device in array, e.g., FLSN-01.
|
|
26
|
+
number_of_events (int, optional):
|
|
27
|
+
Number of events to simulate (default: 1).
|
|
28
|
+
output_prefix (str, optional):
|
|
29
|
+
Prefix for output files (default: empty).
|
|
30
|
+
model_version (str, optional)
|
|
31
|
+
Version of the simulation model.
|
|
32
|
+
|
|
33
|
+
Example
|
|
34
|
+
-------
|
|
35
|
+
|
|
36
|
+
Simulate flashers for MSTN-04:
|
|
37
|
+
|
|
38
|
+
.. code-block:: console
|
|
39
|
+
|
|
40
|
+
simtools-simulate-flasher --telescope MSTN-04 --site North \
|
|
41
|
+
--flasher FLSN-01 --model_version 6.0.0
|
|
42
|
+
|
|
43
|
+
Expected Output:
|
|
44
|
+
The simulation will run the light emission package for the flasher
|
|
45
|
+
devices and produce the output files.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
import logging
|
|
49
|
+
from pathlib import Path
|
|
50
|
+
|
|
51
|
+
import simtools.utils.general as gen
|
|
52
|
+
from simtools.configuration import configurator
|
|
53
|
+
from simtools.model.flasher_model import FlasherModel
|
|
54
|
+
from simtools.model.model_utils import initialize_simulation_models
|
|
55
|
+
from simtools.simtel.simulator_light_emission import SimulatorLightEmission
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _parse(label):
|
|
59
|
+
"""Parse command line configuration."""
|
|
60
|
+
config = configurator.Configurator(
|
|
61
|
+
label=label,
|
|
62
|
+
description=("Simulate flasher devices using the light emission package."),
|
|
63
|
+
)
|
|
64
|
+
config.parser.add_argument(
|
|
65
|
+
"--flasher",
|
|
66
|
+
help="Flasher device in array associated with a specific telescope, i.e. FLSN-01",
|
|
67
|
+
type=str,
|
|
68
|
+
required=True,
|
|
69
|
+
)
|
|
70
|
+
config.parser.add_argument(
|
|
71
|
+
"--number_events",
|
|
72
|
+
help="Number of number_events to simulate (default: 1)",
|
|
73
|
+
type=int,
|
|
74
|
+
default=1,
|
|
75
|
+
required=False,
|
|
76
|
+
)
|
|
77
|
+
config.parser.add_argument(
|
|
78
|
+
"--output_prefix",
|
|
79
|
+
help="Prefix for output files (default: empty)",
|
|
80
|
+
type=str,
|
|
81
|
+
default=None,
|
|
82
|
+
required=False,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return config.initialize(
|
|
86
|
+
db_config=True,
|
|
87
|
+
simulation_model=["telescope", "model_version"],
|
|
88
|
+
require_command_line=True,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def flasher_configs():
|
|
93
|
+
"""Return default setup for flasher runs (no distances)."""
|
|
94
|
+
return {"light_source_setup": "layout"}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def main():
|
|
98
|
+
"""Run the application."""
|
|
99
|
+
label = Path(__file__).stem
|
|
100
|
+
logger = logging.getLogger(__name__)
|
|
101
|
+
|
|
102
|
+
args_dict, db_config = _parse(label)
|
|
103
|
+
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
104
|
+
|
|
105
|
+
telescope_model, site_model = initialize_simulation_models(
|
|
106
|
+
label=label,
|
|
107
|
+
db_config=db_config,
|
|
108
|
+
site=args_dict["site"],
|
|
109
|
+
telescope_name=args_dict["telescope"],
|
|
110
|
+
model_version=args_dict["model_version"],
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
flasher_model = FlasherModel(
|
|
114
|
+
site=args_dict["site"],
|
|
115
|
+
flasher_device_model_name=args_dict["flasher"],
|
|
116
|
+
mongo_db_config=db_config,
|
|
117
|
+
model_version=args_dict["model_version"],
|
|
118
|
+
label=label,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
flasher_cfg = flasher_configs()
|
|
122
|
+
|
|
123
|
+
sim_runner = SimulatorLightEmission(
|
|
124
|
+
telescope_model=telescope_model,
|
|
125
|
+
flasher_model=flasher_model,
|
|
126
|
+
site_model=site_model,
|
|
127
|
+
light_emission_config=args_dict,
|
|
128
|
+
light_source_setup=flasher_cfg["light_source_setup"],
|
|
129
|
+
simtel_path=args_dict["simtel_path"],
|
|
130
|
+
light_source_type="flasher",
|
|
131
|
+
label=args_dict["label"],
|
|
132
|
+
test=args_dict.get("test", False),
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
sim_runner.run_simulation()
|
|
136
|
+
|
|
137
|
+
logger.info("Flasher simulation completed. Use simtools-plot-simtel-number_events for plots.")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
main()
|
|
@@ -16,18 +16,17 @@ Example Usage
|
|
|
16
16
|
|
|
17
17
|
.. code-block:: console
|
|
18
18
|
|
|
19
|
-
simtools-simulate-
|
|
19
|
+
simtools-simulate-illuminator --telescope MSTN-04 --site North \
|
|
20
20
|
--illuminator ILLN-01 --light_source_setup variable \
|
|
21
|
-
--model_version 6.0.0
|
|
21
|
+
--model_version 6.0.0
|
|
22
22
|
|
|
23
23
|
2. Simulate light emission with telescopes at fixed positions according to the layout:
|
|
24
24
|
|
|
25
25
|
.. code-block:: console
|
|
26
26
|
|
|
27
|
-
simtools-simulate-
|
|
27
|
+
simtools-simulate-illuminator --telescope MSTN-04 --site North \
|
|
28
28
|
--illuminator ILLN-01 --light_source_setup layout \
|
|
29
|
-
--model_version 6.0.0
|
|
30
|
-
--light_source_type led
|
|
29
|
+
--model_version 6.0.0
|
|
31
30
|
|
|
32
31
|
Command Line Arguments
|
|
33
32
|
----------------------
|
|
@@ -43,15 +42,10 @@ light_source_setup (str, optional)
|
|
|
43
42
|
- "layout" for actual telescope positions.
|
|
44
43
|
model_version (str, optional)
|
|
45
44
|
Version of the simulation model.
|
|
46
|
-
light_source_type (str, optional)
|
|
47
|
-
Select calibration light source type: led (default) or laser.
|
|
48
|
-
This changes the pre-compiled (sim_telarray) application that is used to run the
|
|
49
|
-
light emission package with. Currently we use xyzls (laser), and ls-beam can be
|
|
50
|
-
accessed by using the laser option.
|
|
51
45
|
off_axis_angle (float, optional)
|
|
52
46
|
Off axis angle for light source direction.
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
number_events (int, optional)
|
|
48
|
+
Number of events to simulate.
|
|
55
49
|
|
|
56
50
|
|
|
57
51
|
Example
|
|
@@ -61,9 +55,9 @@ Simulate isotropic light source at different distances for the MSTN-04:
|
|
|
61
55
|
|
|
62
56
|
.. code-block:: console
|
|
63
57
|
|
|
64
|
-
simtools-simulate-
|
|
58
|
+
simtools-simulate-illuminator --telescope MSTN-04 --site North \
|
|
65
59
|
--illuminator ILLN-01 --light_source_setup variable \
|
|
66
|
-
--model_version 6.0.0
|
|
60
|
+
--model_version 6.0.0 ```
|
|
67
61
|
|
|
68
62
|
Expected Output:
|
|
69
63
|
|
|
@@ -135,19 +129,7 @@ def _parse(label):
|
|
|
135
129
|
default=0.0,
|
|
136
130
|
required=False,
|
|
137
131
|
)
|
|
138
|
-
|
|
139
|
-
"--plot",
|
|
140
|
-
help="Produce a multiple pages pdf file with the image plots.",
|
|
141
|
-
action="store_true",
|
|
142
|
-
)
|
|
143
|
-
config.parser.add_argument(
|
|
144
|
-
"--light_source_type",
|
|
145
|
-
help="Select calibration light source type: led or laser",
|
|
146
|
-
type=str,
|
|
147
|
-
default="led",
|
|
148
|
-
choices=["led", "laser"],
|
|
149
|
-
required=False,
|
|
150
|
-
)
|
|
132
|
+
|
|
151
133
|
config.parser.add_argument(
|
|
152
134
|
"--light_source_setup",
|
|
153
135
|
help="Select calibration light source positioning/setup: \
|
|
@@ -171,48 +153,17 @@ def _parse(label):
|
|
|
171
153
|
required=True,
|
|
172
154
|
)
|
|
173
155
|
config.parser.add_argument(
|
|
174
|
-
"--
|
|
175
|
-
help="
|
|
176
|
-
notice as well image cleaning parameters",
|
|
177
|
-
type=str,
|
|
178
|
-
default=False,
|
|
179
|
-
required=False,
|
|
180
|
-
)
|
|
181
|
-
config.parser.add_argument(
|
|
182
|
-
"--picture_thresh",
|
|
183
|
-
help="ctapipe, threshold above which all pixels are retained",
|
|
184
|
-
type=int,
|
|
185
|
-
required=False,
|
|
186
|
-
)
|
|
187
|
-
config.parser.add_argument(
|
|
188
|
-
"--boundary_thresh",
|
|
189
|
-
help="ctapipe, threshold above which pixels are retained if\
|
|
190
|
-
they have a neighbor already above the picture_thresh",
|
|
191
|
-
type=int,
|
|
192
|
-
required=False,
|
|
193
|
-
)
|
|
194
|
-
config.parser.add_argument(
|
|
195
|
-
"--min_neighbors",
|
|
196
|
-
help="ctapipe, A picture pixel survives cleaning only if it has at\
|
|
197
|
-
least this number of picture neighbors. This has no effect in\
|
|
198
|
-
case keep_isolated_pixels is True",
|
|
199
|
-
type=int,
|
|
200
|
-
required=False,
|
|
201
|
-
)
|
|
202
|
-
config.parser.add_argument(
|
|
203
|
-
"--level",
|
|
204
|
-
help="read 5",
|
|
156
|
+
"--number_events",
|
|
157
|
+
help="Number of events to simulate",
|
|
205
158
|
type=int,
|
|
206
|
-
default=
|
|
159
|
+
default=1,
|
|
207
160
|
required=False,
|
|
208
161
|
)
|
|
209
162
|
config.parser.add_argument(
|
|
210
|
-
"--
|
|
211
|
-
help="
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
nargs="*",
|
|
215
|
-
default=["7", "3"],
|
|
163
|
+
"--output_prefix",
|
|
164
|
+
help="Prefix for output files (default: empty)",
|
|
165
|
+
type=str,
|
|
166
|
+
default=None,
|
|
216
167
|
required=False,
|
|
217
168
|
)
|
|
218
169
|
return config.initialize(
|
|
@@ -222,7 +173,7 @@ def _parse(label):
|
|
|
222
173
|
)
|
|
223
174
|
|
|
224
175
|
|
|
225
|
-
def light_emission_configs(
|
|
176
|
+
def light_emission_configs(args_dict):
|
|
226
177
|
"""
|
|
227
178
|
Define default light emission configurations.
|
|
228
179
|
|
|
@@ -235,8 +186,8 @@ def light_emission_configs(le_application, args_dict):
|
|
|
235
186
|
|
|
236
187
|
Parameters
|
|
237
188
|
----------
|
|
238
|
-
|
|
239
|
-
|
|
189
|
+
args_dict: dict
|
|
190
|
+
Dictionary with command line arguments.
|
|
240
191
|
|
|
241
192
|
args_dict: dict
|
|
242
193
|
Dictionary with command line arguments.
|
|
@@ -246,8 +197,8 @@ def light_emission_configs(le_application, args_dict):
|
|
|
246
197
|
default_config: dict
|
|
247
198
|
Default light emission configuration.
|
|
248
199
|
"""
|
|
249
|
-
if
|
|
250
|
-
|
|
200
|
+
if args_dict["light_source_setup"] == "variable":
|
|
201
|
+
cfg = {
|
|
251
202
|
"x_pos": {"len": 1, "unit": u.Unit("cm"), "default": 0 * u.cm, "names": ["x_position"]},
|
|
252
203
|
"y_pos": {"len": 1, "unit": u.Unit("cm"), "default": 0 * u.cm, "names": ["y_position"]},
|
|
253
204
|
"z_pos": {
|
|
@@ -263,37 +214,17 @@ def light_emission_configs(le_application, args_dict):
|
|
|
263
214
|
"names": ["direction", "cx,cy,cz"],
|
|
264
215
|
},
|
|
265
216
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
def select_application(args_dict):
|
|
270
|
-
"""
|
|
271
|
-
Select sim_telarray application for light emission simulations.
|
|
272
|
-
|
|
273
|
-
Parameters
|
|
274
|
-
----------
|
|
275
|
-
args_dict: dict
|
|
276
|
-
Dictionary with command line arguments.
|
|
277
|
-
|
|
278
|
-
Returns
|
|
279
|
-
-------
|
|
280
|
-
le_application: str
|
|
281
|
-
Light emission application.
|
|
282
|
-
"""
|
|
283
|
-
if args_dict["light_source_type"] == "led":
|
|
284
|
-
return "xyzls", args_dict["light_source_setup"]
|
|
285
|
-
if args_dict["light_source_type"] == "laser":
|
|
286
|
-
return "ls-beam", args_dict["light_source_setup"]
|
|
287
|
-
return None, args_dict["light_source_setup"]
|
|
217
|
+
args_dict.update(cfg)
|
|
218
|
+
return args_dict
|
|
219
|
+
return args_dict
|
|
288
220
|
|
|
289
221
|
|
|
290
222
|
def main():
|
|
291
223
|
"""Simulate light emission."""
|
|
292
224
|
label = Path(__file__).stem
|
|
293
225
|
args_dict, db_config = _parse(label)
|
|
294
|
-
|
|
295
|
-
light_emission_config
|
|
296
|
-
|
|
226
|
+
light_emission_config = light_emission_configs(args_dict)
|
|
227
|
+
print(light_emission_config)
|
|
297
228
|
logger = logging.getLogger()
|
|
298
229
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
299
230
|
|
|
@@ -318,17 +249,22 @@ def main():
|
|
|
318
249
|
calibration_model=calibration_model,
|
|
319
250
|
site_model=site_model,
|
|
320
251
|
light_emission_config=light_emission_config,
|
|
321
|
-
|
|
252
|
+
light_source_setup=args_dict["light_source_setup"],
|
|
322
253
|
simtel_path=args_dict["simtel_path"],
|
|
323
|
-
light_source_type=
|
|
254
|
+
light_source_type="illuminator",
|
|
324
255
|
label=label,
|
|
325
256
|
test=args_dict["test"],
|
|
326
257
|
)
|
|
327
258
|
|
|
328
259
|
if args_dict["light_source_setup"] == "variable":
|
|
329
|
-
light_source.simulate_variable_distances(args_dict)
|
|
260
|
+
outputs = light_source.simulate_variable_distances(args_dict)
|
|
330
261
|
elif args_dict["light_source_setup"] == "layout":
|
|
331
|
-
light_source.simulate_layout_positions(args_dict)
|
|
262
|
+
outputs = light_source.simulate_layout_positions(args_dict)
|
|
263
|
+
else:
|
|
264
|
+
outputs = []
|
|
265
|
+
|
|
266
|
+
if outputs:
|
|
267
|
+
logger.info("Simulation outputs:\n%s", "\n".join(str(p) for p in outputs))
|
|
332
268
|
|
|
333
269
|
|
|
334
270
|
if __name__ == "__main__":
|
|
@@ -141,30 +141,14 @@ def _parse(description=None):
|
|
|
141
141
|
action="store_true",
|
|
142
142
|
default=False,
|
|
143
143
|
)
|
|
144
|
-
sim_telarray_seed_group = config.parser.add_argument_group(
|
|
145
|
-
title="Random seeds for sim_telarray instrument setup",
|
|
146
|
-
)
|
|
147
|
-
sim_telarray_seed_group.add_argument(
|
|
148
|
-
"--sim_telarray_instrument_seeds",
|
|
149
|
-
help=(
|
|
150
|
-
"Random seed used for sim_telarray instrument setup. "
|
|
151
|
-
"If '--sim_telarray_random_instrument_instances is not set: use as sim_telarray seed "
|
|
152
|
-
" ('random_seed' parameter). "
|
|
153
|
-
"Otherwise: use as base seed for the generation of random instrument instance seeds."
|
|
154
|
-
),
|
|
155
|
-
type=str,
|
|
156
|
-
required=False,
|
|
157
|
-
)
|
|
158
|
-
sim_telarray_seed_group.add_argument(
|
|
159
|
-
"--sim_telarray_random_instrument_instances",
|
|
160
|
-
help="Number of random instrument instances initialized in sim_telarray.",
|
|
161
|
-
type=int,
|
|
162
|
-
required=False,
|
|
163
|
-
)
|
|
164
144
|
return config.initialize(
|
|
165
145
|
db_config=True,
|
|
166
146
|
simulation_model=["site", "layout", "telescope", "model_version"],
|
|
167
|
-
simulation_configuration={
|
|
147
|
+
simulation_configuration={
|
|
148
|
+
"software": None,
|
|
149
|
+
"corsika_configuration": ["all"],
|
|
150
|
+
"sim_telarray_configuration": ["all"],
|
|
151
|
+
},
|
|
168
152
|
)
|
|
169
153
|
|
|
170
154
|
|
|
@@ -174,9 +158,7 @@ def main(): # noqa: D103
|
|
|
174
158
|
logger = logging.getLogger()
|
|
175
159
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
176
160
|
|
|
177
|
-
simulator = Simulator(
|
|
178
|
-
label=args_dict.get("label"), args_dict=args_dict, mongo_db_config=db_config
|
|
179
|
-
)
|
|
161
|
+
simulator = Simulator(label=args_dict.get("label"), args_dict=args_dict, db_config=db_config)
|
|
180
162
|
|
|
181
163
|
simulator.simulate()
|
|
182
164
|
simulator.validate_metadata()
|
|
@@ -24,6 +24,13 @@ Requirements for the 'simtools-simulate-prod-htcondor-generator' application:
|
|
|
24
24
|
'output_path/env.txt'. Ensure that the path to the simulation software is correctly set to
|
|
25
25
|
'SIMTOOLS_SIMTEL_PATH=/workdir/sim_telarray'.
|
|
26
26
|
|
|
27
|
+
To submit jobs, change to the output directory and run:
|
|
28
|
+
|
|
29
|
+
.. code-block:: console
|
|
30
|
+
|
|
31
|
+
condor_submit simulate_prod.submit
|
|
32
|
+
|
|
33
|
+
Simulation data products will be stored in the output directory.
|
|
27
34
|
|
|
28
35
|
Command line arguments
|
|
29
36
|
----------------------
|
|
@@ -38,6 +38,7 @@ from pathlib import Path
|
|
|
38
38
|
import simtools.utils.general as gen
|
|
39
39
|
from simtools.configuration import configurator
|
|
40
40
|
from simtools.db import db_handler
|
|
41
|
+
from simtools.io import ascii_handler
|
|
41
42
|
from simtools.layout.array_layout_utils import validate_array_layouts_with_db, write_array_layouts
|
|
42
43
|
|
|
43
44
|
|
|
@@ -83,7 +84,7 @@ def main(): # noqa: D103
|
|
|
83
84
|
production_table=db.read_production_table_from_mongo_db(
|
|
84
85
|
collection_name="telescopes", model_version=args_dict["model_version"]
|
|
85
86
|
),
|
|
86
|
-
array_layouts=
|
|
87
|
+
array_layouts=ascii_handler.collect_data_from_file(args_dict["array_layouts"]),
|
|
87
88
|
)
|
|
88
89
|
|
|
89
90
|
write_array_layouts(array_layouts=array_layouts, args_dict=args_dict, db_config=db_config)
|
|
@@ -108,7 +108,7 @@ def main(): # noqa: D103
|
|
|
108
108
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
109
109
|
|
|
110
110
|
output_path = (
|
|
111
|
-
Path(args_dict["output_path"]) / args_dict["
|
|
111
|
+
Path(args_dict["output_path"]) / args_dict["parameter"]
|
|
112
112
|
if args_dict.get("output_path")
|
|
113
113
|
else None
|
|
114
114
|
)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
3
|
r"""
|
|
4
|
-
|
|
4
|
+
Calculate on-axis telescope throughput and NSB pixels rates.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
of
|
|
6
|
+
Uses the sim_telarray tool "testeff" to calculate the camera efficiency.
|
|
7
|
+
The results of telescope throughput including optical and camera components for Cherenkov (left)
|
|
8
|
+
and NSB light (right) as a function of wavelength are plotted. See examples below.
|
|
8
9
|
|
|
9
10
|
.. _validate_camera_eff_plot:
|
|
10
11
|
.. image:: images/validate_camera_efficiency_North-MST-NectarCam-D_cherenkov.png
|
|
@@ -19,7 +20,7 @@ r"""
|
|
|
19
20
|
telescope (str, required)
|
|
20
21
|
Telescope model name (e.g. LSTN-01, SSTS-15)
|
|
21
22
|
model_version (str, optional)
|
|
22
|
-
|
|
23
|
+
Simulation model version
|
|
23
24
|
zenith_angle (float, optional)
|
|
24
25
|
Zenith angle in degrees (between 0 and 180).
|
|
25
26
|
azimuth_angle (float, optional)
|
|
@@ -46,6 +47,7 @@ r"""
|
|
|
46
47
|
import logging
|
|
47
48
|
from pathlib import Path
|
|
48
49
|
|
|
50
|
+
import simtools.data_model.model_data_writer as writer
|
|
49
51
|
import simtools.utils.general as gen
|
|
50
52
|
from simtools.camera.camera_efficiency import CameraEfficiency
|
|
51
53
|
from simtools.configuration import configurator
|
|
@@ -56,8 +58,8 @@ def _parse(label):
|
|
|
56
58
|
config = configurator.Configurator(
|
|
57
59
|
label=label,
|
|
58
60
|
description=(
|
|
59
|
-
"Calculate the camera efficiency
|
|
60
|
-
"Plot the camera efficiency vs wavelength for
|
|
61
|
+
"Calculate the camera efficiency and NSB pixel rates. "
|
|
62
|
+
"Plot the camera efficiency vs wavelength for Cherenkov and NSB light."
|
|
61
63
|
),
|
|
62
64
|
)
|
|
63
65
|
config.parser.add_argument(
|
|
@@ -76,17 +78,22 @@ def _parse(label):
|
|
|
76
78
|
config.parser.add_argument(
|
|
77
79
|
"--skip_correction_to_nsb_spectrum",
|
|
78
80
|
help=(
|
|
79
|
-
"
|
|
81
|
+
"Skip correction to the NSB spectrum to account for the "
|
|
80
82
|
"difference between the altitude used in the reference B&E spectrum and "
|
|
81
83
|
"the observation level at the CTAO sites."
|
|
82
|
-
"This correction is done internally in sim_telarray and is on by default."
|
|
83
84
|
),
|
|
84
85
|
required=False,
|
|
85
86
|
action="store_true",
|
|
86
87
|
)
|
|
88
|
+
config.parser.add_argument(
|
|
89
|
+
"--write_reference_nsb_rate_as_parameter",
|
|
90
|
+
help=("Write the NSB pixel rate obtained for reference conditions as a model parameter "),
|
|
91
|
+
action="store_true",
|
|
92
|
+
required=False,
|
|
93
|
+
)
|
|
87
94
|
_args_dict, _db_config = config.initialize(
|
|
88
95
|
db_config=True,
|
|
89
|
-
simulation_model=["telescope", "model_version"],
|
|
96
|
+
simulation_model=["telescope", "model_version", "parameter_version"],
|
|
90
97
|
simulation_configuration={"corsika_configuration": ["zenith_angle", "azimuth_angle"]},
|
|
91
98
|
)
|
|
92
99
|
if _args_dict["site"] is None or _args_dict["telescope"] is None:
|
|
@@ -98,14 +105,13 @@ def _parse(label):
|
|
|
98
105
|
|
|
99
106
|
def main(): # noqa: D103
|
|
100
107
|
label = Path(__file__).stem
|
|
101
|
-
args_dict,
|
|
108
|
+
args_dict, db_config = _parse(label)
|
|
102
109
|
|
|
103
110
|
logger = logging.getLogger()
|
|
104
111
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
105
112
|
|
|
106
113
|
ce = CameraEfficiency(
|
|
107
|
-
db_config=
|
|
108
|
-
simtel_path=args_dict["simtel_path"],
|
|
114
|
+
db_config=db_config,
|
|
109
115
|
label=args_dict.get("label", label),
|
|
110
116
|
config_data=args_dict,
|
|
111
117
|
)
|
|
@@ -114,6 +120,18 @@ def main(): # noqa: D103
|
|
|
114
120
|
ce.plot_efficiency(efficiency_type="Cherenkov", save_fig=True)
|
|
115
121
|
ce.plot_efficiency(efficiency_type="NSB", save_fig=True)
|
|
116
122
|
|
|
123
|
+
writer.ModelDataWriter.dump_model_parameter(
|
|
124
|
+
parameter_name="nsb_pixel_rate",
|
|
125
|
+
value=ce.get_nsb_pixel_rate(
|
|
126
|
+
reference_conditions=args_dict.get("write_reference_nsb_rate_as_parameter", False)
|
|
127
|
+
),
|
|
128
|
+
instrument=args_dict["telescope"],
|
|
129
|
+
parameter_version=args_dict.get("parameter_version", "0.0.0"),
|
|
130
|
+
output_file=Path(f"nsb_pixel_rate-{args_dict.get('parameter_version', '0.0.0')}.json"),
|
|
131
|
+
output_path=Path(args_dict["output_path"]) / args_dict["telescope"] / "nsb_pixel_rate",
|
|
132
|
+
use_plain_output_path=args_dict.get("use_plain_output_path"),
|
|
133
|
+
)
|
|
134
|
+
|
|
117
135
|
|
|
118
136
|
if __name__ == "__main__":
|
|
119
137
|
main()
|
|
@@ -52,7 +52,7 @@ from pathlib import Path
|
|
|
52
52
|
|
|
53
53
|
import simtools.utils.general as gen
|
|
54
54
|
from simtools.configuration import configurator
|
|
55
|
-
from simtools.
|
|
55
|
+
from simtools.io import io_handler
|
|
56
56
|
from simtools.model.telescope_model import TelescopeModel
|
|
57
57
|
from simtools.visualization import plot_camera, visualize
|
|
58
58
|
|
|
@@ -79,7 +79,7 @@ import numpy as np
|
|
|
79
79
|
|
|
80
80
|
import simtools.utils.general as gen
|
|
81
81
|
from simtools.configuration import configurator
|
|
82
|
-
from simtools.
|
|
82
|
+
from simtools.io import io_handler
|
|
83
83
|
from simtools.model.model_utils import initialize_simulation_models
|
|
84
84
|
from simtools.ray_tracing.ray_tracing import RayTracing
|
|
85
85
|
from simtools.visualization import visualize
|
|
@@ -40,6 +40,7 @@ import simtools.utils.general as gen
|
|
|
40
40
|
from simtools.configuration import configurator
|
|
41
41
|
from simtools.constants import MODEL_PARAMETER_SCHEMA_PATH
|
|
42
42
|
from simtools.data_model import metadata_collector, schema, validate_data
|
|
43
|
+
from simtools.io import ascii_handler
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def _parse(label, description):
|
|
@@ -140,14 +141,17 @@ def validate_dict_using_schema(args_dict, logger):
|
|
|
140
141
|
args_dict.get("file_directory"), args_dict.get("file_name")
|
|
141
142
|
):
|
|
142
143
|
try:
|
|
143
|
-
data =
|
|
144
|
+
data = ascii_handler.collect_data_from_file(file_name=file_name)
|
|
144
145
|
except FileNotFoundError as exc:
|
|
145
146
|
raise FileNotFoundError(f"Error reading schema file from {file_name}") from exc
|
|
146
147
|
data = data if isinstance(data, list) else [data]
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
try:
|
|
149
|
+
for data_dict in data:
|
|
150
|
+
schema.validate_dict_using_schema(
|
|
151
|
+
data_dict, _get_schema_file_name(args_dict, data_dict)
|
|
152
|
+
)
|
|
153
|
+
except Exception as exc:
|
|
154
|
+
raise ValueError(f"Validation of file {file_name} failed") from exc
|
|
151
155
|
logger.info(f"Successful validation of file {file_name}")
|
|
152
156
|
|
|
153
157
|
|
|
@@ -75,7 +75,7 @@ from matplotlib.backends.backend_pdf import PdfPages
|
|
|
75
75
|
|
|
76
76
|
import simtools.utils.general as gen
|
|
77
77
|
from simtools.configuration import configurator
|
|
78
|
-
from simtools.
|
|
78
|
+
from simtools.io import io_handler
|
|
79
79
|
from simtools.model.model_utils import initialize_simulation_models
|
|
80
80
|
from simtools.ray_tracing.ray_tracing import RayTracing
|
|
81
81
|
from simtools.visualization import visualize
|