JMMP-Group / nordic-seas-validation

MIT License
0 stars 1 forks source link

standardize kogur #4

Closed malmans2 closed 3 years ago

malmans2 commented 3 years ago

I added a class to standardize observations. To initialize the class:

from nsv import Standardizer
Standardizer(raw_data_path=None)

Pass a raw_data_path if you want to permanently store raw data somewhere locally, otherwise the default cache dir is used.

Example for kogur is:

from nsv import Standardizer
ds = Standardizer().kogur

The resulting dataset looks like this:

<xarray.Dataset>
Dimensions:                (time: 1004, depth: 31, station: 20)
Coordinates:
  * time                   (time) datetime64[ns] 2011-09-01 ... 2012-07-31T08...
  * depth                  (depth) float64 50.0 100.0 150.0 ... 1.5e+03 1.55e+03
    dist                   (station) float64 0.0 8.0 16.0 ... 136.0 144.0 152.0
  * station                (station) int64 0 1 2 3 4 5 6 ... 14 15 16 17 18 19
    longitude              (station) float64 -23.53 -23.59 ... -25.37 -25.49
    latitude               (station) float64 67.2 67.27 67.34 ... 68.27 68.32
Data variables:
    x_velocity             (time, depth, station) float64 -0.007918 ... nan
    y_velocity             (time, depth, station) float64 0.004742 ... nan
    ws                     (time, depth, station) float64 0.00627 ... nan
    salinity               (time, depth, station) float64 34.32 34.67 ... nan
    potential_temperature  (time, depth, station) float64 2.993 4.544 ... nan
    sigma_theta            (time, depth, station) float64 27.35 27.47 ... nan
    wc                     (time, depth, station) float64 0.006772 ... nan
Attributes:
    featureType:  timeSeries
    history:      Fri Nov 19 12:04:28 2021: cf.add_canonical_attributes(overr...

The CF description looks like this:

Coordinates:
- CF Axes: * Z: ['depth']
           * T: ['time']
             X, Y: n/a

- CF Coordinates:   longitude: ['longitude']
                    latitude: ['latitude']
                  * vertical: ['depth']
                  * time: ['time']

- Cell Measures:   area, volume: n/a

- Standard Names: * depth: ['depth']
                    latitude: ['latitude']
                    longitude: ['longitude']
                  * time: ['time']

- Bounds:   n/a

Data Variables:
- Cell Measures:   area, volume: n/a

- Standard Names:   sea_water_potential_temperature: ['potential_temperature']
                    sea_water_salinity: ['salinity']
                    sea_water_sigma_theta: ['sigma_theta']
                    sea_water_x_velocity: ['x_velocity']
                    sea_water_y_velocity: ['y_velocity']

- Bounds:   n/a