chromag package

Submodules

chromag.cli module

chromag.cli.cat module

Create and handle cat sub-command.

chromag.cli.cat.add_cat_subcommand(subparsers)[source]

Add cat subcommand to the argparse subparsers.

chromag.cli.cat.cat_header(files, quiet, parser)[source]

Display the contents of a header for a list of files.

chromag.cli.cat.cat_subcommand(args)[source]

Main routine to handle keyword arguments and dispatch the work.

chromag.cli.eod module

chromag.cli.helper module

chromag.cli.helper.add_run_arguments(parser)[source]

Helper routine to add dates and flags arguments for a subcommand.

chromag.cli.helper.increment_date(date)[source]
chromag.cli.helper.split_dates(date_expr, error)[source]

chromag.cli.log module

chromag.cli.ls module

chromag.config module

chromag.datetime module

Utilities for handling dates/times.

chromag.datetime.dateobs2datetime(date_obs: str) datetime[source]

Convert DATE-OBS format string representing date/time to a Python datetime object.

chromag.datetime.datetime2dateobs(dt: datetime, no_milliseconds=False) str[source]

Convert a Python datetime object to a string in DATE-OBS format, with milliseconds, or optionally without the milliseconds.

chromag.datetime.human_timedelta(timedelta)[source]

Create a human-readable string for a timedelta, for example, like “2 days 4 hrs 10 mins 5 secs”.

chromag.eod module

chromag.eod.inventory module

chromag.eod.l1_process module

chromag.eod.l2_process module

chromag.epochs module

chromag.file module

chromag.lines module

chromag.logging module

Module containing helper functions for logging.

class chromag.logging.WrappedFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Custom formatter, overrides funcName with value of funcName_override if it exists.

format(record: LogRecord)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

chromag.logging.get_level(level_name: str)[source]

Convert a string name to a logging level constant value.

level_namestr

case insensitive level name: CRITICAL, ERROR, WARN, WARNING, INFO, DEBUG

chromag.logging.rotate_logs(basename: str, max_version: int | None = None)[source]

Rotate logs to allow a new log to be written as basename. If max_version is given, delete logs with given basename and versions beyond the max_version.

Note: no rotating or pruning done if basename doesn’t already exist.

basenamestr

log base filename, i.e., without a “.x”

max_versionint

largest allowable version, set to 0 not keep any versions

chromag.logging.setup_logging(filename: str, level: int = 10, rotate: bool = True, max_version: int | None = None) Logger[source]

Configure the logging system.

chromag.pipeline module

Class for representing a pipeline run, decorator for pipeline steps, etc.

class chromag.pipeline.Run(date: str, mode: str, logger: Logger)[source]

Bases: object

property catalog
property photometric_calibration
chromag.pipeline.step()[source]

chromag.plot module

Handle plotting.

chromag.plot.housekeeping module

chromag.string_helpers module

String helper routines.

chromag.string_helpers.truncate(s: str, max_length: int, continuation_chars: str = '...', padding: bool = False)[source]

Truncate a string to a length if necessary, but indicate truncated strings with the given characters. Also, pad with spaces to max_length if padding is set.

chromag.validate module

Module contents

Top-level package for ChroMag parser.