Station-to-archive (LR)#

Logical-record specifications, validation, and string formatting for BSRN station-to-archive .dat files. For reading parsed LR data into pandas, see read_station_to_archive() in I/O Operations. A minimal writing walk-through is in Writing a station-to-archive .dat file.

The concrete LR* types are Pydantic v2 models (pydantic.BaseModel subclasses). Field layout and Fortran-width metadata come from LR_SPECS; each field’s validate_func name resolves to a callable in bsrn.archive.validation.

Core#

bsrn.archive.ArchiveRecordBase()

Base class for archive LRs: Pydantic BaseModel plus ArchiveFormatMixin for Fortran-width ASCII output.

bsrn.archive.get_azimuth_elevation([...])

Format horizon azimuth/elevation lists for LR0004.

Field helpers (records_models / records_base)#

bsrn.archive.records_models.lr_spec(lr, ...)

One logical-record field: Annotated + AfterValidator + Field from LR_SPECS.

bsrn.archive.records_models.lr_spec_field(lr, ...)

Pydantic Field with LR_SPECS archive metadata (minute columns, Fortran layout).

bsrn.archive.records_base.make_archive_after_validator(...)

Build a unary callable for pydantic.functional_validators.AfterValidator.

Logical record classes#

bsrn.archive.LR0001(*, stationNumber, month, ...)

bsrn.archive.LR0002(*[, scientistChange, ...])

bsrn.archive.LR0003(*[, message])

bsrn.archive.LR0004(*[, stationDescChange, ...])

bsrn.archive.LR0005(*[, change, changeDay, ...])

bsrn.archive.LR0006(*[, change, changeDay, ...])

bsrn.archive.LR0007(*[, change, changeDay, ...])

bsrn.archive.LR0008(*[, change, changeDay, ...])

bsrn.archive.LR0100(*, yearMonth[, ghi_avg, ...])

Minute-resolution archive block; series columns accept pandas.Series or numpy.ndarray.

bsrn.archive.LR4000(*, yearMonth[, ...])

LR4000 pyrgeometer minute block; series columns accept pandas.Series or numpy.ndarray.

bsrn.archive.LR4000CONST(*, ...[, ...])

Each LR* model implements get_bsrn_format for archive text; get_azimuth_elevation is defined alongside those helpers in bsrn.archive.archive_lr_formats.

Metadata and lookup tables#

bsrn.archive.LR_SPECS

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.STATION_METADATA

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.TOPOGRAPHIES

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.SURFACES

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.QUANTITIES

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.PYRGEOMETER_BODY

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

bsrn.archive.PYRGEOMETER_DOME

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

Submodules#

bsrn.archive.archive_lr_formats

get_bsrn_format implementations for Pydantic archive logical-record models.

bsrn.archive.records_base

Shared Pydantic base classes for BSRN logical records.

bsrn.archive.records_models

Explicit Pydantic logical-record models aligned with specs.LR_SPECS.

bsrn.archive.specs

bsrn.archive.specs

bsrn.archive.validation

BSRN station-to-archive field validators.