Changeset 70fee58 in flex_extract.git for source/python/classes/EcFlexpart.py
- Timestamp:
- Oct 12, 2018, 1:17:12 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 785b882
- Parents:
- 5827ff6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/EcFlexpart.py
raa275fc r70fee58 85 85 codes_get_values, codes_set_values, codes_set, 86 86 codes_write, codes_release, codes_new_from_index, 87 codes_index_release )87 codes_index_release, codes_index_get) 88 88 89 89 # software specific classes and modules from flex_extract … … 136 136 self.types = dict() 137 137 138 if c.maxstep > len(c.type): # Pure forecast mode 138 # Pure forecast mode 139 if c.maxstep > len(c.type) and 'AN' not in c.type: 139 140 c.type = [c.type[0]] 140 141 c.step = ['{:0>3}'.format(int(c.step[0]))] … … 168 169 btlist = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0] 169 170 170 if ((ty.upper() == 'AN' and 171 int(c.time[i]) % int(c.dtime) ==0) or 172 (ty.upper() != 'AN' and 173 int(c.step[i]) % int(c.dtime) == 0 and 174 int(c.step[i]) % int(c.dtime) == 0) ) and \ 171 if ((ty.upper() == 'AN' and (int(c.time[i]) % int(c.dtime)) == 0) or 172 (ty.upper() != 'AN' and (int(c.step[i]) % int(c.dtime)) == 0 and 173 (int(c.step[i]) % int(c.dtime) == 0)) ) and \ 175 174 (int(c.time[i]) in btlist or c.maxstep > 24): 176 175 … … 434 433 #index_vals.append(grib_index_get(iid, key)) 435 434 #print(index_vals[-1]) 436 key_vals = grib_index_get(iid, key)435 key_vals = codes_index_get(iid, key) 437 436 print(key_vals) 438 437 # have to sort the steps for disaggregation, … … 532 531 if isinstance(pv, str): 533 532 continue 534 retr_param_dict['type'] = '' +ftype533 retr_param_dict['type'] = ftype 535 534 retr_param_dict['time'] = self.types[ftype]['times'] 536 535 retr_param_dict['step'] = self.types[ftype]['steps'] … … 538 537 retr_param_dict['stream'] = self.stream 539 538 retr_param_dict['target'] = \ 540 self._mk_targetname(ftype, pk, 539 self._mk_targetname(ftype, 540 pk, 541 541 retr_param_dict['date'].split('/')[0]) 542 542 retr_param_dict['param'] = pv[0] … … 689 689 690 690 loader = TemplateLoader(_config.PATH_TEMPLATES, auto_reload=False) 691 compile_template = loader.load(_config.TEMPFILE_NAMELIST,691 namelist_template = loader.load(_config.TEMPFILE_NAMELIST, 692 692 cls=NewTextTemplate) 693 693 … … 701 701 maxb = int((area[0] - area[2]) / grid[0]) + 1 702 702 703 stream = compile_template.generate(703 stream = namelist_template.generate( 704 704 maxl = str(maxl), 705 705 maxb = str(maxb), … … 1216 1216 print(self.outputfilelist) 1217 1217 1218 if c.format.lower() == 'grib2': 1219 for ofile in self.outputfilelist: 1218 for ofile in self.outputfilelist: 1219 ofile = os.path.join(self.inputdir, ofile) 1220 1221 if c.format.lower() == 'grib2': 1220 1222 p = subprocess.check_call(['grib_set', '-s', 'edition=2, \ 1221 1223 productDefinitionTemplateNumber=8', … … 1223 1225 p = subprocess.check_call(['mv', ofile + '_2', ofile]) 1224 1226 1225 if c.ectrans and not c.ecapi: 1226 for ofile in self.outputfilelist: 1227 if c.ectrans and not c.ecapi: 1227 1228 p = subprocess.check_call(['ectrans', '-overwrite', '-gateway', 1228 1229 c.gateway, '-remote', c.destination, 1229 1230 '-source', ofile]) 1230 1231 1231 if c.ecstorage and not c.ecapi: 1232 for ofile in self.outputfilelist: 1232 if c.ecstorage and not c.ecapi: 1233 1233 p = subprocess.check_call(['ecp', '-o', ofile, 1234 1234 os.path.expandvars(c.ecfsdir)]) 1235 1235 1236 if c.outputdir != c.inputdir: 1237 for ofile in self.outputfilelist: 1236 if c.outputdir != c.inputdir: 1238 1237 p = subprocess.check_call(['mv', 1239 1238 os.path.join(c.inputdir, ofile),
Note: See TracChangeset
for help on using the changeset viewer.