Skip to content

Commit

Permalink
Merge pull request palexandremello#3 from spestana/master
Browse files Browse the repository at this point in the history
Specify data directory for ABI downloads
  • Loading branch information
palexandremello authored May 12, 2020
2 parents 3e79de0 + 481a559 commit 6df8f5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 11 additions & 9 deletions goespy/Downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from the GOES satellite """


def ABI_Downloader(bucket, year, month, day, hour, product, channel):
""" ABI_Downloader(bucket,year,month,day,hour,product,channel): All these variables are strings.
def ABI_Downloader(home, bucket, year, month, day, hour, product, channel):
""" ABI_Downloader(home, bucket,year,month,day,hour,product,channel): All these variables are strings.
The first argument is the Bucket it's the reposity where has the contents from the satellite, example:
Bucket='noaa-goes16'
home = string, set directory to download ABI products
bucket='noaa-goes16'
year = can be List or a single string to Year date: example = ['2017','2018'] or "2018
month = can be List or a single string to month date: example = ['03','04'] or "03"
day = can be List or a single string for day date: example = ['10','20','30'] or "20"
Expand Down Expand Up @@ -62,7 +63,7 @@ def ABI_Downloader(bucket, year, month, day, hour, product, channel):

# creating the new directory where we will put the dataset from the bucket

path = checkData.createPathGoesData(bucket,
path = checkData.createPathGoesData(home, bucket,
i, mth, day[days], prod, nindex, ch)

#checking if the file exist on the new directory and your size
Expand All @@ -88,11 +89,12 @@ def ABI_Downloader(bucket, year, month, day, hour, product, channel):
return 0


def GLM_Downloader(bucket, year, month, day, hour):
""" GLM_Downloader(bucket,year,month,day,hour): All these variables are strings.
def GLM_Downloader(home, bucket, year, month, day, hour):
""" GLM_Downloader(home, bucket,year,month,day,hour): All these variables are strings.
The first argument is the Bucket it's the reposity where has the contents from the satellite, example:
Bucket='noaa-goes16'
home = string, set directory to download GLM products
bucket='noaa-goes16'
year = type List for Year date: example = ['2017','2018']
month = type List for month date: example = ['03','04']
day = type List for day date: example = ['10','20','30']
Expand Down Expand Up @@ -132,7 +134,7 @@ def GLM_Downloader(bucket, year, month, day, hour):
filename = object.key.rsplit('/', 1)[1]
## creating the directory where will put the dataset from the bucket
pathFile = checkData.createPathGoesData(
bucket, i, mth, day[days], prod, nindex)
home, bucket, i, mth, day[days], prod, nindex)

# checking if the data exist and your size!!!
if checkData.checkFiles(pathFile, filename):
Expand All @@ -153,4 +155,4 @@ def GLM_Downloader(bucket, year, month, day, hour):

days += 1

return 0
return 0
3 changes: 1 addition & 2 deletions goespy/checkData.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def createPathGoesData(bucket, year, month, day, product, hour, channel=None):
def createPathGoesData(home, bucket, year, month, day, product, hour, channel=None):
""" The modules reponsive about the has files on the new directory created with the createPathGoesData,
and if has a same File, check if are broken"""
"""Function used create a directory, with the calendar date the user give to function"""
Expand All @@ -10,7 +10,6 @@ def createPathGoesData(bucket, year, month, day, product, hour, channel=None):
'''
satGoesPath = bucket.partition('noaa-')[2]

home = setHome()
if channel == None:
## the code will try create the directory where the GOES-data will be saved, if has a except error as existent directory
## that error will be finish
Expand Down

0 comments on commit 6df8f5e

Please sign in to comment.