stilts_wrapper.match_configurator
- class CatMatcher.match_configurator.MatchConfigurator(file_list, file_path, match_radius, match_values='RA DEC', output_mode='out', output_file_name='matched.csv', command_file_name='Nmatch_commands', cwd='CatMatcher_cwd', matcher='sky', multimode='group', join_mode='match', runner='parallel', progress='time', fixcols='dups', reference_file=None, suffix_list=None, iref=None, input_command=None, output_command=None, ifmt=None, ofmt=None)[source]
Bases:
objectA configuration class for managing file matching operations using STILTS (Starlink Tables Infrastructure Library Tool Set).
This class prepares and validates input parameters, infers file formats, and sets up a working directory structure for matching catalog files based on various configuration options.
The first 3 listed attributes need to be defined by the user, whereas all others are either optional or set to default values.
- Parameters:
file_list (list | str)
file_path (str)
match_radius (float)
match_values (str | list)
output_mode (str)
output_file_name (str)
command_file_name (str)
cwd (str)
matcher (Literal['sky', 'skyerr', 'exact'])
multimode (Literal['pairs', 'group'])
join_mode (Literal['default', 'match', 'nomatch', 'always'])
runner (Literal['parallel', 'parallel-all', 'sequential', 'classic', 'partest'])
progress (Literal['none', 'log', 'time', 'profile'])
fixcols (Literal['none', 'dups', 'all'])
reference_file (str | None)
suffix_list (list | None)
iref (str | None)
input_command (str | None)
output_command (str | None)
ifmt (Literal['colfits', 'csv', 'ecsv', 'fits', 'tst', 'votable'] | None)
ofmt (Literal['colfits', 'csv', 'ecsv', 'fits', 'tst', 'votable'] | None)
- file_list
List of input file names. Alternatively, a single file as a string, but note that this can only be used when a separate reference file is provided. :no-index:
- Type:
Union[list, str]
- file_path
Path at which the input files are located.
- Type:
str
- match_radius
Matching radius for positional matching, in arcseconds.
- Type:
float
- match_values
Columns used for matching, default “RA DEC”. If the match columns are not identical across all input columns, a list with all the column names, in the same order as the file_list, needs to be provided.
- Type:
Union[str, list], optional
- output_mode
Output mode for the matcher tool. Currently frozen to one specific mode.
- Type:
str, fixed
- output_file_name
Name of the output file to write matched results, including the desired file type. See imft or ofmt for supported filetypes. (Default: “matched.csv)
- Type:
str, optional
- command_file_name
Name of the command file used to run matching, without suffix. (Default: Nmatch_commands)
- Type:
str, optional
- cwd
Name of the directory where matching outputs and scripts will be saved.
- Type:
str, optional
- matcher
Type of matching engine to use. (Default: “sky”)
- Type:
Literal, [“sky”, “skyerr”, “exact”]
- multimode
Matching mode, either “pairs” or “group”. (Default: “group”)
- Type:
Literal, [“pairs”, “group”]
- join_mode
How results are joined across matched/unmatched catalogs. (Default: “match”)
- Type:
Literal, [“default”, “match”, “nomatch”, “always”]
- runner
Execution mode for the STILTS matcher. (Default: “parallel”)
- Type:
Literal, [“parallel”, “parallel-all”, “sequential”, “classic”, “partest”]
- progress
Logging/progress output during matching. (Default: “time”)
- Type:
Literal, [“none”, “log”, “time”, “profile”]
- fixcols
Determines how input columns are renamed in the output table, according to the suffix_list parameters. If “none”, no columns are renamed, if “dups” only columns which would otherwise have duplicate names in the output are renamed, if “all” every column will be renamed.
- Type:
Literal, [“none”, “dups”, “all”]
- reference_file
Optional reference file for input format inference. If provided, a single string input for file_list is acceptable.
- Type:
Optional[str], optional
- suffix_list
Optional list of suffixes for identifying files. If None, suffixes will be numeric indices _1, _2,… according to the order of the file_list.
- Type:
Optional[list], optional
- iref
If multimode=”pairs” this parameter gives the index of the table in the file_list, which serves as the reference table, i.e. must be matched by other tables.
- Type:
Optional[int], optional
- input_command
Custom command string indicating actions to be performed on columns of all input tables.
- Type:
Optional[str], optional
- output_command
Custom command string indicating actions to be performed on columns of the output table.
- Type:
Optional[str], optional
- ifmt
Input format(s) for catalog files. Accepted formats are: [“colfits”, “csv”, “ecsv”, “fits”, “tst”, “votable”]. If not provided, they will be inferred from the file_list.
- Type:
Optional[list or Literal], [“colfits”, “csv”, “ecsv”, “fits”, “tst”, “votable”]
- ofmt
Output format for result file. Accepted formats are: [“colfits”, “csv”, “ecsv”, “fits”, “tst”, “votable”]. If not provided, it will be inferred from the output_file_name.
- Type:
Optional[Literal], [“colfits”, “csv”, “ecsv”, “fits”, “tst”, “votable”]