Skip to content

SFMS: RH Interpolation#5122

Open
conbrad wants to merge 32 commits intomainfrom
task/sfms-rh-interpolation
Open

SFMS: RH Interpolation#5122
conbrad wants to merge 32 commits intomainfrom
task/sfms-rh-interpolation

Conversation

@conbrad
Copy link
Collaborator

@conbrad conbrad commented Feb 10, 2026

  1. Add StationDewPointSource that reads dew point directly from station actuals (new dewpoint field on SFMSDailyActual)
  2. Adjust dewpoints with sea level adjustments: td_sea = td + elevation * 0.002
  3. Interpolate dew point to raster with IDW
  4. Adjust dewpoints back with elevation from the DEM: td = td_sea - elevation * 0.002
  5. Compute RH using Arden Buck
  6. Add RHInterpolationProcessor to orchestrate dew point interpolation, RH computation, and S3 upload
  7. Refactor shared lapse-rate logic into LapseRateAdjustedSource base class used by both temperature and dew point sources
  • Extract LapseRateAdjustedSource base class shared by temperature and dew point sources
  • Added a GET daily schema Bruno request for verifying dailies have dewpoint values

Closes #5103

Test Links:

Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.82%. Comparing base (c7f1eb8) to head (78987b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5122      +/-   ##
==========================================
+ Coverage   69.81%   69.82%   +0.01%     
==========================================
  Files         410      410              
  Lines       17856    17863       +7     
  Branches     2000     2000              
==========================================
+ Hits        12466    12473       +7     
  Misses       4765     4765              
  Partials      625      625              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@conbrad conbrad requested review from brettedw and dgboss February 10, 2026 23:05
@dgboss
Copy link
Collaborator

dgboss commented Feb 11, 2026

In temperature.py there is a call to temperature_source.get_interpolation_data() which I believe you need to pass the LAPSE_RATE to as a parameter as LapseRateAdjustedSource.get_interpolation_data() uses DEW_POINT_LAPSE_RATE as a default. Or make the default LAPSE_RATE.

Comment on lines 5 to 6
1. Interpolate dew point temperatures to a raster using IDW with elevation adjustment
(using the dew point lapse rate of 4.0°C/km, not the dry-bulb 6.5°C/km)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did the 4 degrees come from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It came from JE but I'm gonna run some further tests to see if the 2 degree standard will work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please update the comment to reflect the 2*C and the source for that choice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0644f52

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR, but what are your guys thoughts on keeping everything related to "modern SFMS" (apart from db models/schemas) in the wps_sfms package? SFMS jobs included
@dgboss

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the ultimate goal, even the models/schema if unused by other packages should be separate and not in shared. I want to try to rework our devops pipeline before tackling this though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Conor, everything unique to a package should be contained within that package.

@conbrad conbrad requested review from brettedw and dgboss February 13, 2026 00:41
Copy link
Collaborator

@dgboss dgboss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

conbrad and others added 2 commits February 17, 2026 13:33
…humidity.py

Co-authored-by: dgboss <darren.boss@gov.bc.ca>
…humidity.py

Co-authored-by: dgboss <darren.boss@gov.bc.ca>
@sonarqubecloud
Copy link

# This matches the CWFIS implementation
LAPSE_RATE = 0.0065

# Dew point lapse rate: 2.0°C per 1000m: https://www.atmos.illinois.edu/~snodgrss/Airflow_over_mtn.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't work for me, might be temporary though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2026-02-17 at 1 43 25 PM I see this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Copy link
Collaborator

@brettedw brettedw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SFMS: RH Interpolation

3 participants