#=================================================================
#                Process_NASA_Datos.py código de controlar
#                Process_NASA_Datos.py Terminal script
#-----------------------------------------------------------------
#(Espanol)
#   Script para interactuar con el contenido de pitón de la NASA
#   DEVELOP paquete usuario. Los procesos que el usuario no desea
#   ejecutar deben ser comentadas.
#
#(English)
#   Master script for interfacing with python contents of
#   NASA DEVELOP user package. Processes that the user does not wish
#   to run should be commented out.
#
# Descripciones de entrada
#   Package =   Filepath to NASA DEVELOP SRM folder
#   Basin =     Folder containing basin to analyze
#   Year =      String value for desired year
#   zonefield=  Name of field for basin shapefile designating all
#                area over 2000 meters where precipitation inputs
#                are to be applyed from TRMM (or GPM) calculations.
#
# vValores de entrada ejemplo
#   Package =   'C:/Users/jwely/NASA_DEVELOP_TESTBED'
#   Basin =     'Atacama_Copiapo'
#   Year =      '2011'
#   zonefield = 'NASA'
#
#=================================================================
#                           User Input values
#-----------------------------------------------------------------
Package = 'C:/Users/jwely/NASA_DEVELOP_TESTBED'
Basin = 'Coquimbo_Limari'
Year = '2011'
zonefield =  'NASA'
#=================================================================

# Import modules and begin timer functions
import nasa, time, sys
start = time.time()

Year=str(Year)

try: 
    print '==================================================='
    print 'Begin processing of',Basin,' for year',Year
    
# Process MODIS data
    nasa.Process_MODIS(Package,Basin,Year)
    end=time.time()
    print 'Elapsed Time: ' + str((end - start)/60) + ' minutes'
    
# Process TRMM data
    nasa.Process_TRMM(Package,Basin,Year,zonefield)
    end=time.time()
    print 'Elapsed Time: ' + str((end - start)/60) + ' minutes'
    
except:
    
# Skip bad entry if failure.
    print 'Failed to process',Basin,' for year', Year
        
print '==================================================='

