-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
110 lines (88 loc) · 4.31 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'''
this file contains the default configuration, which can be overridden by
* environment variables prefixed with 'FLASK_', either in the environment or a .env file
* a config.toml file at the root of the repository or at a location given by FLASK_CONFIG
'''
# flask environment
ENV = 'production' # choose from 'production', 'development', 'testing'
# enable Cross-Origin Resource Sharing (CORS)
CORS = True
# log level and (optional) path to flask.log
LOG_LEVEL = 'ERROR'
LOG_PATH = None
# the base url the api is running on, in production this will be something like https://api.example.com/api/v2
BASE_URL = 'http://127.0.0.1:5000'
# the output url the download packages will be available on
OUTPUT_URL = 'http://127.0.0.1/api/output/'
# input path to the NetCDF files to process
INPUT_PATH = 'input'
# temporary path to store interim files
TMP_PATH = 'tmp'
# output path to store the created download packages, this directory should be exposed on OUTPUT_URL
OUTPUT_PATH = 'output'
# output prefix to be prepended to the job ID to create the filename for the download package
OUTPUT_PREFIX = 'download-'
# maximal number of files to process in one job
MAX_FILES = 32
# list of operations which can be performed
OPERATIONS = [
'isimip_files_api.operations.cdo.SelectBBoxOperation',
'isimip_files_api.operations.cdo.SelectPointOperation',
'isimip_files_api.operations.cdo.MaskBBoxOperation',
'isimip_files_api.operations.cdo.MaskMaskOperation',
'isimip_files_api.operations.cdo.MaskCountryOperation',
'isimip_files_api.operations.cdo.MaskLandonlyOperation',
'isimip_files_api.operations.python.create_mask.CreateMaskOperation',
'isimip_files_api.operations.ncks.CutOutBBoxOperation',
'isimip_files_api.operations.ncks.CutOutPointOperation'
]
# maximum number of operations which can be performed
MAX_OPERATIONS = 4
# the tag which designates global files, this tag will be replaced by the region
# specifier of the operations, if set to None, the region will be appended
GLOBAL_TAG = '_global_'
# the cdo binary on the system, e.g. /usr/bin/cdo
CDO_BIN = 'cdo'
# the maximum resolution for cdo based operations
CDO_MAX_RESOLUTION = (1440, 720)
# the ncks binary on the system, e.g. /usr/bin/ncks
NCKS_BIN = 'ncks'
# the maximum resolution for ncks based operations
NCKS_MAX_RESOLUTION = (43200, 20880)
# special settings for the countries
COUNTRYMASKS_FILE_PATH = 'countrymasks.nc'
COUNTRYMASKS_COUNTRIES = [
'AFG', 'ALB', 'DZA', 'AND', 'AGO', 'ATG', 'ARG', 'ARM', 'AUS', 'AUT',
'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BTN',
'BOL', 'BIH', 'BWA', 'BRA', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR',
'CAN', 'CPV', 'CSID', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'COL', 'COM',
'COG', 'CRI', 'HRV', 'CUB', 'CYP', 'CZE', 'CIV', 'PRK', 'COD', 'DNK',
'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH',
'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB',
'GEO', 'DEU', 'GHA', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GIN',
'GNB', 'GUY', 'HTI', 'HMD', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IOSID',
'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JKX', 'JPN',
'JOR', 'KAZ', 'KEN', 'KIR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO',
'LBR', 'LBY', 'LTU', 'LUX', 'MDG', 'MWI', 'MYS', 'MLI', 'MLT', 'MTQ',
'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MNG', 'MNE', 'MAR', 'MOZ',
'MMR', 'NAM', 'NPL', 'NLD', 'ANT', 'NCL', 'NZL', 'NIC', 'NER', 'NGA',
'NIU', 'NOR', 'OMN', 'PSID', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY',
'PER', 'PHL', 'POL', 'PRT', 'PRI', 'QAT', 'KOR', 'ROU', 'RUS', 'RWA',
'REU', 'LCA', 'SPM', 'VCT', 'WSM', 'STP', 'SAU', 'SEN', 'SRB', 'SLE',
'SGP', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA',
'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'THA',
'MKD', 'TLS', 'TGO', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'GBR', 'UGA',
'UKR', 'ARE', 'TZA', 'VIR', 'USA', 'URY', 'UZB', 'VUT', 'VEN', 'VNM',
'ESH', 'YEM', 'ZMB', 'ZWE'
]
# special settings for the land sea mask
LANDSEAMASK_FILE_PATH = 'landseamask.nc'
# redis configuration
REDIS_URL = 'redis://localhost:6379'
# configuration for the worker
WORKER_TIMEOUT = 180
WORKER_LOG_FILE = None
WORKER_LOG_LEVEL = 'ERROR'
WORKER_TTL = 86400 # one day
WORKER_FAILURE_TTL = 86400 # one day
WORKER_RESULT_TTL = 604800 # one week