sys.path.append("../")
    from utils import log, config, ftp, filesystem


# Parameters
year = "2014"
month = "04"
product = "3B42RT"

# Initiate utilities
c = config.Config("TRMM")
l = log.Logger("TRMM")
subfolders = c.get("subfolders")

# Get layers list
nasa_layers = ftp.listDir(c.get("ftp"), c.get("ftp_dir") + year + month + "/")

# Filter the 1day at midnight ones
fao_layers = filter(lambda x: "00.7.1day." in x, nasa_layers)

# Create TRMM structure in the filesystem
# filesystem.create_trmm_structure(product, year, month)

print filesystem

# Download TRMM
targetDir = "/home/vortex/Desktop/TRMM/04/"

print targetDir
ftp.downloadList(c.get("ftp"), c.get("ftp_dir") + year + month + "/", targetDir, fao_layers)
Exemple #2
0
        process_data(self.name, self.q)
        l.info('Exiting ' + self.name)

def process_data(threadName, q):
    while not exitFlag:
        queueLock.acquire()
        if not workQueue.empty():
            data = q.get()
            queueLock.release()
            raster.modisDownloadExtractDelete(product, year, day, data)
            l.info(threadName + ' processing ' + data)
        else:
            queueLock.release()
        time.sleep(1)

layers = ftp.listDir('ladsweb.nascom.nasa.gov', '/allData/5/' + product + '/' + year + '/' + day + '/')

threadList = []
for i in range(0, c.get('threads')):
    threadList.append('T' + str(i))

nameList = layers
queueLock = threading.Lock()
workQueue = Queue.Queue(len(layers))
threads = []
threadID = 1

# Create new threads
for tName in threadList:
    thread = MODIS(threadID, tName, workQueue)
    thread.start()
Exemple #3
0
import sys

try:
    from utils import log, config, ftp, filesystem
except Exception, e:
    sys.path.append('../')
    from utils import log, config, ftp, filesystem


# Parameters
year = '2014'
month = '04'
product = '3B42RT'

# Initiate utilities
c = config.Config('TRMM')
l = log.Logger('TRMM')
subfolders = c.get('subfolders')

# Get layers list
nasa_layers = ftp.listDir(c.get('ftp'), c.get('ftp_dir') + year + month + '/')

# Filter the 1day at midnight ones
fao_layers = filter(lambda x: '00.7.1day.' in x, nasa_layers)

# Create TRMM structure in the filesystem
filesystem.create_trmm_structure(product, year, month)

# Download TRMM
targetDir = c.get('targetDir') + '/' + product + '/' + year + '/' + month + '/' + subfolders['original'] + '/'
ftp.downloadList(c.get('ftp'), c.get('ftp_dir') + year + month + '/', targetDir, fao_layers)