From f4ef1ec52dff031ed22b574f78d04b008878c858 Mon Sep 17 00:00:00 2001 From: ElgaSalvadore Date: Thu, 25 Jul 2019 08:04:13 +0200 Subject: [PATCH 1/4] Update Collect_Tools.py --- Collect_Tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Collect_Tools.py b/Collect_Tools.py index 0d158ff..8082746 100644 --- a/Collect_Tools.py +++ b/Collect_Tools.py @@ -8,6 +8,7 @@ """ from __future__ import print_function # general modules +#test comment from future import standard_library standard_library.install_aliases() import urllib.request, urllib.parse, urllib.error From ca981fa8e5bd8993103d7b0e5e2351fba34a969d Mon Sep 17 00:00:00 2001 From: ElgaSalvadore Date: Thu, 25 Jul 2019 09:02:08 +0200 Subject: [PATCH 2/4] Update DataAccess.py Update ALEXI (delete temporary big files) --- Collect/ALEXI/DataAccess.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Collect/ALEXI/DataAccess.py b/Collect/ALEXI/DataAccess.py index 7d576f9..7ff5e97 100644 --- a/Collect/ALEXI/DataAccess.py +++ b/Collect/ALEXI/DataAccess.py @@ -186,6 +186,9 @@ def ALEXI_weekly(Date, Enddate, output_folder, latlim, lonlim, Year, Waitbar, to amount += 1 WaitbarConsole.printWaitBar(amount, total_amount, prefix = 'Progress:', suffix = 'Complete', length = 50) + # Delete original file + os.remove(local_filename) + # Check if this file must be downloaded Date = pd.Timestamp(Date) if Date.toordinal() > Stop: From d6bc866ce5183d70ee8118e0b2718486880b6917 Mon Sep 17 00:00:00 2001 From: ElgaSalvadore Date: Thu, 25 Jul 2019 09:02:20 +0200 Subject: [PATCH 3/4] Update DataAccess.py Update GPM to version 6 --- Collect/GPM/DataAccess.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Collect/GPM/DataAccess.py b/Collect/GPM/DataAccess.py index 8a98396..6407230 100644 --- a/Collect/GPM/DataAccess.py +++ b/Collect/GPM/DataAccess.py @@ -115,14 +115,14 @@ def RetrieveData(Date, args): # Create https if TimeCase == 'daily': - URL = 'https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3/GPM_3IMERGDF.05/%d/%02d/3B-DAY.MS.MRG.3IMERG.%d%02d%02d-S000000-E235959.V05.nc4.ascii?precipitationCal[%d:1:%d][%d:1:%d]' %(year, month, year, month, day, xID[0], xID[1]-1, yID[0], yID[1]-1) - DirFile = os.path.join(output_folder, "P_TRMM3B42.V7_mm-day-1_daily_%d.%02d.%02d.tif" %(year, month, day)) + URL = 'https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3/GPM_3IMERGDF.06/%d/%02d/3B-DAY.MS.MRG.3IMERG.%d%02d%02d-S000000-E235959.V06.nc4.ascii?precipitationCal[0][%d:1:%d][%d:1:%d]' %(year, month, year, month, day, xID[0], xID[1]-1, yID[0], yID[1]-1) + DirFile = os.path.join(output_folder, "P_GPM.IMERG.V6_mm-day-1_daily_%d.%02d.%02d.tif" %(year, month, day)) Scaling = 1 if TimeCase == 'monthly': - URL = 'https://gpm1.gesdisc.eosdis.nasa.gov/opendap/hyrax/GPM_L3/GPM_3IMERGM.05/%d/3B-MO.MS.MRG.3IMERG.%d%02d01-S000000-E235959.%02d.V05B.HDF5.ascii?precipitation[%d:1:%d][%d:1:%d]' %(year, year, month, month, xID[0], xID[1]-1, yID[0], yID[1]-1) + URL = 'https://gpm1.gesdisc.eosdis.nasa.gov/opendap/hyrax/GPM_L3/GPM_3IMERGM.06/%d/3B-MO.MS.MRG.3IMERG.%d%02d01-S000000-E235959.%02d.V06B.HDF5.ascii?precipitation[0][%d:1:%d][%d:1:%d]' %(year, year, month, month, xID[0], xID[1]-1, yID[0], yID[1]-1) Scaling = calendar.monthrange(year,month)[1] * 24 - DirFile = os.path.join(output_folder, "P_GPM.IMERG_mm-month-1_monthly_%d.%02d.01.tif" %(year, month)) + DirFile = os.path.join(output_folder, "P_GPM.IMERG.V6_mm-month-1_monthly_%d.%02d.01.tif" %(year, month)) if not os.path.isfile(DirFile): dataset = requests.get(URL, allow_redirects=False,stream = True) From 219eb407e11f09157eb57dd0e031f90d7f89688f Mon Sep 17 00:00:00 2001 From: ElgaSalvadore Date: Thu, 25 Jul 2019 09:02:31 +0200 Subject: [PATCH 4/4] Update DataAccess.py Update TRMM file names changed --- Collect/TRMM/DataAccess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Collect/TRMM/DataAccess.py b/Collect/TRMM/DataAccess.py index 548f396..a58bb27 100644 --- a/Collect/TRMM/DataAccess.py +++ b/Collect/TRMM/DataAccess.py @@ -120,11 +120,11 @@ def RetrieveData(Date, args): Scaling = 1 if TimeCase == 'monthly': - if Date >= pd.Timestamp('2010-10-01'): - URL = 'https://disc2.gesdisc.eosdis.nasa.gov/opendap/TRMM_L3/TRMM_3B43.7/%d/3B43.%d%02d01.7.HDF.ascii?precipitation[%d:1:%d][%d:1:%d]' %(year, year, month, xID[0], xID[1]-1, yID[0], yID[1]-1) + if Date >= pd.Timestamp('2000-01-01') and Date < pd.Timestamp('2010-10-01'): + URL = 'https://disc2.gesdisc.eosdis.nasa.gov/opendap/TRMM_L3/TRMM_3B43.7/%d/3B43.%d%02d01.7A.HDF.ascii?precipitation[%d:1:%d][%d:1:%d]' %(year, year, month, xID[0], xID[1]-1, yID[0], yID[1]-1) else: - URL = 'https://disc2.gesdisc.eosdis.nasa.gov/opendap/TRMM_L3/TRMM_3B43.7/%d/3B43.%d%02d01.7A.HDF.ascii?precipitation[%d:1:%d][%d:1:%d]' %(year, year, month, xID[0], xID[1]-1, yID[0], yID[1]-1) + URL = 'https://disc2.gesdisc.eosdis.nasa.gov/opendap/TRMM_L3/TRMM_3B43.7/%d/3B43.%d%02d01.7.HDF.ascii?precipitation[%d:1:%d][%d:1:%d]' %(year, year, month, xID[0], xID[1]-1, yID[0], yID[1]-1) Scaling = calendar.monthrange(year,month)[1] * 24 DirFile = os.path.join(output_folder, "P_TRMM3B43.V7_mm-month-1_monthly_%d.%02d.01.tif" %(year, month))