TableColumnModel#

pydantic model lsst.images.serialization.TableColumnModel#

Model for a subset of the ASDF table/column schema.

Parameters:

data (Any)

Fields:
field data: InlineArrayModel | ArrayReferenceModel [Required]#

Column data.

field description: str = ''#

Extended description of the column.

field meta: dict[str, int | float | str | bool | None] [Optional]#

Free-form metadata for the column.

field name: str [Required]#

Name of the column.

field unit: Unit | None = None#

Units of the column.

classmethod from_column(column, inline=False)#

Extract a column definition and (optionally) data from an Astropy column.

Parameters:
  • column (Column) – Astropy column to describe.

  • inline (bool, default: False) – If True, store the column data inline instead of as an array reference.

Return type:

TableColumnModel

Notes

When inline=False`, this sets the `data` field to an `ArrayReferenceModel` with ``source set to an empty string. This will need to be modified later.

classmethod from_record_array(array, inline=False)#

Extract a list of column definitions from a structured numpy array.

Parameters:
  • array (ndarray) – A table-like array.

  • inline (bool, default: False) – Whether to store the array data directly in the columns.

Return type:

list[TableColumnModel]

Notes

When inline=False, this sets the data field to an ArrayReferenceModel with source set to an empty string. This will need to be modified later.

classmethod from_record_dtype(dtype)#

Extract a list of column definitions from a structured numpy dtype.

Parameters:

dtype (TypeAliasType) – Object convertible to numpy.dtype.

Return type:

list[TableColumnModel]

Notes

This sets the data field to an ArrayReferenceModel with source set to an empty string. This will need to be modified later.

classmethod from_table(table, inline=False)#

Extract column definitions and (optionally) data from an Astropy table.

Parameters:
  • table (Table) – Astropy table whose columns are described.

  • inline (bool, default: False) – If True, store the column data inline instead of as an array reference.

Return type:

list[TableColumnModel]

update_table(table)#

Update the unit and description of an astropy column from this object.

Parameters:

table (Table) – Astropy table whose matching column is updated in place.

Return type:

None

This page was last modified on .