PatchAttrs

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

PatchAttrs(
    data_type: Literal[’‘, ’displacement’, ‘velocity’, ‘acceleration’, ‘strain_rate’, ‘phase’, ‘phase_difference’, ‘phase_rate’, ‘strain’, ‘temperature’, ‘temperature_gradient’, ‘brillouin_spectrum’, ‘fourier_transform’, ‘amplitude_spectrum’, ‘power_spectrum’, ‘power_spectral_density’, ‘frequency_band_energy’, ‘stalta’, ‘kurtosis’, ‘envelope’, ‘correlation’, ‘tau_p’, ‘dispersion’, ‘phase_weighted_stack’, ‘otdr’] = ““,
    data_category: Literal[’‘, ’DAS’, ‘DTS’, ‘DSS’] =”“,
    data_units: Quantity | str | None = None,
    acquisition_key: str =”“,
    tag: str =”“,
    history: str | tuple[str, tuple[str, …]] = ,
    origin_id: str =”“,
    data_id: str =”“,
    **extra_data ,
)-> None

The expected attributes for a Patch.

PatchAttrs stores non-structural metadata. Nested coordinate payloads in coords are rejected, while flat coord-like keys are treated like any other extra attrs. dims is ignored during normalization.

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
acquisition_key Inventory identity of the data source, spelled network.fiber_array.location.acquisition.
tag A custom string field.
history A list of processing performed on the patch.
origin_id Identifies which stored data this came from. It survives every operation, and changes only when data from more than one origin is combined.
data_id Identifies which array this is: its origin’s id until an operation runs, then an id derived from the inputs’ ids and the operation, so equal ids mean the same route from the same data.

Methods

Name Description
drop Drop specific keys if they exist.
drop_private Drop all private attributes.
flat_dump Dump attrs to a flat dict.
get dict-like get method.
from_dict Get a new instance of the PatchAttrs.
items Yield (attribute, values) just like dict.items().
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
reject_coordinate_attributes Reject nested coord payloads and ignore structural dims input.
update Update an attribute in the model, return new model.