PatchAttrs

class of dascore.core.attrs
inherits from: DascoreBaseModel, pydantic.main.BaseModel
source

PatchAttrs(
    data_type: Literal[’‘, ’velocity’, ‘strain_rate’, ‘phase’, ‘strain’, ‘temperature’, ‘temperature_gradient’] = ““,
    data_category: Literal[’‘, ’DAS’, ‘DTS’, ‘DSS’] =”“,
    data_units: Quantity | str | None = None,
    instrument_id: str =”“,
    acquisition_id: str =”“,
    tag: str =”“,
    station: str =”“,
    network: str =”“,
    history: str | tuple[str, tuple[str, …]] = None,
    dims: str =”“,
    coords: dascore.utils.mapping.FrozenDict[str, CoordSummary] = None,
    **extra_data ,
)-> None

The expected attributes for a Patch.

The default attributes are:

attribute description
data_type Describes the quantity being measured.
data_category Describes the type of data.
data_units The units of the data measurements
instrument_id A unique id for the instrument which generated the data.
acquisition_id A unique identifier linking this data to an experiment.
tag A custom string field.
station A station code.
network A network code.
history A list of processing performed on the patch.
dims A tuple of comma-separated dimensions names.

Methods

Name Description
coords_from_dims Return coordinates from dimensions assuming evenly sampled.
drop_private Drop all private attributes.
flat_dump Flatten the coordinates and dump to dict.
from_dict Get a new instance of the PatchAttrs.
get dict-like get method.
items Yield (attribute, values) just like dict.items().
check_time_units Ensure time units are s if dattype is time-like.
new Create new instance with some attributed updated.
parse_coord_attributes Parse the coordinate attributes into coord dict.
rename_dimension Rename one or more dimensions if in kwargs. Return new PatchAttrs.
update Update an attribute in the model, return new model.
check_time_units Ensure time units are s if dattype is time-like.