prophys.io

prophys.io#

Reading measurement records into prophys objects.

Turns the formats study data arrives in (a CSV of laboratory results with non detects, a wind rose, a GeoTIFF of terrain, a NetCDF reanalysis extract) into the objects the rest of the package consumes. See prophys.io.tabular for the readers.

The CSV, table and wind rose readers need nothing beyond NumPy. The raster and NetCDF readers need the geo extra and say so when it is missing.

Classes

Column

One parsed column of a table: its values, unit and which entries are missing or censored.

Functions

read_csv

Read numeric columns out of a delimited text file.

read_table

Parse rows held in memory into columns, the counterpart of read_csv().

read_observations

Read one column of a CSV file as an Observations record ready to fit.

read_wind_rose

Read a directional climatology (wind rose, wave rose) from a CSV file.

directional_mixture

Build a DirectionalMixture climatology from a wind rose read by read_wind_rose().

empirical_from_column

Build a kernel density Empirical distribution over a column's measured values.

read_raster

Read a GeoTIFF (or any raster GDAL can read) into a Field.

read_netcdf

Read one variable out of a NetCDF file as a NumPy array.

Constants and objects

MISSING_TOKENS

Strings a CSV field may hold to mean "not measured".

CENSORED_PREFIXES

Prefixes marking a left-censored ("below detection limit") record, as analytical laboratories conventionally write them.

RIGHT_CENSORED_PREFIXES

Prefixes marking a right-censored ("above the measuring range") record, e.g. ">30" for a reading beyond an instrument's range or a specimen still unfailed when a test ended.