Closed dylanbeaudette closed 5 years ago
The solution: truncate soil_fraction
at 10% (90% fragment volume).
How many horizon records are above this threshold? 2192 / 3260926 (0.067%)
Comparing new approach vs. old:
SELECT component.areasymbol, compname, chkey, chorizon.cokey,
-- summed values: convert OM and CaCO3 to fractions
hzdept_r AS top, hzdepb_r AS bottom,
CASE WHEN COALESCE(soil_fraction, 1) < 0.1 THEN 0.1 ELSE COALESCE(soil_fraction, 1) END as soil_fraction,
COALESCE(soil_fraction, 1) as soil_fraction_old
FROM ssurgo.chorizon
JOIN ssurgo.component USING (cokey)
LEFT JOIN
(
-- total rock fragment percent
-- note: data population errors could result in negative values
SELECT chkey, (100.0 - sum(COALESCE(fragvol_r, 0))) / 100.0 as soil_fraction
FROM ssurgo.chfrags
GROUP BY chkey
) as frag_data
USING (chkey)
WHERE cokey IN (select cokey from ssurgo_component_data where om_kg_sq_m < 0)
ORDER BY cokey, top ASC;
areasymbol | compname | chkey | cokey | top | bottom | soil_fraction | soil_fraction_old
------------+----------------------------+----------+----------+-----+--------+------------------------+-------------------------
ca699 | Pacific Mesa | 41824400 | 14523237 | 0 | 8 | 0.1 | -0.10000000000000000000
ca699 | Pacific Mesa | 41824401 | 14523237 | 8 | 38 | 0.1 | -0.06000000000000000000
ca699 | Pacific Mesa | 41824402 | 14523237 | 38 | 63 | 1 | 1
ca750 | Dystric Lithic Xerochrepts | 41989006 | 14572774 | 0 | 18 | 0.1 | -0.18000000000000000000
ca750 | Dystric Lithic Xerochrepts | 41989005 | 14572774 | 18 | 28 | 0.39000000000000000000 | 0.39000000000000000000
ca750 | Dystric Lithic Xerochrepts | 41989004 | 14572774 | 28 | 53 | 1 | 1
sd607 | Udarents | 44336718 | 15317866 | 0 | 5 | 0.1 | -0.05000000000000000000
sd607 | Udarents | 44336717 | 15317866 | 5 | 152 | 0.1 | -0.05000000000000000000
sd081 | Udarents | 44699350 | 15426364 | 0 | 5 | 0.1 | -0.05000000000000000000
sd081 | Udarents | 44699349 | 15426364 | 5 | 152 | 0.1 | -0.05000000000000000000
sd081 | Udarents | 44699473 | 15426390 | 0 | 10 | 0.59000000000000000000 | 0.59000000000000000000
sd081 | Udarents | 44699474 | 15426390 | 10 | 152 | 0.1 | -0.35000000000000000000
I have edited the related code in my processing scripts and the changes will be available in the next cut of the raster data.
The problems fixed in this issue are related to #10 and all other cases where organic matter is much lower than expected.
Some clues:
Further investigation:
It looks like the calculation of
soil_fraction
is the culprit. Likely fragment volume > 100%.Affected SSA/components / horizons