🌡

USDM Drought Monitor

Weekly county-level drought conditions ingested from the USDM REST API.

SourceUSDA / University of Nebraska Drought Monitor
FormatJSON (REST API, one state at a time)
FrequencyWeekly β€” ingested each Thursday
Destination tablesdrought_observations, drought_metrics

drought_observations

Destination fieldTypeSource fieldTransformation
fipsstring(5)fipsZero-padded to 5 digits. Rows with non-numeric FIPS discarded.
valid_datedatevalid_datePassed from ingestion call (not from API response).
county_namestringcountyPassed as-is. Null if absent.
state_abbrstring(2)statePassed as-is. Null if absent.
d0_pct – d4_pctnumeric(6,3)d0 – d4Percentage of county area in each drought category. Rounded to 3 decimal places.
drought_severitysmallintderived Highest active category: if d4>0β†’4, d3>0β†’3, d2>0β†’2, d1>0β†’1, d0>0β†’0, else –1.
drought_categorystringderived String label of highest active category ("D4"…"D0"). Null when drought-free (severity = –1).

drought_metrics (computed from drought_observations history)

Destination fieldTypeInputsComputation
weeks_in_droughtsmallintdrought_severityConsecutive weeks with severity β‰₯ 0 (D0 or worse) ending on this date.
severity_change_4wsmallintdrought_severityCurrent severity minus severity 4 weeks prior.
avg_severity_4wnumeric(4,2)drought_severityRolling mean over 4 weeks. Rounded to 2 decimals.
avg_severity_12wnumeric(4,2)drought_severityRolling mean over 12 weeks. Rounded to 2 decimals.
burden_52wsmallintdrought_severitySum of max(0, severity) over 52 weeks. D0 weeks = 0, D1 = 1, D4 = 4.
severity_percentile_20ynumeric(5,1)drought_severityPercentile rank of current severity within 20-year history for that county and calendar week.
severity_anomalynumeric(4,2)drought_severityCurrent severity minus 20-year mean for this county and week-of-year.
drought_regimestringseverity, change Classification combining current severity, 4-week change, and persistence.
drought_free Β· entering Β· deepening Β· flash_drought Β· persistent Β· recovering

🌧️

PRISM Climate

Daily 4km gridded climate variables spatially aggregated to county boundaries using a pre-built cell-to-county weight table.

SourcePRISM Climate Group, Oregon State University
FormatZIP-archived BIL/GeoTIFF rasters (one file per variable per day)
Spatial aggregationArea-weighted mean of 4km grid cells within each county
Destination tableprism_observations
Destination fieldTypeSource variableTransformation
fipsstring(5)prism_cell_county_weightsFIPS from spatial weight table. Each county cell mapped via pre-built weights.
obs_datedateobs_datePassed from ingestion call.
precip_mmnumeric(7,2)pptPrecipitation in mm. Weighted mean of valid raster cells in county. Rounded to 2 decimals.
tmax_cnumeric(5,2)tmaxMaximum daily temperature in Β°C. Weighted mean of valid raster cells.
tmin_cnumeric(5,2)tminMinimum daily temperature in Β°C. Weighted mean of valid raster cells.
vpdmax_hpanumeric(6,2)vpdmaxMaximum vapor pressure deficit in hPa. Weighted mean of valid raster cells.
cell_countsmallintderivedNumber of valid (non-NaN) raster cells contributing to the county mean.

Rolling window sums (7d, 30d, 90d) are computed at query time from precip_mm daily values β€” they are not stored as separate columns.


🌑️

Growing Degree Days

Derived daily from PRISM tmax/tmin using the simple averaging method with crop-specific base and cap temperatures.

SourceComputed from prism_observations (tmax_c, tmin_c)
Formulamax(0, ((min(tmax, cap) + max(tmin, base)) / 2) βˆ’ base)
Destination tablegdd_observations
Destination fieldTypeInputsBase / Cap (Β°C)
gdd_cornnumeric(7,3)tmax_c, tmin_cBase 10.0 / Cap 30.0
gdd_soybeansnumeric(7,3)tmax_c, tmin_cBase 10.0 / Cap 30.0
gdd_wheatnumeric(7,3)tmax_c, tmin_cBase 0.0 / Cap 26.0
gdd_cottonnumeric(7,3)tmax_c, tmin_cBase 15.5 / Cap 37.7
gdd_sorghumnumeric(7,3)tmax_c, tmin_cBase 10.0 / Cap 37.8

