-
Notifications
You must be signed in to change notification settings - Fork 1
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
Basin Analysis Report Batch Tool - Alaska basins #40
Comments
I recommend adding a flag to the maps\analysis.xml file that indicates if a basin is in Alaska. Ideally we would make changes in BAGIS V3 to automatically or deliberately set this flag when the basin is created, but that is extra work for a tool that isn't used much now and for only 16 basins. Instead, we can add the flag and set it to 'No' (if it doesn't exist) when the basin is opened in BAGIS-PRO. Then it would be a manual process for the analyst to close Pro, update the analysis.xml to 'Y', and reopen the basin. We can add the different data sources for PRISM and DEM to the central configuration file on basins. BAGIS-PRO will need to be updated to use the appropriate data sources if the Alaska flag is set to 'Y' for the basin. The current tool does a good job of skipping the maps if the data layers aren't in the basin, but I will need to verify this. This will impact the Snodas Mean and Snodas Mean Delta SWE maps. I will need to ensure the clipping and Snodas calculation tools fail gracefully if the extent of the Snodas data source does not include the basin boundary. Edit: Even if we don't have a timeline for the Alaska reports, I can work on BAGIS-PRO being able to gracefully handle the lack of Snodas data if I have a sample AOI from that geography to work with. I don't know how difficult an ask this is. |
…oData values; Clean up error handling in preparation for Alaska AOIs.
We will need an NLCD layer for Alaska. The current one doesn't cover that area. |
Here is the NLCD image service. Please double check the URL so that it works with the scripting convention. http://bagis.geog.pdx.edu/arcgis/rest/services/BAGIS_Databin/NLCD_2016_land_cover_AK/ImageServer |
Here is the 1981-2010 PRISM precipitation service for Alaska |
New data source entries for Alaska. Please update the settings file on the server. See #21 for relevant information. { { |
@jdduh What do you think about maintaining the Alaska indicator in the Master AOI List rather than in the client-side analysis.xml file? We already query the Master AOI List when an AOI is loaded in BAGIS-Pro so getting the Alaska indicator from there would be straightforward. It also means that no action would need to be taken by the analyst to identify an AOI as Alaskan. And it doesn't have to be an 'Alaska' indicator. We could come up with a more general purpose/name as discussed previously. |
Sounds good. Does the code have to be binary (i.e., 0/1 or yes/no)? We could use HUC2 (https://water.usgs.gov/GIS/regions.html) values as an indicator if the code is none-binary. |
Here is the HUC2 information for NWCC active forecasts. https://www.wcc.nrcs.usda.gov/ftpref/gis/basin_defs/site_lists/HUC2_FCST.json |
That could also work and it doesn't have to be any particular value. Where would I find the HUC2? Will you add it to the Master List or do I have to query the .json service that you provided? |
huc2 is added to the Master AOI List Feature Service. There are two huc2 columns, huc2 and huc2code. huc2 is a text field and huc2code is an integer field. The only difference is for 6 stations bordering US and Canada with the huc2 value of '09' or huc2code of 9. The other stations all have a two digits huc2 code with a non-zero leading number. |
Do you care which huc2 field I use? Either one would work fine. I noticed that huc2code and huc2region are null for inactive AOIs. |
How about using huc2? It aligns better with the "2" (2-digit) nomenclature used in USGS publications. huc2 values were derived from huc that was in the master AOI list feature service. The huc2code and huc2region were from the AWDB .json file. That explains why inactive AOIs have null values for huc2code and huc2region. |
Would it be possible to rename the Alaska Prism webservices to match the North America ones? I store the list of service layers in an array of Constants (Precipitation_01, Precipitation_02, etc.) It would be easiest to only have to have the parent folder name vary for Alaska. If we need to indicate at the lowest level that it is an AK service, can we at least not include the years? If the years are part of the name, we will need to update the code when the years change. Otherwise, we just update the base URI on the data sources server document. |
The current lower 48 PRISM base name is Prism_Precipitation_XX. I can change the AK ones to use the same base name. I thought there is a function to remove the prefix (i.e., Prism) in place. Please confirm that the name could include "Prism_". |
Yes. Prism_Precipitation_XX would be perfect to use the same base name. The output clipped layer names are a separate array and do not have the Prism_Precipitation prefix. |
|
The AK land cover image covers a much bigger area. The area outside the buffered AOI contains zeros. I had difficulty clipping the AK land cover. After testing the CLIP RASTER tool on the lower48 land cover with a different AOI, suddenly the clipping on AK stated to work without any problem (even after restarting ArcGIS Pro). The image below shows the clipped land cover. Blue indicates NODATA, pink for zeros. Here is the clip message. Clip RasterParameters Input Raster BAGIS_Databin\NLCD_2016_land_cover_AK
|
I still can't get the clipping for the Alaska NLCD layer to work. When I clip manually from Pro, it seems like it works but then it hangs indefinitely when it is saving the raster. It never moves beyond 0%. When I try to clip using the add-in, I get this error message (both on my laptop and CS3): Start Time: Wednesday, February 15, 2023 10:46:59 AM If you google the error message online, it says "While this error can occur, it occurs so rarely that the typical causes have not been identified so no solution is available at this time." I wonder if it is because it is multiple band? The PRISM layer clips fine. |
I tried the clip raster tool on another computer and the tool worked in the first attempt without any problem. The Lower 48 land cover imageservice is also from a 3 bands image. We probably can rule out the multiple bands concern. |
Just checked the lower 48 land cover service. It's not a multiple band. I will see if I can compress the bands for the AK land cover. |
…ch land cover data source to be configurable for Alaska; Add error handling
I will need to reprocess the AK NLCD. |
Just for the record. AK's huc2 (huc2code) is 19. |
The problem is the field name that contains the land cover value. It is NLCD_Land on the lower 48 webservice and NLCD_Land_Cover_Class on the Alaska webservice. The easiest fix would be to change the Alaska webservice to match the lower 48. Alternatively I could change the layer template to key off of the value instead of the NLCD_Land field, but that will take longer and mean distributing a new .lyrx file. And I double-checked that BAGIS-PRO is using the correct huc2 code. |
Thanks for troubleshooting this. I will update the field name of the AK NLCD imageservice. |
We do need a new layer file to reflect the updates on the NLCD data.
The updates are in bold. Value,Red,Green,Blue,Opacity,NLCD_Land |
Here is the layer file. Rename .txt to .lyrx. |
I posted the new .lyrx file to ArcGIS online. There is no way to version these files. You'll need to delete the existing nlcd_land_cover.lyrx from the BAGIS folder in your AppData directory. Then Pro will pull the new copy in from AGOL. |
It may be a process of trial and error before we get the errors/warnings like you want them. It's a complex question. |
I am running into a related question while validating the 3.x build so I will add it here. I stumbled upon an AOI that has its station triplet populated. This station triplet is in the AOI Master List but not in the Master FCST List. When we implemented to Master FCST list, I switched all calls to the AOI Master List to the Master FCST list. I'm running into issues with this AOI because I can't retrieve the nwcc name or the winter months to create the PDF. So my question(s):
|
Questions:
If we do implement the checking on multiple lists, then we should have some labels to differentiate them in the reports or in the log file. (For example, put "(not an active forecast station)" after the Streamgage station value on the summary page) NWCC currently only needs FCSH reports, but hasn't excluded the possibility of generating reports for some random locations or for new USGS gauge stations. [Additional notes] |
I'm in favor of not checking the multiple lists for now. The items that will be missing are the nwccName, the runoff value, and the winter months (thus no winter map). We could use default values in the code to create the winter precipitation map (and log it) to avoid that last error. I'm against having to maintain multiple master lists if we don't have to. Perhaps when the new web service is created, we could add something to check some of the attributes on that list to indicate if it's a forecast point (or not) and annotate the report accordingly. |
"Regarding the NLCD .lyrx file: I remembered last night that we shortened some of the classification descriptions on the previous version so that they didn't run into the map. I don't know if we need to take a look again at this with the new version? If works for you, it's fine for me." Please use the shortened descriptions (per #28). Snow/Ice We might not need to shorten the followings. |
I've updated the NLCD .lyrx file on AGOL with the requested changes. You'll need to delete the local version in the AppData/BAGIS folder and BAGIS-Pro will pull this latest copy down. Let me know if you need any more changes. |
This is a bug specific to Alaska AOIs. It seems that the reclipped DEM was clipped with a buffer. Some of the sites don't have the elevation values. Also, the slope and aspect (and probably aspect too) values were not correctly retrieved from the data. Here is an example: Watershed Characteristics Report |
Here is another AOI. Watershed Characteristics Report |
Can you post one of these AOIs to basins for me to work with? The sites information is working correctly on my only Alaska example. |
I put two new Alaska AOI on the server (in the BAGIS_aois\Alaska folder). The one that has the problem is 15258000_AK_USGS_03272023.zip. The file size is 16 GB. The other smaller AOI seems to not have the problem. |
…ns were using wrong DEM; Found another manifestation of the 3.x image service clip error and added extent; Need to verify correct extent
This is fixed in the latest 3.x AddIn |
… prism boundary to err on side of finding them so we use the image service for extract points
… when regenerating surfaces layers, if needed, because sites are outside of AOI. issue #43: Continue work on NotReady status
There is no SNODAS data for Alaska. We still don't have a timeline when these reports will be generated. Here are some notes for further discussion.
The text was updated successfully, but these errors were encountered: