Changeset e7708b2 in flex_extract.git
- Timestamp:
- Jul 29, 2019, 10:01:49 AM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 8ce3be6
- Parents:
- 7c7e672
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/mods/checks.py
rd727af2 re7708b2 1 #!/usr/bin/env python 31 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 3 #******************************************************************************* … … 24 24 # ------------------------------------------------------------------------------ 25 25 26 from __future__ import print_function 26 27 import os 27 28 import sys 29 28 30 import _config 29 31 try: … … 32 34 import builtins as exceptions 33 35 from datetime import datetime 34 import numpy as np35 36 from mods.tools import my_error, silent_remove 36 37 # ------------------------------------------------------------------------------ … … 86 87 grid = gridx 87 88 else: 88 raise ValueError('GRID parameter contains two values ' 89 'which are unequal %s' (grid)) 89 raise ValueError('GRID parameter contains two ' 90 'different values: %s' (grid)) 91 # # determine grid format 92 # if float(grid) / 100. >= 0.5: 93 # # grid is defined in 1/1000 degrees; old format 94 # grid = '{}/{}'.format(float(grid) / 1000., 95 # float(grid) / 1000.) 96 # elif float(grid) / 100. < 0.5: 97 # # grid is defined in normal degree; new format 98 # grid = '{}/{}'.format(float(grid), float(grid)) 99 100 90 101 # determine grid format 91 if float(grid) / 100. >= 0.5:92 # grid is defined in 1/1000 degrees; old format93 grid = '{}/{}'.format(float(grid) / 1000.,94 95 el if float(grid) / 100. < 0.5:96 # grid is defined in normaldegree; new format102 # assumes that nobody wants grid spacings of 20 deg or more 103 if float(grid) >= 20.: 104 # grid is defined in 1/1000 degree; old format 105 grid = '{}/{}'.format(float(grid) / 1000., float(grid) / 1000.) 106 else: 107 # grid is defined in degree; new format 97 108 grid = '{}/{}'.format(float(grid), float(grid)) 109 98 110 99 111 return grid … … 290 302 List of forecast steps in format e.g. [001, 002, ...] 291 303 ''' 304 import numpy as np 292 305 293 306 if '/' in step: … … 466 479 ''' 467 480 if queue in _config.QUEUES_LIST and \ 468 not gateway or not destination or \469 not ecuid or not ecgid:481 (not gateway or not destination or 482 not ecuid or not ecgid): 470 483 raise ValueError('\nEnvironment variables GATEWAY, DESTINATION, ECUID ' 471 484 'and ECGID were not set properly! \n ' … … 689 702 690 703 691 def check_acctime(acctime, marsclass, purefc ):704 def check_acctime(acctime, marsclass, purefc, time): 692 705 '''Guarantees that the accumulation forecast times were set. 693 706 … … 724 737 elif marsclass.upper() == 'OD' and not purefc: # On-demand 725 738 acctime = '00/12' 739 elif marsclass.upper() == 'OD' and purefc: # On-demand 740 acctime = time[0] 726 741 else: 727 742 raise ValueError('ERROR: Accumulation forecast time can not ' … … 820 835 if not job_chunk: 821 836 return job_chunk 837 else: 838 job_chunk = int(job_chunk) 822 839 823 840 if job_chunk < 0:
Note: See TracChangeset
for help on using the changeset viewer.