File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 66
77from xcube .util .jsonschema import (
88 JsonArraySchema ,
9+ JsonComplexSchema ,
910 JsonDateSchema ,
1011 JsonIntegerSchema ,
1112 JsonNumberSchema ,
5455 "Start and stop are inclusive."
5556 ),
5657)
57- SCHEMA_VARIABLES = JsonArraySchema (
58- items = (JsonStringSchema (min_length = 0 )),
59- unique_items = True ,
58+ SCHEMA_VARIABLES = JsonComplexSchema (
6059 title = "Names of variables in dataset" ,
6160 description = "Names of variables which will be included in the data cube." ,
61+ one_of = [
62+ JsonStringSchema (
63+ title = "Variable name or regex pattern" ,
64+ min_length = 0 ,
65+ ),
66+ JsonArraySchema (
67+ title = "Iterable of variables" ,
68+ items = (JsonStringSchema (min_length = 0 )),
69+ unique_items = True ,
70+ ),
71+ ],
6272)
6373SCHEMA_SPATIAL_RES = JsonNumberSchema (title = "Spatial Resolution" , exclusive_minimum = 0.0 )
6474SCHEMA_CRS = JsonStringSchema (title = "Coordinate reference system" )
6575SCHEMA_TILE_SIZE = JsonArraySchema (
6676 nullable = True ,
6777 title = "Tile size of returned dataset" ,
6878 description = (
69- "Tile size in y and x (or lat and lon if crs is geographic) "
79+ "Spatial tile size in y and x (or lat and lon if crs is geographic) "
7080 "in returned dataset."
7181 ),
7282 items = [JsonIntegerSchema (minimum = 1 ), JsonIntegerSchema (minimum = 1 )],
Original file line number Diff line number Diff line change 5555 "flag_colors" ,
5656 "grid_mapping" ,
5757]
58+ _LONG_NAME_TRANSLATION = {
59+ "cld" : "Cloud probability, based on Sen2Cor processor" ,
60+ "scl" : "Scene classification data, based on Sen2Cor processor" ,
61+ "snw" : "Snow probability, based on Sen2Cor processor" ,
62+ }
5863_INTERPOLATIONS = {0 : "nearest" , 2 : "bilinear" }
5964_SCHEMA_SPLINE_ORDERS = JsonComplexSchema (
6065 title = "Spline orders for updampling" ,
@@ -727,5 +732,7 @@ def _create_empty_dataset(
727732 for k in _ATTRIBUTE_KEYS
728733 if k in sample_ds [key ].attrs
729734 }
735+ if key in _LONG_NAME_TRANSLATION .keys ():
736+ ds [key ].attrs ["long_name" ] = _LONG_NAME_TRANSLATION [key ]
730737
731738 return ds
You can’t perform that action at this time.
0 commit comments