Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Collect/ALEXI/DataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 5 additions & 6 deletions Collect/GPM/DataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,15 @@ def RetrieveData(Date, args):

# Create https
if TimeCase == 'daily':
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:1: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_3IMERGDF.06_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.06/%d/3B-MO.MS.MRG.3IMERG.%d%02d01-S000000-E235959.%02d.V06B.HDF5.ascii?precipitation[0:1:0][%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/GPM_L3/GPM_3IMERGM.06/%d/3B-MO.MS.MRG.3IMERG.%d%02d01-S000000-E235959.%02d.V06B.HDF5.ascii?precipitation[0:1:0][%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)
try:
Expand Down
6 changes: 3 additions & 3 deletions Collect/TRMM/DataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions Collect_Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down