@@ -1038,15 +1038,16 @@ def _create_cfg_dict(cfgfile):
1038
1038
try :
1039
1039
print ("- Main config file : {}" .format (cfgfile ))
1040
1040
cfg = read_config (cfg ["configFile" ], cfg = cfg , defaults = DEFAULT_CONFIG ["main" ])
1041
-
1041
+
1042
1042
# Convert loc and prod config files to absolute paths if needed
1043
- filenames = ["locationConfigFile" ,
1044
- "productConfigFile" ,
1043
+ filenames = [
1044
+ "locationConfigFile" ,
1045
+ "productConfigFile" ,
1045
1046
]
1046
1047
for fname in filenames :
1047
1048
if not os .path .isabs (cfg [fname ]):
1048
- cfg [fname ] = os .path .join (cfg [' configpath' ], cfg [fname ])
1049
-
1049
+ cfg [fname ] = os .path .join (cfg [" configpath" ], cfg [fname ])
1050
+
1050
1051
print ("- Location config file : {}" .format (cfg ["locationConfigFile" ]))
1051
1052
cfg = read_config (
1052
1053
cfg ["locationConfigFile" ], cfg = cfg , defaults = DEFAULT_CONFIG ["loc" ]
@@ -1183,7 +1184,8 @@ def _create_cfg_dict(cfgfile):
1183
1184
1184
1185
# check whether specified paths are relative or absolute
1185
1186
# if relative add configpath to the path
1186
- filenames = ["locationConfigFile" ,
1187
+ filenames = [
1188
+ "locationConfigFile" ,
1187
1189
"productConfigFile" ,
1188
1190
"datapath" ,
1189
1191
"iconpath" ,
@@ -1194,17 +1196,18 @@ def _create_cfg_dict(cfgfile):
1194
1196
"psrpath" ,
1195
1197
"iqpath" ,
1196
1198
"satpath" ,
1197
- "smnpath" ]
1198
-
1199
+ "smnpath" ,
1200
+ ]
1201
+
1199
1202
for fname in filenames :
1200
1203
if type (cfg [fname ]) is list :
1201
1204
for val in cfg [fname ]:
1202
1205
if not os .path .isabs (val ):
1203
- val = os .path .join (cfg [' configpath' ], val )
1206
+ val = os .path .join (cfg [" configpath" ], val )
1204
1207
elif type (cfg [fname ]) is str :
1205
1208
if not os .path .isabs (cfg [fname ]):
1206
- cfg [fname ] = os .path .join (cfg [' configpath' ], cfg [fname ])
1207
-
1209
+ cfg [fname ] = os .path .join (cfg [" configpath" ], cfg [fname ])
1210
+
1208
1211
# if specified in config, convert coordinates to arrays
1209
1212
if "RadarPosition" in cfg :
1210
1213
fltarr_list = ["latitude" , "longitude" , "altitude" ]
@@ -1329,30 +1332,35 @@ def _create_datacfg_dict(cfg):
1329
1332
datacfg .update ({"MFScale" : cfg ["MFScale" ]})
1330
1333
datacfg .update ({"DataTypeIDInFiles" : cfg ["DataTypeIDInFiles" ]})
1331
1334
1332
- #s3 buckets
1335
+ # s3 buckets
1333
1336
if "bucket" in cfg :
1334
1337
try :
1335
1338
datacfg ["s3_key" ] = os .environ ["S3_IN_KEY" ]
1336
1339
datacfg ["s3_secret_key" ] = os .environ ["S3_IN_SECRET" ]
1337
1340
except KeyError :
1338
1341
warn (
1339
- 'Define environment variables S3_IN_KEY and S3_IN_SECRET'
1340
- ' to get input data from S3 buckets.' )
1342
+ "Define environment variables S3_IN_KEY and S3_IN_SECRET"
1343
+ " to get input data from S3 buckets."
1344
+ )
1341
1345
1342
1346
if "s3path" in cfg :
1343
1347
datacfg .update ({"s3path" : cfg ["s3path" ]})
1344
1348
else :
1345
- warn (' Unable to read data from s3 bucket. Define s3path' )
1349
+ warn (" Unable to read data from s3 bucket. Define s3path" )
1346
1350
if "s3_url" in cfg :
1347
1351
datacfg .update ({"s3_url" : cfg ["s3_url" ]})
1348
1352
else :
1349
- warn (' Unable to read data from s3 bucket. Define s3_url' )
1353
+ warn (" Unable to read data from s3 bucket. Define s3_url" )
1350
1354
1351
1355
if "rm_s3_file" in cfg :
1352
1356
datacfg .update ({"rm_s3_file" : cfg ["rm_s3_file" ]})
1353
1357
1354
- if ('s3path' in datacfg and 's3_url' in datacfg
1355
- and 's3_key' in datacfg and 's3_secret_key' in datacfg ):
1358
+ if (
1359
+ "s3path" in datacfg
1360
+ and "s3_url" in datacfg
1361
+ and "s3_key" in datacfg
1362
+ and "s3_secret_key" in datacfg
1363
+ ):
1356
1364
datacfg .update ({"bucket" : cfg ["bucket" ]})
1357
1365
1358
1366
# Modify size of radar or radar spectra object
@@ -1791,14 +1799,14 @@ def _get_masterfile_list(datatypesdescr, starttimes, endtimes, datacfg, scan_lis
1791
1799
)
1792
1800
return [], None , None
1793
1801
1794
- if ' bucket' in datacfg :
1802
+ if " bucket" in datacfg :
1795
1803
masterfilelist = get_file_list_s3 (
1796
- masterdatatypedescr , starttimes , endtimes , datacfg ,
1797
- scan = masterscan )
1804
+ masterdatatypedescr , starttimes , endtimes , datacfg , scan = masterscan
1805
+ )
1798
1806
else :
1799
1807
masterfilelist = get_file_list (
1800
- masterdatatypedescr , starttimes , endtimes , datacfg ,
1801
- scan = masterscan )
1808
+ masterdatatypedescr , starttimes , endtimes , datacfg , scan = masterscan
1809
+ )
1802
1810
1803
1811
return masterfilelist , masterdatatypedescr , masterscan
1804
1812
0 commit comments