Ashar25 / RainyDay

0 stars 1 forks source link

Issues with dimension names in netcdf files #52

Open danielbwright opened 6 months ago

danielbwright commented 6 months ago

Currently, the user can specify the variable names for the x and y coordinates, e.g., "latitude", "longitude"). However, if the dimension names don't match the variable names, readnetcdf() will throw an error here: outrain=infile[rain_name].sel(**{lat_name:slice(latmin,latmax)},\ **{lon_name:slice(longmin,longmax)}) But really 'lat_name' and 'lon_name' are the dimension names, not the variable names. Can we make the code robust to this inconsistency in variable and dimension names?

danielbwright commented 6 months ago

As an alternative, we can provide very explicit instructions that the variable names and the dimension names must be identical.

Ashar25 commented 6 months ago

Yes, the dimension name should be identical with the coordinates name. The purpose of asking variable is to handle the variability we get from different datasets like some datasets name their X and Y as: "Lat", "Lon" or just X and Y and the precipitation variable as: prep or rain or whatever. Users can mention the name of these "variables" (either coordinate or the precipitation) in the JSON file and the program can handle that.