Open SnowHydrology opened 5 months ago
@SnowHydrology Working through this and am close... however there is something odd... the chance I did something wrong is not 0 but this is what I am seeing:
In the SOIL map (ISLTYP) there appears to be a glacier in Florida. I changed values of 16 (ice) to 100 just to be visually nice.
Does this bother any of you haha?
library(hydrofabric)
wrf = correct_nwm_spatial('/Volumes/MyBook/conus-hydrofabric/nwm_v3.0.7/conus/wrfinput_CONUS.nc')
AOI = AOI::aoi_get(state = "FL")
crop(wrf[['ISLTYP_Time=1']], project(vect(AOI), crs(wrf))) %>%
classify(data.frame(from = 16, to = 100)) %>%
plot()
Created on 2024-02-07 with reprex v2.0.2
Yeah .... the code is good. That cluster of 16 is there for sure:
Hmm, any chance they're using a different soil classification than our SOILPARM.TBL?
The public WRF-Hydro version shows the same table, but maybe operational version is different.
I dont think so, it is surrounded by 4 (SILT LOAM) ,6 (SILT) ,13 (ORGANIC MATERIAL). Which seem reasonable.
And if I do the same with CONUS (Ice becomes 100 for visibility) its generally reasonable but definitely has some questionable areas.
I'd say that is generally unreasonable.
Is there something we're missing or is this a problem?
I am confident that in the wrfinput associated with NWM 3.0.7, those are where class 16 exists. I only have found tables where class 16 is (OTHER; INLAND ICE).
Someone in GID thought it might be a model hack...
However! If we were to rebuild landcover and soil grids this is a good time to inplement some of @DonnyDHKim and my work on land cover resampling:
An area preserving method for improved categorical raster resampling
Current behavior
The hydrofabric determines the land cover classification for a basin by using the mode of land cover categories within its boundaries. Sometimes this leads to conflicts with the soil type, particularly if water is involved.
The below screenshot, from @mikejohnson51, shows an area in which the soil (
ISLTYP = 14
) is classified as water, while the land cover (IVGTYP = 15
) is classified as mixed forest.This caused runs of Noah-OWP-Modular to fail because of inconsistencies in the soil and land cover categories: https://github.com/NOAA-OWP/DMOD/issues/472#issuecomment-1893759701
Expected behavior
The hydrofabric should return self-consistent values of soil and land cover.
Suggested changes
Add new, lumped generic categories for soil and land cover. I provide suggestions below:
Soil generic categories
From the
STAS
category in Noah-OWP-Modular:Land cover generic categories
From the
USGS
category in Noah-OWP-Modular:Code changes
Implement a two-step classification option that:
forest
,water
,urban
,agriculture
) and soil categories in the basinsoil == land
then the land cover corresponds toland_cover %in% c(urban, agricultural, grassland, forest, wetland, barren, tundra)
orsoil == water
andland_cover == water
orsoil == ice
andland_cover == ice