NERC-CEH / dri_gridded_data

GNU General Public License v3.0
0 stars 0 forks source link

Handle the conversion of data variables to coordinate variables better #26

Open mattjbr123 opened 3 hours ago

mattjbr123 commented 3 hours ago

As part of the conversion pipeline we have to convert the coordinates that are stored as data variables to coordinate variables. See here and here for why.

At the moment we have hard-coded the variables in to the pipeline as we are only considering one dataset.

For the general case we should aim to automatically detect these variables

I am sure it is possible using xarray. Just need to dig around in the API somewhere to find a function like 'is_coord_var' or 'is_data_var'.

mattjbr123 commented 3 hours ago

This does also raise the question of what other things we'll need to automatically detect or have the user specify in order to generate a sensible recipe for each given dataset, but that's a bigger question...