Open benjaminleighton opened 2 months ago
I tried removing the logic alltogether from the SfluxSource ds function, things apparently work in that case but I don't think the dimensions and coordinates written to the schism sflux netcdf are correct. I think we need to implement coordinate and maybe dimension renaming in either get of SfluxSource or of SCHISMDataSflux?
Code at
https://github.com/rom-py/rompy/blob/45fb70a713bf69f0c2e55862c6c3af4ead64fbf5/rompy/schism/data.py#L68-L86
renames dimensions to ny_grid and nx_grid using the datasetcoords object but I think this is a problem for multiple reasons:
lon, lat = np.meshgrid(ds[self.coords.x], ds[self.coords.y])
uses the coords.x and coords.y as coordinates correctly but the implication is that initially dimensions and coordinates are called the same thing. If they aren't called the same thing later cropping will fail because the indexer used is attempting to slice against the dimension and not the coordinateAttached is a variation of the schism_procedural notebook that uses a barra like synthetic dataset that replicates the failure if the variables and coordinates aren't named the same thing problem I'm having using schism with barra data.
schism_procedural_1.zip
Initially I thought a solution to this was
that is to remove the rename_dims and assign coords using coords for lon and lat but I don't think that works and gives odd dimensions in the resulting data.