Skip to content

Commit

Permalink
Format using black
Browse files Browse the repository at this point in the history
  • Loading branch information
Ochsner, David committed Jun 20, 2019
1 parent cd2b14a commit a93fad0
Show file tree
Hide file tree
Showing 34 changed files with 2,283 additions and 1,745 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ https://github.com/C2SM-RCM/cosmo-emission-processing.
It deliberately is not a fork of any of the existing repositories since that would introduce an
unwanted dependency. However, the commit history will be kept intact as much as possible.

## Formatting

This code is formatted using [black](https://black.readthedocs.io/en/stable/).
Run `find . -name '*.py' -exec black -l 80 --target-version py36 {} +` before commiting
to format your changes before commiting.

## License

This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
62 changes: 31 additions & 31 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
# "constant" paths and values for TNO
tnoCamsPath = "/input/TNOMACC/CO2/TNO_CAMS_CO2_emissions_"
tnoMACCIIIPath = "/input/TNOMACC/MACCIII/TNO_MACC_III_emissions_"
tno_xmin = -30.
tno_xmax = 60.
tno_ymin = 30.
tno_ymax = 72.
tno_dx = 1/8.
tno_dy = 1/16.
#tno_lons = np.arange(tno_startlon,tno_endlon+tno_dlon,tno_dlon)
#tno_lats = np.arange(tno_startlat,tno_endlat+tno_dlat,tno_dlat)
#tno_nx = round((tno_endlon-tno_startlon)/tno_dlon) + 1.
#tno_ny = round((tno_endlat-tno_startlat)/tno_dlat) + 1.



#case specific parameters
species = ['CO2']#, 'PM10', 'CH4', 'SO2', 'NMVOC', 'NH3', 'NOx'] #among 'CO2', 'PM2.5', 'CO', 'PM10', 'CH4', 'SO2', 'NMVOC', 'NH3', 'NOx'

cat_kind="SNAP"
snap = [1,2,34,5,6,70,8,9,10] #70 corresponds to all 7*
#maccversion = 'III' # use this version for TNO/MACC data
tno_snap = [ 1,2,34,5,6,71,72,73,8,9,10]
tno_xmin = -30.0
tno_xmax = 60.0
tno_ymin = 30.0
tno_ymax = 72.0
tno_dx = 1 / 8.0
tno_dy = 1 / 16.0
# tno_lons = np.arange(tno_startlon,tno_endlon+tno_dlon,tno_dlon)
# tno_lats = np.arange(tno_startlat,tno_endlat+tno_dlat,tno_dlat)
# tno_nx = round((tno_endlon-tno_startlon)/tno_dlon) + 1.
# tno_ny = round((tno_endlat-tno_startlat)/tno_dlat) + 1.


# case specific parameters
species = [
"CO2"
] # , 'PM10', 'CH4', 'SO2', 'NMVOC', 'NH3', 'NOx'] #among 'CO2', 'PM2.5', 'CO', 'PM10', 'CH4', 'SO2', 'NMVOC', 'NH3', 'NOx'

cat_kind = "SNAP"
snap = [1, 2, 34, 5, 6, 70, 8, 9, 10] # 70 corresponds to all 7*
# maccversion = 'III' # use this version for TNO/MACC data
tno_snap = [1, 2, 34, 5, 6, 71, 72, 73, 8, 9, 10]
year = 2015
gridname = 'Berlin-coarse_redo'
gridname = "Berlin-coarse_redo"

is60= True
is60 = True
if is60:
output_path ="./testdata/temp_to_del_60/"
output_path = "./testdata/temp_to_del_60/"
else:
output_path ="./testdata/temp_to_del_64/"
#invs = ['CH4_TNO','CO2_TNO','CO_TNO','NOx_TNO','Berlin']
output_path = "./testdata/temp_to_del_64/"
# invs = ['CH4_TNO','CO2_TNO','CO_TNO','NOx_TNO','Berlin']


# Domain
#Berlin-coarse
# Berlin-coarse
dx = 0.1
dy = 0.1
if is60:
Expand All @@ -42,10 +43,9 @@
nx = 70
ny = 60
else:
xmin = -1.4-2*dx
ymin = 2.5-2*dy
nx = 70+4
ny = 60+4
xmin = -1.4 - 2 * dx
ymin = 2.5 - 2 * dy
nx = 70 + 4
ny = 60 + 4
pollon = -170.0
pollat = 43.0

53 changes: 25 additions & 28 deletions config_CHE.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
# "constant" paths and values for TNO
#tnoCamsPath = "/project/hjm/CHE/TNO_Anthropogenic_emissions/v1_1_2018_12/TNO_6x6_GHGco_v1_1/TNO_GHGco_v1_1_year2015.nc"
# tnoCamsPath = "/project/hjm/CHE/TNO_Anthropogenic_emissions/v1_1_2018_12/TNO_6x6_GHGco_v1_1/TNO_GHGco_v1_1_year2015.nc"
tnoCamsPath = "/input/TNOMACC/TNO_GHGco/Future_years_emissions/TNO_GHGco_v1_1_CIRCE_BAU_year2030.nc"
tnoMACCIIIPath = tnoCamsPath
tno_xmin = -30.
tno_xmax = 60.
tno_ymin = 30.
tno_ymax = 72.
tno_dx = 1/10.
tno_dy = 1/20.
tno_xmin = -30.0
tno_xmax = 60.0
tno_ymin = 30.0
tno_ymax = 72.0
tno_dx = 1 / 10.0
tno_dy = 1 / 20.0

#case specific parameters
species = ['CO2']#,'CH4','CO','NOX','NMVOC']
# case specific parameters
species = ["CO2"] # ,'CH4','CO','NOX','NMVOC']

cat_kind="NFR_BAU"
snap = [ "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L" ]
cat_kind = "NFR_BAU"
snap = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]
# snap = [ "J", "L" ]
#tno_snap = [ "A", "B", "C", "D", "E", "F1","F2","F3",
# tno_snap = [ "A", "B", "C", "D", "E", "F1","F2","F3",
# "G", "H", "I", "J", "K", "L" ]
tno_snap = [ "A", "B", "C", "D", "E", "F1","F2","F3",
"G", "H", "I", "J", "L" ]
tno_snap = ["A", "B", "C", "D", "E", "F1", "F2", "F3", "G", "H", "I", "J", "L"]
year = 2030
gridname = 'Europe_BAU'
output_path ="./testdata/CHE_TNO_v1_1_2018_12/CHE_TNO_online/"
gridname = "Europe_BAU"
output_path = "./testdata/CHE_TNO_v1_1_2018_12/CHE_TNO_online/"