All GDD values are clipped to a minimum of 0 and rounded to 3 decimal places. Null when either tmax or tmin is null for that county-date. Season-to-date accumulations and prior-year comparisons are computed at query time by summing daily gdd_* values from January 1.


🌱

NASA SMAP Soil Moisture

Daily HDF5 granules spatially aggregated to county level using a pre-built cell-to-county weight table.

SourceNASA SMAP SPL3SMP_E v006 (Enhanced L3 Radiometer)
FormatHDF5 granules β€” one file per day
Spatial aggregationArea-weighted mean of 9km EASE-Grid cells within each county
Destination tablessmap_observations, smap_soil_properties
Destination fieldTypeHDF5 arrayPassTransformation
sm_mean_amnumeric(6,4)smAMMean of valid (non-fill) cells within county. Fill value excluded. Null when no valid cells.
sm_std_amnumeric(6,4)smAMStandard deviation of valid cells within county.
coverage_pct_amnumeric(5,2)smAMValid cell count / total county cell count Γ— 100.
sm_error_amnumeric(6,4)sm_errorAMMean retrieval uncertainty over SM-valid cells.
surface_temp_amnumeric(6,2)surface_tempAMMean surface temperature (K) over SM-valid cells.
vwc_amnumeric(6,4)vwcAMMean vegetation water content (kg/mΒ²) over SM-valid cells.
freeze_thaw_amnumeric(5,3)freeze_thawAMMean freeze/thaw state flag over all county cells (0 = thawed, 1 = frozen).
sm_mean_pm / …_pmsamesame arraysPMSame aggregations from the ascending (PM) overpass. Often null at higher latitudes.

smap_soil_properties (static, extracted once)

Destination fieldTypeHDF5 arrayTransformation
bulk_densitynumeric(7,3)bulk_densityMean of county cells (g/cmΒ³).
clay_fractionnumeric(5,3)clay_fractionMean of county cells (fraction 0–1).

πŸ“Š

NASS Crop Yields

Annual county-level crop yields and harvested acreage from the USDA NASS Quick Stats API.

SourceUSDA NASS Quick Stats API
FormatJSON β€” two queries per crop (YIELD + AREA HARVESTED)
CropsCORN Β· SOYBEANS Β· WHEAT_WINTER Β· COTTON Β· SORGHUM
Destination tablenass_crop_yields
Destination fieldTypeSource fieldTransformation
fipsstring(5)state_fips_code + county_codeConcatenated and zero-padded: state.zfill(2) + county.zfill(3). Rows with county code "998" or "999" (state rollups) discarded.
yearsmallintyearParsed to integer.
cropstringcommodity_descNormalized to canonical name. "CORN" β†’ "CORN", "SOYBEANS" β†’ "SOYBEANS", "WHEAT" + class "WINTER" β†’ "WHEAT_WINTER", etc.
yield_valuenumeric(10,2)Value (YIELD query)Commas removed, parsed to float. Null when NASS value is "(D)" (suppressed for confidentiality) or blank.
yield_unitstringunit_descPassed as-is. E.g. "BU / ACRE", "LB / ACRE".
acres_harvestedintegerValue (AREA HARVESTED query)Commas removed, parsed to int. Joined to yield rows by (fips, year). Null when suppressed.

🌾

NASS Crop Progress

Weekly state-level crop progress percentages from USDA NASS Quick Stats.

SourceUSDA NASS Quick Stats API
FormatJSON β€” one query per crop, PROGRESS records
GranularityState-level (not county)
Destination tablecrop_progress
Destination fieldTypeSource fieldTransformation
state_fipsstring(2)state_fips_codeZero-padded to 2 digits. Rows with state code "00" (national aggregate) discarded.
week_endingdateweek_endingParsed from "YYYY-MM-DD". Rows with missing or invalid dates discarded.
cropstringcommodity_descNormalized to canonical name. "WHEAT" + class "WINTER" β†’ "WHEAT_WINTER", "WHEAT" + "SPRING" β†’ "WHEAT_SPRING".
stagestringunit_desc"PCT " prefix stripped. "PCT PLANTED" β†’ "PLANTED", "PCT EMERGED" β†’ "EMERGED", etc.
progress_pctnumeric(5,2)ValueCommas removed, parsed to float. Null when value is "(D)", "(NA)", "(Z)", or blank.

πŸ›°οΈ

MODIS NDVI

NASA MODIS MOD13A2 16-day NDVI composites ingested via NASA AppEEARS, aggregated to county level and normalized against a 25-year seasonal baseline.

