lsst.pipe.tasks gcf790cdeb6+0604939b8f
Loading...
Searching...
No Matches
lsst.pipe.tasks.ssp.felis Namespace Reference

Functions

str _timestamp_precision_to_unit (int prec)
 
tuple[str, Any] _felis_column_to_numpy_dtype (Mapping[str, Any] col)
 
np.dtype felis_table_to_numpy_dtype (Mapping[str, Any] table)
 
str pretty_print_dtype (np.dtype dtype, str table_name, int target_comment_col=36, int max_line_length=110)
 
 main ()
 

Variables

list DEFAULT_TABLES = ["SSObject", "SSSource", "mpc_orbits", "current_identifications", "numbered_identifications"]
 

Function Documentation

◆ _felis_column_to_numpy_dtype()

tuple[str, Any] lsst.pipe.tasks.ssp.felis._felis_column_to_numpy_dtype ( Mapping[str, Any] col)
protected

Definition at line 35 of file felis.py.

◆ _timestamp_precision_to_unit()

str lsst.pipe.tasks.ssp.felis._timestamp_precision_to_unit ( int prec)
protected
Map a Felis timestamp precision to a numpy datetime64 unit.

prec = number of decimal places of seconds to retain.

Definition at line 16 of file felis.py.

◆ felis_table_to_numpy_dtype()

np.dtype lsst.pipe.tasks.ssp.felis.felis_table_to_numpy_dtype ( Mapping[str, Any] table)
Convert a Felis table definition (YAML → dict) into a NumPy dtype.
Metadata stored:

    dtype.metadata["description"] = table description
    dtype.metadata["columns"]     = {name: "[unit] description"}

Definition at line 96 of file felis.py.

◆ main()

lsst.pipe.tasks.ssp.felis.main ( )

Definition at line 298 of file felis.py.

◆ pretty_print_dtype()

str lsst.pipe.tasks.ssp.felis.pretty_print_dtype ( np.dtype dtype,
str table_name,
int target_comment_col = 36,
int max_line_length = 110 )
Pretty-print a structured NumPy dtype (with Felis-derived metadata)
as valid, readable Python code:

    # Wrapped table description...
    #
    <table_name>Dtype = np.dtype([
        ('field1', '<i8'),         # comment...
        ('very_long_field', ...    # comment juts, next long field aligned
                                   # to same jutter column...
    ])

Parameters
----------
dtype : np.dtype
    Structured dtype with metadata fields:
        metadata["description"]  : table-level description (optional)
        metadata["columns"]      : {col_name: per-column description}
table_name : str
    Name used for the assignment, e.g. <table_name>Dtype.
target_comment_col : int, default=36
    Preferred starting column for comments when the field fits before it.
    If the field text is longer than this, a "juttering group" alignment
    logic kicks in to prevent jagged right edges.
max_line_length : int, default=110
    Maximum line length for wrapping table descriptions and comments.
    Lines will be wrapped to be strictly less than this length.

Behavior
--------
* Table description is wrapped to < max_line_length chars, placed above
  dtype assignment, followed by a blank line.
* Field comments:
    - If the field length <= target_comment_col - 1 → comment starts at
      target_comment_col, and the "juttering group" resets.
    - If the field length >= target_comment_col → the comment "juts out".
        + First such field sets the group's jutter column.
        + Next juttering fields use max(previous_jut_col, natural_jut_col).
        + This avoids jaggedness.
* Final lines never exceed max_line_length - 1 chars.
* Per-field comments wrap into at most 2 lines, with "..." if needed.
* dtype.metadata is NOT emitted; only used for comments.

Returns
-------
str
    Pretty Python code string.

Definition at line 143 of file felis.py.

Variable Documentation

◆ DEFAULT_TABLES

list lsst.pipe.tasks.ssp.felis.DEFAULT_TABLES = ["SSObject", "SSSource", "mpc_orbits", "current_identifications", "numbered_identifications"]

Definition at line 10 of file felis.py.