Ejemplo n.º 1
0
    def __init__(self, datestring):
        config.__init__(self)
        dt = utils.convert_cylc_time2(datestring)
        wrfout_time = datetime.datetime.strftime(dt, '%Y-%m-%d_%H:%M:%S')
        max_dom = utils.get_max_dom()
        rundir = self.config['filesystem']['wrf_run_dir']
        archivedir = self.config['filesystem']['archive_dir']
        for dom in range(1, max_dom + 1):
            wrfout = os.path.join(rundir,
                                  'wrfout_d0' + str(dom) + '_' + wrfout_time)
            archived = os.path.join(archivedir,
                                    'wrfout_d0' + str(dom) + '_' + wrfout_time)
            os.system('nc3tonc4 ' + wrfout + ' ' + archived)
            plot_archive = os.path.join(archivedir, 'plot', wrfout_time)
            utils._create_directory(plot_archive)
            #utils._create_directory(os.path.join(plot_archive, trim))
            os.system(
                'ncl /home/haren/cylc-suites/forecast/bin/wrf_Surface3.ncl inputfile='
                + r'\"' + archived + r'\" outputfile=\"' + plot_archive +
                r'/surface_d0' + str(dom) + '.png' + r'\"')

#iname = 'surface_d0' + str(dom) + '.png')
#os.system('convert ' + os.path.join(plot_archive, iname) + ' -fuzz 1% -trim +repage ' + os.path.join(plot_archive, 'trim', iname))
        plot_latest = os.path.join(archivedir, 'plot', 'latest')
        try:
            os.symlink(plot_archive, plot_latest)
        except OSError, e:
            if e.errno == errno.EEXIST:
                os.remove(plot_latest)
                os.symlink(plot_archive, plot_latest)
Ejemplo n.º 2
0
 def __init__(self):
   config.__init__(self)  # load config
   self.rundir = self.config['filesystem']['wrf_run_dir']
   self.wrfda_workdir = os.path.join(self.config['filesystem']['work_dir'],
                                     'wrfda')
   self.max_dom = utils.get_max_dom()  # get maximum domain number
   # copy default 3dvar obsproc namelist to namelist.obsproc
   self.obsproc_dir = os.path.join(self.config['filesystem']['wrfda_dir'],
                                   'var/obsproc')
   # get dictionary with workdir/obs filename per domain
   self.obs = self.get_obsproc_dirs()
Ejemplo n.º 3
0
 def __init__(self, datestring, interval):
     config.__init__(self)
     dt = utils.convert_cylc_time2(datestring)
     prevtime = dt - datetime.timedelta(hours=interval)
     wrfout_time = datetime.datetime.strftime(prevtime, '%Y-%m-%d_%H:%M:%S')
     max_dom = utils.get_max_dom()
     rundir = self.config['filesystem']['wrf_run_dir']
     for dom in range(1, max_dom + 1):
         outfile = os.path.join(rundir,
                                'wrfout_d0' + str(dom) + '_' + wrfout_time)
         infile = os.path.join(rundir, 'wrfinput_d0' + str(dom))
         os.system(
             '/home/haren/cylc-suites/forecast/bin/copy_urb_init.sh ' +
             outfile + ' ' + infile)
Ejemplo n.º 4
0
    def __init__(self, datestring):
        config.__init__(self)
        dt = utils.convert_cylc_time2(datestring)
        wrfout_time = datetime.datetime.strftime(dt, '%Y-%m-%d_%H:%M:%S')
        max_dom = utils.get_max_dom()
        rundir = self.config['filesystem']['wrf_run_dir']
        archivedir = self.config['filesystem']['archive_dir']
        for dom in range(1,max_dom+1):
            wrfout = os.path.join(rundir, 'wrfout_d0' + str(dom) + '_' + wrfout_time)
            archived = os.path.join(archivedir, 'wrfout_d0' + str(dom) + '_' + wrfout_time)
            os.system('nc3tonc4 ' + wrfout + ' ' + archived)
            plot_archive = os.path.join(archivedir, 'plot', wrfout_time)
	    utils._create_directory(plot_archive)
            #utils._create_directory(os.path.join(plot_archive, trim))
	    os.system('ncl /home/haren/cylc-suites/forecast/bin/wrf_Surface3.ncl inputfile=' + r'\"' + archived + r'\" outputfile=\"' + plot_archive + r'/surface_d0' + str(dom) + '.png' + r'\"')
	    #iname = 'surface_d0' + str(dom) + '.png')
            #os.system('convert ' + os.path.join(plot_archive, iname) + ' -fuzz 1% -trim +repage ' + os.path.join(plot_archive, 'trim', iname))
        plot_latest = os.path.join(archivedir, 'plot', 'latest')
        try:
	    os.symlink(plot_archive, plot_latest)
        except OSError, e:
            if e.errno == errno.EEXIST:
                 os.remove(plot_latest)
                 os.symlink(plot_archive, plot_latest)