FITSIndexWriter

class lstchain.tools.lstchain_create_dl3_index_files.FITSIndexWriter(**kwargs: Any)

Bases: Tool

Attributes Summary

aliases

description

example

file_pattern

File pattern to search in the given Path

flags

input_dl3_dir

Input path of DL3 files

name

output_index_path

Output path for the Index files

overwrite

If True, overwrites existing output file without asking

Methods Summary

finish()

Finish up.

setup()

Set up the tool.

start()

Main function of the tool.

Attributes Documentation

aliases: StrDict = {('d', 'input-dl3-dir'): 'FITSIndexWriter.input_dl3_dir', ('o', 'output-index-path'): 'FITSIndexWriter.output_index_path', ('p', 'file-pattern'): 'FITSIndexWriter.file_pattern'}
description: str | Unicode[str, str | bytes] = '\nCreate HDU index files for HDU tables and Obs tables,\nfrom a given path of DL3 files and a glob pattern to select DL3 files\nThe index filenames are the standard as per\nhttp://gamma-astro-data-formats.readthedocs.io/en/latest/\n\nThe Index files can be stored in a different path, but by default\nthey are stored at the same place as the DL3 files.\n'
example = '\n    To create DL3 index files with default values:\n    > lstchain_create_dl3_index_files\n        -d /path/to/DL3/files/\n\n    Or specify some more configurations:\n    > lstchain_create_dl3_index_files\n        -d /path/to/DL3/files/\n        -o /path/to/DL3/index/files\n        -p "dl3*[run_1-run_n]*.fits"\n        --overwrite\n\n    Or if the DL3 files are stored in sub-directories:\n    > lstchain_create_dl3_index_files\n       -d /path/to/DL3/files/\n       -o /path/to/DL3/index/files\n       -p "/sub-directory*/dl3*[run_1-run_n]*.fits"\n       --overwrite\n\n    Or if the DL3 files are stored in the current directory:\n    > lstchain_create_dl3_index_files\n       -d ./\n       -o ./\n       -p "dl3*[run_1-run_n]*.fits"\n       --overwrite\n    '
file_pattern

File pattern to search in the given Path

flags: StrDict = {'overwrite': ({'FITSIndexWriter': {'overwrite': True}}, 'overwrite output files if True')}
input_dl3_dir

Input path of DL3 files

name: str | Unicode[str, str | bytes] = 'FITSIndexWriter'
output_index_path

Output path for the Index files

overwrite

If True, overwrites existing output file without asking

Methods Documentation

finish()

Finish up.

This is called automatically after Tool.start when Tool.run is called.

setup()

Set up the tool.

This method runs after the configuration and command line options have been parsed.

Here the tool should construct all Components, open files, etc.

start()

Main function of the tool.

This is automatically called after Tool.initialize when Tool.run is called.