2929"""
3030from argparse import ArgumentParser
3131import logging
32+ import numpy
33+ import zarr
3234
3335
3436class 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