From d9113c73211a2cf34910697b350721a926a48e3c Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 10:17:06 +0000 Subject: [PATCH 1/8] switch to 15 mintues data, if less than 1 hour of 5 min data --- satip/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/satip/app.py b/satip/app.py index 44406f5f..1f01b578 100644 --- a/satip/app.py +++ b/satip/app.py @@ -241,8 +241,11 @@ def run( start_date=start_date.strftime("%Y-%m-%d-%H:%M:%S"), end_date=pd.Timestamp(start_time, tz="UTC").strftime("%Y-%m-%d-%H:%M:%S"), ) + # Check if any RSS imagery is available, if not, fall back to 15 minutely data - if (len(datasets) == 0) or use_hr_serviri: + # We check if there are less than 12 datasets, which is 1 hour of 5 minute data. + # If there is less than this, we move over to the 15 minute data + if (len(datasets) < 12) or use_hr_serviri: log.warn( f"No RSS Imagery available or using backup ({use_hr_serviri=}), " f"falling back to 15-minutely data", From a015d7082bc780a57f5ba03b5819f61ccd448722 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 10:18:43 +0000 Subject: [PATCH 2/8] redcue to 30 mins --- satip/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satip/app.py b/satip/app.py index 1f01b578..49186838 100644 --- a/satip/app.py +++ b/satip/app.py @@ -245,7 +245,7 @@ def run( # Check if any RSS imagery is available, if not, fall back to 15 minutely data # We check if there are less than 12 datasets, which is 1 hour of 5 minute data. # If there is less than this, we move over to the 15 minute data - if (len(datasets) < 12) or use_hr_serviri: + if (len(datasets) < 7) or use_hr_serviri: log.warn( f"No RSS Imagery available or using backup ({use_hr_serviri=}), " f"falling back to 15-minutely data", From ee144ae87f016c4f4cd3879adbc86f1fa2ff189b Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 10:19:26 +0000 Subject: [PATCH 3/8] update text --- satip/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satip/app.py b/satip/app.py index 49186838..eb6b4c75 100644 --- a/satip/app.py +++ b/satip/app.py @@ -243,7 +243,7 @@ def run( ) # Check if any RSS imagery is available, if not, fall back to 15 minutely data - # We check if there are less than 12 datasets, which is 1 hour of 5 minute data. + # We check if there are less than 7 datasets, which is 30 minutes of 5 minute data. # If there is less than this, we move over to the 15 minute data if (len(datasets) < 7) or use_hr_serviri: log.warn( From e6a570388a3049a9e10c2adfded5d6b8dfbf4dfa Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 10:44:27 +0000 Subject: [PATCH 4/8] flexparser-0.3.1 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 31369bae..67cb0817 100644 --- a/requirements.txt +++ b/requirements.txt @@ -117,3 +117,4 @@ zarr==2.17.0 zict==3.0.0 zipp==3.17.0 sentry-sdk +flexparser-0.3.1 From 787472325838bb17e6705b14f61daee18b7832e3 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 10:49:56 +0000 Subject: [PATCH 5/8] fix --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 67cb0817..0bcd7957 100644 --- a/requirements.txt +++ b/requirements.txt @@ -117,4 +117,4 @@ zarr==2.17.0 zict==3.0.0 zipp==3.17.0 sentry-sdk -flexparser-0.3.1 +flexparser==0.3.1 From c3b1a875d3201c4576fa41592c75413a9b339de8 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 11:14:48 +0000 Subject: [PATCH 6/8] up to 1.5 hours of data --- satip/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/satip/app.py b/satip/app.py index eb6b4c75..9cbf62fe 100644 --- a/satip/app.py +++ b/satip/app.py @@ -243,9 +243,10 @@ def run( ) # Check if any RSS imagery is available, if not, fall back to 15 minutely data - # We check if there are less than 7 datasets, which is 30 minutes of 5 minute data. + # We check if there are less than 18 datasets, + # which is 1 hour and 30 minutes of 5 minute data. # If there is less than this, we move over to the 15 minute data - if (len(datasets) < 7) or use_hr_serviri: + if (len(datasets) < 18) or use_hr_serviri: log.warn( f"No RSS Imagery available or using backup ({use_hr_serviri=}), " f"falling back to 15-minutely data", From 2635a18e618a9dfb7d3079f6d3d6e209eee5eb11 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 11:18:22 +0000 Subject: [PATCH 7/8] change to percentage of history --- satip/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/satip/app.py b/satip/app.py index 9cbf62fe..5f20e35b 100644 --- a/satip/app.py +++ b/satip/app.py @@ -243,9 +243,10 @@ def run( ) # Check if any RSS imagery is available, if not, fall back to 15 minutely data - # We check if there are less than 18 datasets, - # which is 1 hour and 30 minutes of 5 minute data. + # We want to check if there is at least 75% of the history data available # If there is less than this, we move over to the 15 minute data + # note we need history data to be larger than this. + n_datasets_needed = int(pd.to_timedelta(history) / pd.Timedelta("5 min") * 0.75) if (len(datasets) < 18) or use_hr_serviri: log.warn( f"No RSS Imagery available or using backup ({use_hr_serviri=}), " From 0f972f892b93b4cb638a1c2a16be1a9cb1951b33 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 7 Nov 2024 11:19:32 +0000 Subject: [PATCH 8/8] fix --- satip/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satip/app.py b/satip/app.py index 5f20e35b..47d0af7a 100644 --- a/satip/app.py +++ b/satip/app.py @@ -247,7 +247,7 @@ def run( # If there is less than this, we move over to the 15 minute data # note we need history data to be larger than this. n_datasets_needed = int(pd.to_timedelta(history) / pd.Timedelta("5 min") * 0.75) - if (len(datasets) < 18) or use_hr_serviri: + if (len(datasets) < n_datasets_needed) or use_hr_serviri: log.warn( f"No RSS Imagery available or using backup ({use_hr_serviri=}), " f"falling back to 15-minutely data",