SourceNASA AppEEARS β€” MOD13A2.061 (Terra 1km NDVI, 16-day)
FormatCSV per chunk (~800 counties), downloaded via AppEEARS task API
Destination tablesndvi_observations, ndvi_baseline
Destination fieldTypeSource fieldTransformation
fipschar(5)filename / categoryExtracted from AppEEARS category field. Zero-padded to 5 digits.
obs_datedateDateParsed from AppEEARS date column (YYYY-MM-DD).
ndvi_meannumeric(7,4)MOD13A2_061__1_km_16_days_NDVIMean across all pixels within county boundary. Pixels with pixel_reliability > 1 excluded (marginal or snow/ice quality). Scale factor 0.0001 applied. Null if no valid pixels remain.
pixel_reliabilityfloatMOD13A2_061__1_km_16_days_pixel_reliabilityMean pixel_reliability value across county pixels used for quality filtering. 0=good, 1=marginal, 2=snow/ice, 3=cloudy.
Destination field (ndvi_baseline)TypeSourceComputation
doy_periodsmallintobs_date16-day period of year: ((doy βˆ’ 1) / 16 + 1). Periods 1–23.
ndvi_meannumeric(7,4)ndvi_observationsMean NDVI across 2000–2024 obs for this county Γ— period. Tiered quality filter: use pixel_reliability=0 if β‰₯10 obs; else pixel_reliability≀1 if β‰₯10 obs; else low_confidence=true.
ndvi_stdnumeric(7,4)ndvi_observationsStandard deviation of NDVI across baseline years for this county Γ— period.
low_confidencebooleancomputedTrue when fewer than 10 valid observations exist across the baseline window. Z-score set to null for these counties/periods.

⚠️

Crop Stress Index

Composite 0–100 agricultural stress index computed at query time. Component weights are derived from Pearson correlations between each signal's growing-season summary and county-level NASS yield deviations from trend (2001–2024, ~41k county-years for corn). Separate models for CORN, SOYBEANS, WHEAT_WINTER, SORGHUM, COTTON, and GENERAL.

SourceComputed from drought_metrics, prism_observations, smap_observations, ndvi_observations, ndvi_baseline, county_primary_crop
Not storedComputed on demand β€” no risk score table in the database
Output fieldRaw scorer rangeInputsComputation
cropstringcounty_primary_crop Dominant crop by 5-year avg harvested acres (USDA NASS). Determines which weight set is applied. Falls back to GENERAL if no NASS data.
components.drought0–40drought_severity, burden_52w, severity_change_4w Severity mapped to base points (D-1=0, D0=6, D1=16, D2=26, D3=34, D4=40). +4 if worsened past 4 weeks; +2 if 52-week burden >40%. Capped at 40. Weight in score: CORN 31, SOYBEANS 27, WHEAT_WINTER 35, SORGHUM 31, COTTON 34, GENERAL 31.
components.vpd0–15vpd_30d_avg_hpa (prism_observations) 30-day avg VPD vs empirical percentiles (P50/P75/P90/P95 = 22.0/28.5/37.3/43.9 hPa) β†’ 0/3/7/11/15 pts. Weight: CORN 21, SOYBEANS 26, WHEAT_WINTER 26, SORGHUM 22, COTTON 20, GENERAL 22. Null if PRISM unavailable.
components.precipitation0–15precip_90d_mm, precip_7d_mm 90-day total deficit (0–11 pts) + 4 if recent 7-day rate < 25% of 90-day daily avg. Capped at 15. Not included in WHEAT_WINTER or COTTON models (rβ‰ˆ0). Weight: CORN 14, SOYBEANS 21, SORGHUM 18, GENERAL 15.
components.soil_moisture0–15sm_mean_am (smap_observations) VWC thresholds: <0.08=15, <0.12=11, <0.18=7, <0.25=3, β‰₯0.25=0. Not in WHEAT_WINTER or SORGHUM models. Score is null (not computed) for soil-dependent crops when SMAP unavailable. Weight: CORN 14, SOYBEANS 5, COTTON 10, GENERAL 7.
components.ndvi_anomaly0–10ndvi_observations, ndvi_baseline Z-score of current NDVI vs 25-year seasonal baseline: z ≀ βˆ’2.0=10, ≀ βˆ’1.5=8, ≀ βˆ’1.0=5, ≀ βˆ’0.5=2, > βˆ’0.5=0. Null when low_confidence=true or no NDVI data. Weight: CORN 20, SOYBEANS 21, WHEAT_WINTER 39, SORGHUM 29, COTTON 36, GENERAL 25.
score0–100all components raw_total / available_weight_sum Γ— 100, rounded. available_weight_sum = sum of weights for components with valid data. Scales correctly when signals are temporarily unavailable.
data_coverage_pctintegerall components available_weight_sum / crop_model_total_weight Γ— 100. 100 = all signals present for this crop model.

