Skip to content

Commit e91164d

Browse files
committed
Add a zarr format
1 parent e4cc109 commit e91164d

File tree

8 files changed

+323
-24
lines changed

8 files changed

+323
-24
lines changed

doc/installation.rst

Whitespace-only changes.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ matplotlib
33
scipy
44
netCDF4
55
opencv-python
6-
shapely
76
pyyaml
87
pyproj
98
pint
10-
numba
9+
numba
10+
polygon3

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'src/scripts/GridFiltering',
1818
'src/scripts/EddyId',
1919
'src/scripts/EddySubSetter',
20+
'src/scripts/EddyTranslate',
2021
'src/scripts/EddyTracking',
2122
'src/scripts/EddyFinalTracking',
2223
'src/scripts/EddyMergeCorrespondances',
@@ -35,10 +36,10 @@
3536
'netCDF4>=1.1.0',
3637
'matplotlib',
3738
'opencv-python',
38-
'shapely',
3939
'pyyaml',
4040
'pyproj',
4141
'pint',
42+
'zarr',
4243
'polygon3',
4344
'numba',
4445
],

src/py_eddy_tracker/__init__.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"""
3030
from argparse import ArgumentParser
3131
import logging
32+
import numpy
33+
import zarr
3234

3335

3436
class ColoredFormatter(logging.Formatter):
@@ -251,9 +253,10 @@ def parse_args(self, *args, **kwargs):
251253
uavg_profile=dict(
252254
attr_name=None,
253255
nc_name='uavg_profile',
254-
output_type='uint16',
256+
output_type='u2',
255257
scale_factor=.0001,
256-
nc_type='float32',
258+
nc_type='f4',
259+
# filters=[zarr.Delta('u2')],
257260
nc_dims=('obs', 'NbSample'),
258261
nc_attr=dict(
259262
longname='radial profile of uavg',
@@ -361,8 +364,9 @@ def parse_args(self, *args, **kwargs):
361364
nc_name='effective_contour_longitude',
362365
old_nc_name=['contour_lon_e'],
363366
nc_type='f4',
367+
filters=[zarr.Delta('i2')],
364368
output_type='i2',
365-
scale_factor=0.01,
369+
scale_factor=numpy.float32(0.01),
366370
add_offset=180,
367371
nc_dims=('obs', 'NbSample'),
368372
nc_attr=dict(
@@ -377,8 +381,9 @@ def parse_args(self, *args, **kwargs):
377381
nc_name='effective_contour_latitude',
378382
old_nc_name=['contour_lat_e'],
379383
nc_type='f4',
384+
filters=[zarr.Delta('i2')],
380385
output_type='i2',
381-
scale_factor=0.01,
386+
scale_factor=numpy.float32(0.01),
382387
nc_dims=('obs', 'NbSample'),
383388
nc_attr=dict(
384389
longname='effective contour latitudes',
@@ -392,8 +397,9 @@ def parse_args(self, *args, **kwargs):
392397
nc_name='speed_contour_longitude',
393398
old_nc_name=['contour_lon_s'],
394399
nc_type='f4',
400+
filters=[zarr.Delta('i2')],
395401
output_type='i2',
396-
scale_factor=0.01,
402+
scale_factor=numpy.float32(0.01),
397403
add_offset=180,
398404
nc_dims=('obs', 'NbSample'),
399405
nc_attr=dict(
@@ -408,8 +414,9 @@ def parse_args(self, *args, **kwargs):
408414
nc_name='speed_contour_latitude',
409415
old_nc_name=['contour_lat_s'],
410416
nc_type='f4',
417+
filters=[zarr.Delta('i2')],
411418
output_type='i2',
412-
scale_factor=0.01,
419+
scale_factor=numpy.float32(0.01),
413420
nc_dims=('obs', 'NbSample'),
414421
nc_attr=dict(
415422
longname='speed contour latitudes',
@@ -445,6 +452,17 @@ def parse_args(self, *args, **kwargs):
445452
longname='score',
446453
)
447454
),
455+
index_other=dict(
456+
attr_name=None,
457+
nc_name='index_other',
458+
nc_type='u4',
459+
nc_dims=('obs',),
460+
nc_attr=dict(
461+
units='ordinal',
462+
description='index in the other dataset',
463+
longname='index_other',
464+
)
465+
),
448466
shape_error_s=dict(
449467
attr_name=None,
450468
nc_name='speed_contour_shape_error',

0 commit comments

Comments
 (0)