Пример #1
0
from instruments.matchup_manager import Matchup_Manager
import basins.OGS as OGS
from instruments import lovbio_float as bio_float
from commons.mask import Mask
from commons.utils import addsep
from datetime import timedelta
from datetime import datetime
from commons import timerequestors

meantime = datetime.strptime(args.time, '%Y%m%d')

INPUTDIR = addsep(args.inputdir)
BASEDIR = addsep(args.basedir)

TI_week = timerequestors.Weekly_req(meantime.year, meantime.month,
                                    meantime.day).time_interval
TI_day = timerequestors.Daily_req(meantime.year, meantime.month,
                                  meantime.day).time_interval

Profilelist = bio_float.FloatSelector(None, TI_week, OGS.med)
TL = TimeList.fromfilenames(TI_day, INPUTDIR, "ave*.nc", filtervar="P_l")
TL.inputFrequency = 'weekly'
M = Matchup_Manager(Profilelist, TL, BASEDIR)

profilerscript = BASEDIR + 'jobProfiler.sh'
descriptor = "/pico/scratch/userexternal/lmariott/FLOAT_DA_01/wrkdir/float_preproc/VarDescriptor.xml"
M.writefiles_for_profiling(
    descriptor, profilerscript,
    aggregatedir=INPUTDIR)  # preparation of data for aveScan
M.dumpModelProfiles(profilerscript)  # sequential launch of aveScan
Пример #2
0
# location of input big ave files, usually the TMP directory.
# ave files are supposed to have N3n, O2o and chl
INPUTDIR="/pico/scratch/userexternal/gbolzon0/PROFILATORE/AVE/"

# output directory, where aveScan.py will be run.
BASEDIR='/pico/scratch/userexternal/gbolzon0/PROFILATORE/'

DATESTART = '20150901-00:00:00'
DATE__END = '20150917-00:00:00'

T_INT = TimeInterval(DATESTART,DATE__END, '%Y%m%d-%H:%M:%S')
TL = TimeList.fromfilenames(T_INT, INPUTDIR,"ave*.nc")

ALL_PROFILES = instruments.getAllProfiles(T_INT)

vardescriptorfile="VarDescriptor_valid_online.xml"
#This previous part will be imported in matchups setup.

# The following part, the profiler, is executed once and for all.
# It might take some time, depending on length of simulation or size of files.
if __name__ == '__main__':
    # Here instruments time and positions are read as well as model times
    M = Matchup_Manager(ALL_PROFILES,TL,BASEDIR)


    profilerscript = BASEDIR + 'jobProfiler.sh'

    M.writefiles_for_profiling(vardescriptorfile, profilerscript) # preparation of data for aveScan

    M.dumpModelProfiles(profilerscript) # sequential launch of aveScan