I am using netCDF4 to store multidimensional data. The data has, for example, three dimensions, time = [0, 1, 2]
, height = [10, 20]
, direction = [0, 120, 180, 240, 300]
, but not for all combinations (grid points) there is data. In our example, let this be limited to height
/direction
-combinations. Namely, suppose that at height == 10
we have data only for direction in {0, 120, 240}
and at height == 20
only for direction in {120, 180, 300}
.
The approaches for dealing with this I see are:
- Use a separate unidimensional
Variable
for eachheight
/direction
-combination. - Use a single three-dimensional
Variable
over the Cartesian product, i.e., all possible combinations, and live with the fact that for some combinations all values are masked. - Use different location dimension definitions for each height and a two-dimensional
Variable
for each height.
Are there other approaches and what are reasons, both principled as well as practical, for preferring one approach over another?