From 17201a213dd06056a23e17b9ed0060215e0a4396 Mon Sep 17 00:00:00 2001 From: Darren Boss Date: Mon, 13 Jan 2025 14:19:23 -0800 Subject: [PATCH] Switch to version 2 of snow data --- api/app/jobs/viirs_snow.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/app/jobs/viirs_snow.py b/api/app/jobs/viirs_snow.py index f8ac64777..0c67b5379 100644 --- a/api/app/jobs/viirs_snow.py +++ b/api/app/jobs/viirs_snow.py @@ -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' @@ -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) + 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) else: # Start processing the day after the last record of a successful job. next_date = last_processed_date + timedelta(days=1)