Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need more testing and code cleanup for netCDF file inputs #33

Open
smwesten-usgs opened this issue Feb 23, 2024 · 0 comments
Open

Need more testing and code cleanup for netCDF file inputs #33

smwesten-usgs opened this issue Feb 23, 2024 · 0 comments
Labels

Comments

@smwesten-usgs
Copy link
Owner

A recently encountered netCDF file revealed a weakness in the algorithm used to tie row and column numbers to real-world coordinates. The original code was from the days before netCDF was even an input option in SWB. When using Arc ASCII grids as input, it is safe to assume that one can calculate the coordinate value of a cell from the row/column number and the cell size, along with the coordinates of the origin.

The netCDF file encountered features continuously varied grid cell sizes from north to south; this caused the simple coordinate calculation method to fail spectacularly. The solution was to use the coordinates from the netCDF file lon and lat variables directly, rather than assuming that the coordinates can be calculated. As a bonus, this seems to ripple through the code in such a way that the grids no longer need to be 'flipped' on input, but can be read as is. This needs to be tested and verified with a sample of in-the-wild netCDF files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant