Cli
Upload data sets to MAST, the Mikulski Archive for Space Telescopes.
This module defines a command-line interface to upload operations. Its functions cannot usefully be used as part of a larger program. The other modules in this subpackage define a Pythonic interface that can be used by other programs.
BytesWithScaleParamType
Bases: ParamType
Shim between click and utilz.numeric.parse_bytes_with_scale.
check_label
check_label(label: Path) -> None
Checks a label for syntactic validity.
checksum
checksum(*, source: str, index_file: Path, output: Path = Path('index.csv')) -> None
Add CRC32 checksums to an existing index file.
index
index(*, source: str, output: Path = Path('index.csv'), make_checksums: bool = False, label: Path | None = None) -> None
Create an index file suitable for use with other mast-upload commands. If -c / --make-checksums is passed, also calculate CRC32 checksums for each indexed file. (Checksum creation is not supported for S3 objects.)
If
By default, this command indexes all standard files/objects under
main
main() -> None
Upload data sets to MAST, the Mikulski Archive for Space Telescopes.
populate_label
populate_label(*, source: str, label: Path, output: Path, filetype_names: str | None) -> None
Populate (or repopulate) the filetypes section of a label by analyzing
files in <source> is either the root directory of a tree
under which your files are located or a prefix on an S3 bucket under which
your files are located. S3 addresses must be preceded with 's3://'.
Filename patterns and standards must be defined for
each filetype, or the application will not be able to identify which
files should go with which filetype and, if relevant, what data-level
analysis to perform on those files. populate_label() will
populate everything it can. Some highly complex or variable filetypes may
not be describable by populate_label(); such filetypes must be defined
manually if data-level validation past standard conformance is desired.
In any case, it is best to manually review the generated file
specifications and to check them against local validation commands.
report_filetypes
report_filetypes(*, source: str, label: Path, output: Path = Path('filetypes.csv')) -> None
Write a CSV file containing matching filetypes as described in
Also prints a warning if any files are matched by more than one filetype (this is an invalid condition for transfer / description / validation).
transfer
transfer(*, source: str, label: Path, index_file: Path, sample: bool) -> None
Upload a data set to MAST.
If the upload is interrupted or stops due to validation errors, you can simply repeat the command to resume from where it left off, after fixing any validation problems.
validate
validate(*, file: str, label: Path, object_check_hook: bool) -> None
Validate an individual file against a label. This command confirms that the label itself is valid and that the filename matches exactly one filetype defined in the label. If the file standard supports data validation (FITS, ASDF, or Parquet), the command will furthermore confirm that it conforms to the file standard and, if data objects are defined in the label, that it conforms to that specification.
validate_all
validate_all(*, source: str, label: Path, index_file: Path | None = None, object_check_hook: bool = True) -> None
Validate all files under
If index command.
Paths in
This command confirms that the label itself is valid and that each filename matches exactly one filetype defined in the label. If a file standard supports data validation (FITS, ASDF, or Parquet), the command will furthermore confirm that it conforms to the file standard and, if data objects are defined in the label, that it conforms to that definition.