-
Notifications
You must be signed in to change notification settings - Fork 17
support for hawaii #117
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
base: main
Are you sure you want to change the base?
support for hawaii #117
Conversation
|
Fixed CLI subsetting: turns out the CONUS hydrofabric and the HI hydrofabric are slightly different, so I made a new hawaii-specific Added forcing generation for HI to CLI: added the appropriate NWM 3.0 S3 URL. Fun fact: Hawaii forcing data is only available from 01/01/1994-12/31/2013, a little quirk that is never mentioned in the S3 documentation. Also, AORC does not cover Hawaii, so including the flag |
|
I had totally missed that the retrospective covers hawaii, PR and alaska too, https://noaa-nwm-retrospective-3-0-pds.s3.amazonaws.com/index.html#PR/zarr/forcing.zarr/ I'd been messing about trying to get era5 data to work. I think I'm going to and modify the hydrofabrics to make them uniform too which should make this code easier. |
|
That would be pretty cool to only have one template and trigger file across all regions... Everything is in a different crs, so this latest commit transforms our hawaii gpkgs from the Hawaii Albers Conic (ESRI 102007) to a more widely accepted crs (EPSG 5070, Albers Conic), which is required by nextgen So now the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
|
pmtiles here https://alabama.box.com/s/t27756wfdlyfoyd9jc239yc2lmwk6fsm As far as I know, TEEHR doesn't support anything outside of CONUS -- their USGS to NWM3.0 crosswalk appears to only be for CONUS. Other than that, everything else in the NGIAB workflow seems to function properly. I did the thing again where I hardcoded references to the PMTiles and the light/dark style jsons, which will have to change before a merge. Those references are in
|
JoshCu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work! if you could update those debug statements to use the printf syntax, Ill take a look at getting ngen to accept the hawaii coordinate system. I'll see if I can fix the geopackage to match conus too.
for reference about those debug messages https://coralogix.com/blog/python-logging-best-practices-tips/
usually it's an insignificant difference but in some of those graph functions it might make a difference?
Do not construct log messages eagerly
Clients can construct log messages in two ways: eagerly and lazily.The client constructs the log message and passes it on to the logging method, e.g., logger.debug(f'Entering method Foo: {x=}, {y=}').
This approach offers formatting flexibility via f-strings and the format() method, but it involves the eager construction of log messages, i.e., before the logging statements are deemed as active.
The client provides a printf-style message format string (as a msg argument) and the values (as a args argument) to construct the log message to the logging method, e.g., logger.debug('Entering method %s: x=%d, y=%f', 'Foo', x, y). After the logging statement is deemed as active, the logger constructs the log message using the string formatting operator %.
This approach relies on an older and quirky string formatting feature of Python but it involves the lazy construction of log messages.
While both approaches result in the same outcome, they exhibit different performance characteristics due to the eagerness and laziness of message construction.For example, on a typical laptop, a million inactive invocations of logger.debug('Test message {0}'.format(t)) takes 2197ms while a million inactive invocations of logger.debug('Test message %s', t) takes 1111ms when t is a list of four integers. In the case of a million active invocations, the first approach takes 11061ms and the second approach took 10149ms. A savings of 9–50% of the time taken for logging!
So, the second (lazy) approach is more performant than the first (eager) approach in cases of both inactive and active logging statements. Further, the gains would be larger when the message construction is non-trivial, e.g., use of many arguments, conversion of complex arguments to strings.
| logger.debug(f"old geometry: {shapely_geometry}") | ||
| return new_geometry | ||
|
|
||
| def convert_gpkg_to_5070(gpkg): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might be able to fix this by updating https://github.com/CIROH-UA/ngen/blob/ngiab/include/geopackage/proj.hpp
but as long as this function is called after we calculate the forcings then it shouldn't matter how much we mangle the geometry, it's not actually used anywhere in ngen or t-route
modules/ngiab_data_cli/__main__.py
Outdated
| ) | ||
|
|
||
| if location == "hi": | ||
| convert_gpkg_to_5070(paths.geopackage_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a problem if the forcings are reprocessed without subsetting again. I'll see if I can update ngen to accept the hawaii coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got you boss
CIROH-UA/ngen#13
|
don't worry about those conflicts for now, I can resolve them when it gets merged |
remove references to conus_q and hawaii_q Co-authored-by: Josh Cunningham <[email protected]>
Co-authored-by: Josh Cunningham <[email protected]>
Co-authored-by: Josh Cunningham <[email protected]>
Co-authored-by: Josh Cunningham <[email protected]>
|
just for clarity, printf syntax refers to something like this? |
|
latest oconus updates https://github.com/CIROH-UA/NGIAB_data_preprocess/tree/superconus |




See issue #54
Attempting to add functionality for CLI subsetting
This does not work right now :(
--locationas a CLI flag, and made it required for users who don't input a gage or latlon (aka use a catid). Turns out catids are duplicated across different hydrofabrics (I found the same catid number in Hawaii and in Maine). For this same reason I changed the naming convention for output folders identified by catids to be prefixed byconus-orhi-, on the off chance that someone does research in both areassource_validation.pysince Hawaii (and Alaska, Puerto Rico) hydrofabrics aren't in the community hydrofabric s3 bucket. I got around this by manually putting my download ofhi_nextgen.gpkginto.ngiab/hydrofabric/v2.2