offline=False
offline = False

# Domain
#CHE_Europe domain
# CHE_Europe domain
dx = 0.05
dy = 0.05
pollon = -170.0
pollat = 43.0

if not offline:
xmin = -17#-2*dx
ymin = -11#-2*dy
nx = 760#+4
ny = 610#+4
xmin = -17 # -2*dx
ymin = -11 # -2*dy
nx = 760 # +4
ny = 610 # +4
else:
xmin = -17-2*dx
ymin = -11-2*dy
nx = 760+4
ny = 610+4

xmin = -17 - 2 * dx
ymin = -11 - 2 * dy
nx = 760 + 4
ny = 610 + 4
58 changes: 36 additions & 22 deletions config_Carbosense_TNO.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# "constant" paths and values for TNO
tnoCamsPath = "/input/TNOMACC/TNO_GHGco/TNO_6x6_GHGco_v1_1/TNO_GHGco_v1_1_year2015.nc"
tnoCamsPath = (
"/input/TNOMACC/TNO_GHGco/TNO_6x6_GHGco_v1_1/TNO_GHGco_v1_1_year2015.nc"
)
tnoMACCIIIPath = tnoCamsPath
tno_xmin = -30.
tno_xmax = 60.
tno_ymin = 30.
tno_ymax = 72.
tno_dx = 1/10.
tno_dy = 1/20.