🌊

FEMA Flood Zones

County-level flood zone area percentages derived from the FEMA National Flood Hazard Layer (NFHL) via ArcGIS outStatistics.

SourceFEMA NFHL β€” ArcGIS FeatureServer (outStatistics, FLD_ZONE / ZONE_SUBTY)
FormatPre-aggregated area sums per zone type per county (no geometry payload)
Spatial referenceArea in sq degrees (NAD83); converted to mΒ² using county centroid latitude
FrequencyQuarterly refresh
Destination tablefema_flood_zones
Destination fieldTypeSource fieldTransformation
fipschar(5)county FIPS5-digit FIPS; one row per county (primary key). Counties absent from TIGER boundaries skipped.
sfha_pctnumeric(5,2)FLD_ZONE (A*, V*) % of county land area in Special Flood Hazard Area β€” all A-prefix and V-prefix zones. Area in sq degrees converted to mΒ² via centroid-latitude scaling; expressed as % of Census TIGER ALAND.
moderate_pctnumeric(5,2)FLD_ZONE=X, ZONE_SUBTY contains "0.2" or "500" % of county land in 0.2% annual chance flood zone (shaded Zone X). Identified by ZONE_SUBTY containing "0.2" or "500".
minimal_pctnumeric(5,2)FLD_ZONE=X (unshaded), B, C % of county land in minimal risk zones β€” unshaded Zone X, B, and C zones.
mapped_pctnumeric(5,2)sfha + moderate + minimal % of county land covered by any effective FIRM designation. Excludes Zone D (undetermined). If total zone area exceeds TIGER ALAND, all zones are scaled proportionally to cap mapped_pct at 100.
fetched_attimestamptzserver clockTimestamp of ingestion run. Set by DB default (NOW()).

Open water (OPEN WATER zone) and Zone D (undetermined risk) are excluded from all percentages. NULL values indicate the county returned no NFHL features from the API.


⚑

FEMA National Risk Index

County-level composite and per-hazard risk scores, Expected Annual Loss, and social vulnerability / community resilience ratings from FEMA NRI v1.20.

SourceFEMA NRI β€” ArcGIS FeatureServer (National_Risk_Index_Counties, v1.20)
FormatPaginated JSON attributes (no geometry); maxRecordCount=2000
FrequencyAnnual refresh (December)
Destination tablenri_counties

County base and composite scores

Destination fieldTypeNRI source fieldTransformation
fipschar(5)STCOFIPSZero-padded to 5 digits. Rows with invalid FIPS discarded.
populationintegerPOPULATION2020 Census population. Rounded to integer. NULL when source is null or βˆ’999.
building_value_usdbigintBUILDVALUETotal building replacement value (USD). Rounded to integer.
agri_value_usdbigintAGRIVALUETotal agricultural value (USD). Rounded to integer.
area_sqminumeric(10,2)AREACounty area in square miles.
risk_score / risk_ratingnumeric(6,2) / varchar(30)RISK_SCORE / RISK_RATNGComposite NRI risk score (0–100 percentile vs all US counties) and text rating.
eal_score / eal_ratingnumeric(6,2) / varchar(30)EAL_SCORE / EAL_RATNGComposite Expected Annual Loss score and rating.
eal_total_usdbigintEAL_VALTTotal EAL across all hazards β€” buildings + ag + population proxy (USD).
sovi_score / sovi_ratingnumeric(8,4) / varchar(30)SOVI_SCORE / SOVI_RATNGCDC/ATSDR Social Vulnerability Index score and rating.
resl_score / resl_ratingnumeric(8,4) / varchar(30)RESL_SCORE / RESL_RATNGCommunity Resilience score and rating.
fetched_attimestamptzserver clockTimestamp of ingestion run. Set by DB default (NOW()).

Per-hazard columns (17 hazards Γ— 4 fields)

