support2d = [] ibar = 0; pbar = ProgressBar(maxval=len(xys)).start() for xyi in xys: support2d.append(xysLocateMesh(xyi,slf.IKLE2,slf.MESHX,slf.MESHY,slf.tree,slf.neighbours)) ibar+=1 pbar.update(ibar) pbar.finish() # Extract support in 3D support3d = zip(support2d,len(xys)*[range(slf.NPLAN)]) # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes INI header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ iniFile = options.args[2] ini = SELAFIN('') ini.fole = {} ini.fole.update({ 'hook': open(iniFile,'wb') }) ini.fole.update({ 'name': iniFile}) ini.fole.update({ 'endian': ">" }) # big endian ini.fole.update({ 'float': ('f',4) }) # single precision # Meta data and variable names ini.TITLE = '' ini.NBV1 = 5 # /!\ ELEVATION has to be the first variable # (for possible vertical re-interpolation within TELEMAC) ini.VARNAMES = ['ELEVATION Z ', \ 'VELOCITY U ','VELOCITY V ', \ 'SALINITY ','TEMPERATURE ' ] ini.VARUNITS = ['M ', \ 'M/S ','M/S ', \
for xyi in xys: support2d.append( xysLocateMesh(xyi, slf.IKLE2, slf.MESHX, slf.MESHY, slf.tree, slf.neighbours)) ibar += 1 pbar.update(ibar) pbar.finish() # Extract support in 3D support3d = zip(support2d, len(xys) * [range(slf.NPLAN)]) # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes BND header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bndFile = options.args[3] bnd = SELAFIN('') bnd.fole = {} bnd.fole.update({'hook': open(bndFile, 'wb')}) bnd.fole.update({'name': bndFile}) bnd.fole.update({'endian': ">"}) # big endian bnd.fole.update({'float': ('f', 4)}) # single precision # Meta data and variable names bnd.TITLE = '' bnd.NBV1 = 5 # /!\ ELEVATION has to be the first variable # (for possible vertical re-interpolation within TELEMAC) bnd.VARNAMES = ['ELEVATION Z ', \ 'VELOCITY U ','VELOCITY V ', \ 'SALINITY ','TEMPERATURE ' ] bnd.VARUNITS = ['M ', \ 'M/S ','M/S ', \
for xyi in xys: support2d.append( xysLocateMesh(xyi, slf.IKLE2, slf.MESHX, slf.MESHY, slf.tree, slf.neighbours)) ibar += 1 pbar.update(ibar) pbar.finish() # Extract support in 3D support3d = zip(support2d, len(xys) * [range(slf.NPLAN)]) # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes ATM header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ atmFile = options.args[2] atm = SELAFIN('') atm.fole = {} atm.fole.update({'hook': open(atmFile, 'wb')}) atm.fole.update({'name': atmFile}) atm.fole.update({'endian': ">"}) # big endian atm.fole.update({'float': ('f', 4)}) # single precision # Meta data and variable names atm.TITLE = '' atm.NBV1 = 4 atm.VARNAMES = ['SURFACE PRESSURE', \ 'WIND VELOCITY U ','WIND VELOCITY V ', \ 'AIR TEMPERATURE '] atm.VARUNITS = ['UI ', \ 'M/S ','M/S ', \ 'DEGREES '] atm.NVAR = atm.NBV1