Skip to content

Commit

Permalink
Switch to version 2 of snow data
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss committed Jan 13, 2025
1 parent 0353428 commit 17201a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/app/jobs/viirs_snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@

BC_BOUNDING_BOX = "-139.06,48.3,-114.03,60"
NSIDC_URL = "https://n5eil02u.ecs.nsidc.org/egi/request"
PRODUCT_VERSION = 1
PRODUCT_VERSION = 2
SHORT_NAME = "VNP10A1F"
# Leaving this here for when we switch to version 2 eventually
# LAYER_VARIABLE = "/VIIRS_Grid_IMG_2D/CGF_NDSI_Snow_Cover"
LAYER_VARIABLE = "/NPP_Grid_IMG_2D/CGF_NDSI_Snow_Cover"
LAYER_VARIABLE = "/VIIRS_Grid_IMG_2D/CGF_NDSI_Snow_Cover"
RAW_SNOW_COVERAGE_NAME = 'raw_snow_coverage.tif'
RAW_SNOW_COVERAGE_CLIPPED_NAME = 'raw_snow_coverage_clipped.tif'
BINARY_SNOW_COVERAGE_CLASSIFICATION_NAME = 'binary_snow_coverage.tif'
Expand Down Expand Up @@ -234,8 +232,11 @@ async def _run_viirs_snow(self):
last_processed_date = await self._get_last_processed_date()
today = date.today()
if last_processed_date is None:
# Case to cover the initial run of VIIRS snow processing (ie. start processing one week ago)
next_date = today - timedelta(days=7)
# Case to cover the initial run of VIIRS snow processing (ie. start processing yesterday)
next_date = today - timedelta(days=1)

Check warning on line 236 in api/app/jobs/viirs_snow.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/viirs_snow.py#L236

Added line #L236 was not covered by tests
elif today - last_processed_date > timedelta(days=14):
# Jan 13, 2025 - Start gathering snow data from the start of 2025 give or take a day
next_date = today - timedelta(days=14)

Check warning on line 239 in api/app/jobs/viirs_snow.py

View check run for this annotation

Codecov / codecov/patch

api/app/jobs/viirs_snow.py#L239

Added line #L239 was not covered by tests
else:
# Start processing the day after the last record of a successful job.
next_date = last_processed_date + timedelta(days=1)
Expand Down

0 comments on commit 17201a2

Please sign in to comment.