Column patternTypeNRI source fieldTransformation
{hazard}_risk_scorenumeric(6,2){PREFIX}_RISKSHazard-specific risk index score (0–100). NULL when NRI value is null or the sentinel βˆ’999 (Not Applicable).
{hazard}_risk_ratingvarchar(30){PREFIX}_RISKRText rating: Very High / High / Relatively High / Medium / Relatively Low / Low / Very Low / Not Applicable. Empty string coerced to NULL.
{hazard}_eal_usdbigint{PREFIX}_EALBExpected Annual Loss β€” buildings only (USD). Rounded to integer.
{hazard}_alrnumeric(12,10){PREFIX}_ALRBAnnualized Loss Rate β€” buildings (loss / building exposure value).

Hazard prefixes: avln avalanche Β· cfld coastal flooding Β· cwav cold wave Β· drgt drought Β· erqk earthquake Β· hail hail Β· hwav heat wave Β· hrcn hurricane Β· ifld inland flooding Β· istm ice storm Β· lnds landslide Β· ltng lightning Β· swnd strong wind Β· trnd tornado Β· tsun tsunami Β· vlcn volcanic activity Β· wfir wildfire


🌾

RMA Crop Insurance Loss History

Annual county-level crop insurance indemnity, premium, and loss records from USDA RMA Cause of Loss ZIP files. One row per county Γ— commodity Γ— insurance plan Γ— stage Γ— cause Γ— month.

SourceUSDA RMA β€” Cause of Loss page
FormatZIP-archived pipe-delimited .txt (colsom_YYYY.zip, 29 or 30 columns)
FrequencyAnnual β€” ingested each March 1 for prior commodity year
Destination tablerma_loss_records
Destination fieldTypeSource column (1-indexed)Transformation
fipschar(5)cols 2 + 4state_code.zfill(2) + county_code.zfill(3). Rows where state="00" or county="000" (aggregated totals) are discarded.
state_fipschar(2)col 2Zero-padded to 2 digits.
county_fipschar(3)col 4Zero-padded to 3 digits.
state_abbrvarcharcol 3Passed as-is. NULL if blank.
county_namevarcharcol 5Passed as-is. NULL if blank.
commodity_yearsmallintcol 1Crop year (e.g. 2023). Part of the composite primary key.
commodity_codesmallintcol 6RMA commodity code. Rows with null code discarded.
commodity_namevarcharcol 7Passed as-is. NULL if blank.
insurance_plan_codesmallintcol 8RMA insurance plan code. Part of composite key. Rows with null code discarded.
insurance_plan_abbrvarcharcol 9Passed as-is. NULL if blank.
stage_codevarcharcol 10Crop stage at loss. Defaults to "00" if blank. Part of composite key.
cause_of_loss_codesmallintcol 11 (29-col) / col 12 (30-col)RMA cause of loss code (e.g. 58 = Drought). In the 30-column format (2024+), RMA inserted a sub-stage column at position 10, shifting cause-of-loss and all subsequent columns by one. Part of composite key.
cause_of_loss_descvarcharcol 12 / col 13Human-readable cause description as published by RMA. NULL if blank.
month_of_losssmallintcol 13 / col 141–12; 0 = month unspecified. Part of composite key.
policies_earning_premiumintegercol 16 / col 17Integer count. NULL if blank.
policies_indemnifiedintegercol 17 / col 18Integer count. NULL if blank.
net_planted_acresnumericcol 18 / col 19Commas stripped, parsed to float. Col 19/20 (net endorsed acres) is not stored.
liabilitynumericcol 20 / col 21Total liability (USD). Commas stripped.
total_premiumnumericcol 21 / col 22Total premium (USD). Cols 22–26 (producer paid premium, subsidies, EFA discount) and col 27 (net determined acres) are not stored.
indemnity_amountnumericcol 28 / col 29Indemnity paid (USD). Commas stripped.
loss_rationumericcol 29 / col 30indemnity / total_premium. Passed from source as-is.
ingested_attimestamptzserver clockSet to NOW() on each upsert.

Composite primary key: (commodity_year, state_fips, county_fips, commodity_code, insurance_plan_code, stage_code, cause_of_loss_code, month_of_loss). History available from 1989 onward. The API endpoint aggregates across all plans/stages/months to produce per-county summaries.


πŸ“‰

Yield Volatility

Actuarial yield risk metrics derived from USDA NASS county yield history. Computed by scripts/setup/build_yield_trend.py and stored in county_crop_yield_trend.

