bsrn.dataset.BSRNDataset.from_file#
- classmethod BSRNDataset.from_file(path, include_lrs=None, strict=False)[source]#
Parse a BSRN
.dat.gzstation-to-archive file and return a fully validatedBSRNDataset.- Parameters:
path (str or Path) – Path to the
.dat.gzfile (filename formatXXXMMYY.dat.gz).include_lrs (sequence of str or 'all', optional) – Logical records to parse. Supports
'lr0100'(required),'lr0300','lr4000', and'lr0001'. DefaultNoneparses all supported records.strict (bool, optional) – Passed to
read_bsrn_archive(). IfTrue, malformed optional LR blocks raise. IfFalse(default), malformed optional LRs are returned asNone.
- Return type:
- Raises:
FileNotFoundError – If path does not exist.
ValueError – If the filename cannot be parsed or no LR0100 block is found.