NCPP / ocgis

OpenClimateGIS is a set of geoprocessing and calculation tools for CF-compliant climate datasets.
Other
70 stars 19 forks source link

Option to squeeze singleton dimensions #467

Open bekozi opened 6 years ago

bekozi commented 6 years ago

Add option to squeeze singleton dimensions following a slice. This could also apply to processing data with a singleton dimension in general. Right now, the singleton dimension is left in to maintain the source value and/or original data shape.

One possible approach:

ops = ocgis.OcgOperations(..., squeeze_options={'slicing': True, 'as_dimensionless': True, 'reshape': False})

Documentation:

Ping @nkadygrov.