nectarchain.makers.calibration.calibration_pipeline.PipelineNectarCAMCalibrationTool#
- class PipelineNectarCAMCalibrationTool(*args, **kwargs)[source]#
Bases:
NectarCAMCalibrationToolOrchestrates pedestal, gain, HiLo, and flatfield calibrations in sequence.
Runs multiple calibration subtools and merges their outputs into a single Category A calibration file.
Initialize the pipeline tool and set up subtool output directories.
- Parameters:
- *argstuple
Positional arguments passed to the parent initializer.
- **kwargsdict
Keyword arguments passed to the parent initializer.
Methods
add_componentconstructs and adds a component to the list of registered components, so that later we can ask for the current configuration of all instances, e.g. in`get_full_config()`.
add_traitsDynamically add trait attributes to the HasTraits instance.
check_outputTest if output files exist and if they do, throw an error unless
self.overwriteis set to True.class_config_rst_docGenerate rST documentation for this class' config options.
class_config_sectionGet the config section for this class.
class_get_helpGet the help string for this class in ReST format.
class_get_trait_helpGet the helptext string for a single trait.
class_own_trait_eventsGet a dict of all event handlers defined on this class, not a parent.
class_own_traitsGet a dict of all the traitlets defined on this class, not a parent.
class_print_helpGet the help string for a single trait and print it.
class_trait_namesGet a list of all the names of this class' traits.
class_traitsGet a
dictof all the traits of this class.clear_instanceunset _instance for this class and singleton parents.
close_handlersdocument_config_optionsGenerate rST format documentation for the config options this application
emit_alias_helpYield the lines for alias part of the help.
emit_descriptionYield lines with the application description.
emit_examplesYield lines with the usage and examples.
emit_flag_helpYield the lines for the flag part of the help.
emit_helpYield the help-lines for each Configurable class in self.classes.
emit_help_epilogueYield the very bottom lines of the help message.
emit_options_helpYield the lines for the options part of the help.
emit_subcommands_helpYield the lines for the subcommand part of the help.
enter_contextAdd a new context manager to the
ExitStackof this ToolexitFinalize the calibration pipeline.
flatten_flagsFlatten flags and aliases for loaders, so cl-args override as expected.
generate_config_filegenerate default config file from Configurables
get_current_configreturn the current configuration as a dict (e.g. the values of all traits, even if they were not set during configuration).
get_default_logging_configReturn the base logging configuration.
has_traitReturns True if the object has a trait with the specified name.
hold_trait_notificationsContext manager for bundling trait change notifications and cross validation.
initializeHandle config and any other low-level setup.
initialize_subcommandInitialize a subcommand with argv.
initializedHas an instance been created?
instanceReturns a global instance of this class.
launch_instanceLaunch a global instance of this Application
load_config_environLoad config files by environment.
load_config_fileLoad a configuration file in one of the supported formats, and merge it with the current config if it exists.
load_runStatic method to load from $NECTARCAMDATA directory data for specified run with max_events.
notify_changeNotify observers of a change event
observeSetup a handler to be called when a trait changes.
on_trait_changeDEPRECATED: Setup a handler to be called when a trait changes.
parse_command_lineParse the command line arguments.
print_alias_helpPrint the alias parts of the help.
print_descriptionPrint the application description.
print_examplesPrint usage and examples (see
emit_examples()).print_flag_helpPrint the flag part of the help.
print_helpPrint the help for each Configurable class in self.classes.
print_optionsPrint the options part of the help.
print_subcommandsPrint the subcommand part of the help.
print_versionPrint the version string.
runRun the tool.
section_namesreturn section names as a list
set_traitForcibly sets trait attribute, including read-only attributes.
Configure and initialize all calibration subtools.
setup_instancesplit_runMethod to decide if criteria to end a run slice are met
Run all calibration subtools in sequence.
start_show_configstart function used when show_config is True
trait_defaultsReturn a trait's default value or a dictionary of them
trait_eventsGet a
dictof all the event handlers of this class.trait_has_valueReturns True if the specified trait has a value.
trait_metadataGet metadata values for trait by key.
trait_namesGet a list of all the names of this class' traits.
trait_valuesA
dictof trait names and their values.traitsGet a
dictof all the traits of this class.unobserveRemove a trait change handler.
unobserve_allRemove trait change handlers of any type for the specified name.
update_configUpdate config and load the new values
update_logging_configUpdate the configuration of loggers.
write_provenanceAttributes
Run number for gain calibration at very-high voltage using SPE-fit method
Run number for gain calibration at nominal voltage using SPE-fit method
Run number for flat-field calibration
Path to SPE-fit result at very-high voltage
aliasesOption to create a calibration file with only default calibration coefficients
argvAn instance of a Python list.
cameracamera for which the data will be processed
classescli_configThe subset of our configuration that came from the command-line
componentsListList of Component names to be apply, the order will be respected.
configA trait whose value must be an instance of a specified class.
config_filesList of configuration files with parameters to load in addition to command-line parameters.
cross_validation_lockA contextmanager for running a block with our cross validation lock set to True.
descriptionevent_sourceGetter method for the _event_source attribute.
events_per_slicenumber of events that will be treat before to pull the buffer and writeto disk, if None, all the events will be loaded
examplesextra_argsAn instance of a Python list.
flagsName of tool to use for the flatfield calibration
Name of tool to use for the gain calibration
Name of tool to use for the HiLo
keyvalue_descriptionA trait for unicode strings.
loaded_config_filesCurrently loaded configuration files
logLogger or LoggerAdapter instance
log_configAn instance of a Python dict.
log_datefmtThe date format used by logging formatters for
logging.Formatterdatefmtparameterlog_fileFilename for the log
log_file_levelLogging Level for File Logging
log_formatThe Logging format template
log_levelSet the log level by value or name.
logging_configConfigure additional log handlers.
max_eventsmaximum number of events to be loaded
namenpixelsGetter method for the npixels attribute.
option_descriptionA trait for unicode strings.
Format of the category A calibration file
output_pathoutput filename
overwriteA boolean (True, False) trait.
parentA trait whose value must be an instance of a specified class.
Run number for pedestal calibration
Name of tool to use for the pedestal calibration
pixels_idthe list of pixel id to apply the components
progress_barshow progress bar during processing
provenance_logA path Trait for input/output files.
quietA boolean (True, False) trait.
raise_config_file_errorsA boolean (True, False) trait.
run_filefile name to be loaded
run_numberrun number to be treated
save_tmpshow_configInstead of starting the Application, dump configuration to stdout
show_config_jsonInstead of starting the Application, dump configuration to stdout (as JSON)
subappA trait whose value must be an instance of a specified class.
subcommand_descriptionA trait for unicode strings.
subcommandsAn instance of a Python dict.
tel_idGetter method for the tel_id attribute.
use_lightevtsourceIndicate to use the LightNectarCAMEventSource or not.If True, no FEB info is loaded (faster).
versionA trait for unicode strings.
version_stringa formatted version string with version, release, and git hash
- FF_SPE_HHV_run_number#
Run number for gain calibration at very-high voltage using SPE-fit method
- FF_SPE_run_number#
Run number for gain calibration at nominal voltage using SPE-fit method
- FF_run_number#
Run number for flat-field calibration
- SPE_HHV_result_path#
Path to SPE-fit result at very-high voltage
- all_default#
Option to create a calibration file with only default calibration coefficients
- finish()[source]#
Finalize the calibration pipeline.
Reads per-subtool results (or fills default values), converts them to ctapipe containers, writes the Category A calibration file, and optionally removes temporary subtool results.
- flatfield_tool_name#
Name of tool to use for the flatfield calibration
- gain_tool_name#
Name of tool to use for the gain calibration
- hilo_tool_name#
Name of tool to use for the HiLo
- output_format#
Format of the category A calibration file
- ped_run_number#
Run number for pedestal calibration
- pedestal_tool_name#
Name of tool to use for the pedestal calibration
- setup(*args, **kwargs)[source]#
Configure and initialize all calibration subtools.
Instantiates the pedestal, gain, HiLo, and flatfield tools with their respective run numbers, validates the output format, and ensures consistent telescope IDs across subtools.
- Parameters:
- *argstuple
Positional arguments passed to the parent setup.
- **kwargsdict
Keyword arguments passed to the parent setup.