fitsmgmt.io.inputs2list

fitsmgmt.io.inputs2list(
    inputs,
    sort=True,
    accept_ccdlike=True,
    path_to_text=False,
    check_coherency=False,
)

Normalize file, table, and CCD-like inputs to a list.

Parameters

inputs : str, path-like, CCD-like, table-like, or sequence

A glob pattern, path, sequence of paths/CCD-like objects, or a table-like object with a "file" column. A string beginning with "@" is read as a newline-separated IRAF-style list file.

sort : bool = True

Sort path results. Default: True.

accept_ccdlike : bool = True

Accept a CCD-like object as a single-item list. If False, such input raises TypeError. Default: True.

path_to_text : bool = False

Convert path-like entries in a sequence to strings instead of Path objects. Default: False.

check_coherency : bool = False

Require every item in a sequence to have the type of the first item. Default: False.

Returns

: list or None

Normalized inputs, or None when inputs is None.

Raises

: KeyError

A table-like input has no "file" column.

: TypeError

A CCD-like object is rejected or an unsupported input type is given.