#case specific parameters
species = ['CO2', 'CH4', 'CO']

cat_kind="NFR"

snap = [ "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L" ]

tno_snap = [ "A", "B", "C", "D", "E", "F1", "F2", "F3",
"G", "H", "I", "J", "K", "L" ]
tno_xmin = -30.0
tno_xmax = 60.0
tno_ymin = 30.0
tno_ymax = 72.0
tno_dx = 1 / 10.0
tno_dy = 1 / 20.0

# case specific parameters
species = ["CO2", "CH4", "CO"]

cat_kind = "NFR"

snap = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]

tno_snap = [
"A",
"B",
"C",
"D",
"E",
"F1",
"F2",
"F3",
"G",
"H",
"I",
"J",
"K",
"L",
]

year = 2018
gridname = 'tno_CO2_CO_CH4_1km_CH_only'
output_path ="./testdata"
gridname = "tno_CO2_CO_CH4_1km_CH_only"
output_path = "./testdata"

offline=False
offline = False

# Carbosense COSMO-1 Domain
dx = 0.01
Expand All @@ -40,4 +55,3 @@
ymin -= 2 * dy
nx += 4
ny += 4

92 changes: 55 additions & 37 deletions config_Carbosense_carbocount.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
# For CarboCount Swiss inventory, unit m, x is easterly, y is northly
input_path = "/input/CH_EMISSIONS/CarboCountCO2/einzelgrids/"
ch_xn = 760
ch_xn = 760
ch_yn = 500
ch_xll = 470000
ch_xll = 470000
ch_yll = 60000
ch_cell = 500
nodata_value = -9999

origin = 'carbocount'
gridname = origin + '_CO2_1km'

species = ['CO2']

ch_cat = [ 'bm', 'cf', 'df', 'hf', 'hk', 'if', 'ka', 'ki', 'ks', 'kv',
'la', 'lf', 'lw', 'mi', 'mt', 'nf', 'pf', 'pq', 'rf', 'vk',
'zp', 'zv' ]

origin = "carbocount"
gridname = origin + "_CO2_1km"

species = ["CO2"]

ch_cat = [
"bm",
"cf",
"df",
"hf",
"hk",
"if",
"ka",
"ki",
"ks",
"kv",
"la",
"lf",
"lw",
"mi",
"mt",
"nf",
"pf",
"pq",
"rf",
"vk",
"zp",
"zv",
]


year = 2018

output_path ="./testdata"
output_path = "./testdata"

offline=False
offline = False

# Carbosense COSMO-1 Domain
dx = 0.01
Expand All @@ -43,27 +61,27 @@
ny += 4


mapping = { 'bm': 'B',
'cf': 'B',
'df': 'C',
'hf': 'C',
'hk': 'C',
'if': 'B',
'ka': 'J',
'ki': 'J',
'ks': 'J',
'kv': 'J',
'la': 'J',
'lf': 'L',
'lw': 'L',
'mi': 'B',
'mt': 'C',
'nf': 'B',
'pf': 'B',
'pq': 'B',
'rf': 'B',
'vk': 'F',
'zp': 'B',
'zv': 'F',
}

mapping = {
"bm": "B",
"cf": "B",
"df": "C",
"hf": "C",
"hk": "C",
"if": "B",
"ka": "J",
"ki": "J",
"ks": "J",
"kv": "J",
"la": "J",
"lf": "L",
"lw": "L",
"mi": "B",
"mt": "C",
"nf": "B",
"pf": "B",
"pq": "B",
"rf": "B",
"vk": "F",
"zp": "B",
"zv": "F",
}
Loading

0 comments on commit a93fad0

Please sign in to comment.