Source tablenass_crop_yields
Destination tablecounty_crop_yield_trend (extended columns)
ComputationOLS linear regression (scipy.stats.linregress)
UpdatedAnnually
Destination fieldTypeSource / computation
yield_meanrealnumpy mean of yield_value over all fitted years for (fips, crop)
yield_stdrealnumpy std(ddof=1) of yield_value β€” sample standard deviation
yield_cvreal(yield_std / yield_mean) Γ— 100. NULL when mean = 0
slope_5yrealOLS slope from scipy.stats.linregress over the most recent 5 data years only. NULL when n_years < 5
trend_divergencerealslope_5y βˆ’ slope (long-run). Positive = recent acceleration. NULL when slope_5y is NULL

πŸŒͺ️

Climate & Peril Frequency

Long-run peril frequency indicators derived from PRISM daily climate data and USDM drought records. Computed by scripts/setup/build_climate_risk.py and stored in county_climate_risk.

Source tablesprism_observations, drought_observations
Destination tablecounty_climate_risk
ComputationSQL aggregation β†’ pandas groupby
10-year windowMost recent 10 calendar years
Destination fieldTypeSource / computation
drought_weeks_10ysmallintCOUNT of rows in drought_observations where drought_severity β‰₯ 1 AND valid_date β‰₯ 10-year cutoff
drought_freq_pctnumeric(5,2)(D1+ weeks / total weeks) Γ— 100 over full USDM history
extreme_drought_weeks_10ysmallintCOUNT where drought_severity β‰₯ 3 AND within 10-year window
heat_stress_days_10ysmallintCOUNT of prism_observations rows where tmax_c > 35 AND within 10-year window
heat_stress_days_avg_annualnumeric(5,1)pandas mean of annual heat-stress day counts over full PRISM history
frost_days_10ysmallintCOUNT where tmin_c < 0 AND within 10-year window
frost_days_avg_annualnumeric(5,1)pandas mean of annual frost day counts over full PRISM history
excess_moisture_days_10ysmallintCOUNT where precip_mm > 25 AND within 10-year window
annual_precip_mean_mmnumeric(7,1)pandas mean of SUM(precip_mm) per year, grouped by (fips, year), over full history
annual_precip_cvnumeric(6,2)(std / mean) Γ— 100 of annual precipitation totals
prism_yearssmallintNumber of PRISM years used β€” applies to heat_stress_*, frost_*, excess_moisture_*, annual_precip_*
drought_yearssmallintNumber of USDM years used β€” applies to drought_weeks_10y, drought_freq_pct, extreme_drought_weeks_10y
computed_atdateDate this row was last computed by build_climate_risk.py

🌱

SMAP Soil Moisture Baseline

Per-county per-week-of-year historical statistics used to compute sm_z_score at query time. Computed by scripts/setup/build_smap_baseline.py and stored in smap_baseline. Analogous to ndvi_baseline.

Source tablesmap_observations.sm_mean_am
Destination tablesmap_baseline
Period dimensionISO week of year (1–53, EXTRACT(WEEK FROM obs_date))
Z-score computedAt query time via LEFT JOIN in /soil-moisture/county/{fips}/latest
Destination fieldTypeSource / computation
sm_meannumeric(6,4)pandas mean of sm_mean_am grouped by (fips, ISO week). NULL when low_confidence = TRUE
sm_stdnumeric(6,4)pandas std of sm_mean_am (default ddof=1). NULL when low_confidence = TRUE
obs_countsmallintNumber of valid am-pass observations for this (fips, week) pair
low_confidencebooleanTRUE when obs_count < 5 β€” prevents spurious z-scores from thin history
sm_z_score (at query time)float(sm_mean_am βˆ’ smap_baseline.sm_mean) / smap_baseline.sm_std, rounded to 2 decimal places. NULL when low_confidence or sm_std = 0

πŸ””

County Risk Flags

Pre-computed renewal alert flags derived from drought state, yield trend, climate risk, and primary crop. Computed by scripts/setup/build_risk_flags.py and stored in county_risk_flags.

Source tablesdrought_metrics, county_crop_yield_trend, county_climate_risk, county_primary_crop
Destination tablecounty_risk_flags
UpdatedAfter drought metrics refresh (weekly) or annually
FlagTypeThreshold logic
drought_alertbooleandrought_metrics.drought_regime IN ('persistent', 'deepening') AND drought_observations.drought_severity β‰₯ 2 (D2+)
trend_alertbooleancounty_crop_yield_trend.below_trend_5y β‰₯ 3 for the county's primary crop
volatility_alertbooleancounty_crop_yield_trend.yield_cv > 75th percentile of yield_cv across all counties sharing the same primary crop
climate_alertbooleancounty_climate_risk.heat_stress_days_10y > 75th percentile nationally