Closed danielbwright closed 1 year ago
This is something which I was worried about while changing the findsubbox and readnetcdf. We can check this once we are able to make diagnostic plots compatible with new version of RainyDay.
This needs a little bit more verification but I think it is almost finished.
I was surprised to see the flipping of north-south in writecatalog_ash(): data_vars = dict( rain = (("time","latitude", "longitude"),catrain[:, ::-1, :],{'units': rainrate_units, 'long_name': rainrate_name}), gridmask= (("latitude", "longitude"), gridmask[::-1, :],{'units': 'dimensionless', 'long_name': gmask_name}), domainmask = (("latitude", "longitude"),dmask[::-1, :],{'units': 'dimensionless', 'long_name': domainmask_name}), latitude = (("latitude"), latrange[::-1].data, {'units': latitudes_units, 'long_name': latitudes_name}),
I didn't expect to see these, because the behavior of the rest of the code seemed correct despite this. Further testing is needed. Perhaps this actually doesn't matter because, maybe, when xarray reads them back in, it handles it because it is "coordinate aware".
Ashar, please perform the following test:
Dan, sorry for the last comment. I think this is working fine with both the conditions. So, we can remove this [::-1], probably.
We need to carefully verify the orientation (specifically, the north-south orientation) of all relevant arrays (e.g., catrain, catmask, tranposition probabilites) are consistent with each other. Currently, I believe catrain is not consistent with prior usage and other arrays. The easiest fix is likely to flip catrain once it is converted to numpy array, and then make sure things are flipped back before being written to netcdf.