SIEM Reference
Here is the detailed information of SIEM classes and functions.
SIEM: SImplified Emission Model.
SIEM produces the emission file required to run WRF-Chem and CMAQ air quality models.
This modules defined the classes used by siem to create this emissions files
EmissionSource- Class to spatially and temporal distribute emissions, especially vehicular emissions.PointSources- Class to spatially and temporal distribute point sources from a .csv table.GroupSources- Class to group EmissionSources and PointSources, useful to create one emission file.
EmissionSource
Emission source.
A class used to represent and emission source to be estimated from spatial proxy.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Name of Source. |
|
number |
Number of Sources. |
|
use_intensity |
Use intensity |
|
pol_ef |
Pollutant emission factors and molecular weight. |
|
spatial_proxy |
Spatial proxy to spatial distribute emissions. |
|
temporal_prof |
Temporal profile to temporal distribute emissions. |
|
voc_spc |
VOC species to speciate with their fraction. |
|
pm_spc |
PM species to speciate with their fraction. |
Source code in siem/siem.py
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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
__init__(name, number, use_intensity, pol_ef, spatial_proxy, temporal_prof, voc_spc, pm_spc)
Create the EmissionSource object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the source. |
required |
number
|
int | float
|
Number of sources (e.g., number of vehicles) |
required |
use_intensity
|
float
|
Emission source activity rate. |
required |
pol_ef
|
dict
|
Keys are pollutants in the inventory. Values are a tuple with pollutant emission factors and molecular weight. |
required |
spatial_proxy
|
DataArray
|
Proxy to spatially distribute emissions. |
required |
temporal_prof
|
list[float]
|
Hourly fractions to temporally distribute emissions. |
required |
voc_spc
|
dict
|
Keys are VOC species.Values are the fraction of the total VOC. |
required |
pm_spc
|
dict
|
Keys are PM species. Values are the fraction of the total PM. |
required |
Source code in siem/siem.py
__str__()
Print summary of EmissionSource attributes.
Returns:
| Type | Description |
|---|---|
|
Print name, number, pollutants, |
|
|
and VOC and PM species information |
|
|
from EmissionSource. |
Source code in siem/siem.py
report_emissions()
Return the total emission for each pollutant in pol_ef.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A table with pollutants as index and total emissions |
DataFrame
|
as columns. |
Source code in siem/siem.py
spatial_emission(pol_name, cell_area)
Distribute one pollutant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_name
|
str
|
Key value in pol_ef. |
required |
cell_area
|
int | float
|
Area of wrfinput. |
required |
Returns:
| Type | Description |
|---|---|
DataArray
|
Spatially distributed emissions. |
Source code in siem/siem.py
spatiotemporal_emission(pol_names, cell_area, is_cmaq=False)
Spatial and temporal distribution of emissions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_names
|
str | list[str]
|
Name or names of pollutants to distribute. |
required |
cell_area
|
int | float
|
Wrfinput cell area. |
required |
is_cmaq
|
bool
|
If it will be used for CMAQ. |
False
|
Returns:
| Type | Description |
|---|---|
DataArray
|
Spatial and temporal emission distribution. |
Source code in siem/siem.py
speciate_all(cell_area, voc_name='VOC', pm_name='PM', is_cmaq=False)
Speciate VOC and PM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell_area
|
int | float
|
wrfinput cell area. |
required |
voc_name
|
str
|
Name of VOC in pol_ef keys. |
'VOC'
|
pm_name
|
str
|
Name of PM in pol_ef keys. |
'PM'
|
is_cmaq
|
bool
|
If output for CMAQ. |
False
|
Returns:
| Type | Description |
|---|---|
Dataset
|
Spatial and temporal distributed emissions with |
Dataset
|
VOC and PM speciated. |
Source code in siem/siem.py
speciate_emission(pol_name, pol_species, cell_area, is_cmaq=False)
Speciate one pollutant emissions. Used especially for VOC or NOX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_name
|
str
|
Pollutant name in pol_ef to speciate. |
required |
pol_species
|
dict
|
Keys are pollutants speciated from pol_name. Values are the fraction. |
required |
cell_area
|
int | float
|
wrfinput cell area km^2 |
required |
is_cmaq
|
bool
|
If output is for CMAQ. |
False
|
Returns:
| Type | Description |
|---|---|
DataArray
|
Spatial and temporal distribution of speciated emission. |
Source code in siem/siem.py
to_cmaq(wrfinput, griddesc_path, btrim, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, path='../results')
Create CMAQ emission file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
wrfinput from WRF simulation. |
required |
griddesc_path
|
str
|
Location of GRIDDESC file. |
required |
btrim
|
int
|
BTRIM option in MCIP. |
required |
start_date
|
str
|
Start date of emission files. |
required |
end_date
|
str
|
End date of emission files. |
required |
week_profile
|
list[float]
|
List of seven fraction of each week day. |
[1]
|
pm_name
|
str
|
PM name in pol_ef keys. |
'PM'
|
voc_name
|
str
|
VOC name in pol_ef keys. |
'VOC'
|
write_netcdf
|
bool
|
Write the netCDF file. |
False
|
path
|
str
|
Location to save CMAQ emission file. |
'../results'
|
Returns:
| Type | Description |
|---|---|
Dict[str, Dataset]
|
Keys are simulation days and values the emission file for CMAQ |
Dict[str, Dataset]
|
for that day. |
Source code in siem/siem.py
to_wrfchemi(wrfinput, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, nc_format='NETCDF3_64BIT', path='../results')
Create WRF-Chem emission file (wrfchemi).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
WRF-Chem wrfinput file. |
required |
start_date
|
str
|
Start date of emissions. |
required |
end_date
|
str
|
End date of emissions. |
required |
week_profile
|
list[float]
|
List of seven fraction of each week day. |
[1]
|
pm_name
|
str
|
PM name in pol_ef keys. |
'PM'
|
voc_name
|
str
|
VOC name in pol_ef keys |
'VOC'
|
write_netcdf
|
bool
|
Write the NetCDF file. |
False
|
nc_format
|
str
|
wrfchemi NetCDF file format. |
'NETCDF3_64BIT'
|
path
|
str
|
Location to save wrfchemi. |
'../results'
|
Returns:
| Type | Description |
|---|---|
Dataset
|
Dataset with wrfchemi netCDF format. |
Source code in siem/siem.py
total_emission(pol_name, ktn_year=False)
Calculate total emission of a pollutant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_name
|
str
|
Pollutant name to calculate the total emission. |
required |
ktn_year
|
bool
|
If total is calculated in KTn (Gg) year^-1 |
False
|
Returns:
| Type | Description |
|---|---|
float
|
Total emission of a pollutant. |
Source code in siem/siem.py
GroupSources
A class that group EmissionSources and PointSources object.
Attributes sources_list: A list of EmissionSources and PointSources objects.
Source code in siem/siem.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | |
__init__(sources_list)
Create a GroupSource object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources_list
|
list[EmissionSource | PointSources]
|
List with EmissionSource and PointSources to group. |
required |
__str__()
Print summary of GroupSources attributes.
Returns:
| Type | Description |
|---|---|
|
Print number and types of Sources. |
Source code in siem/siem.py
names()
Print names of source emission in GroupSources.
Returns:
| Type | Description |
|---|---|
|
Names of source emissions. |
report_emissions()
Return the total emission for each pollutant in pol_emiss.
Returns:
| Type | Description |
|---|---|
DataFrame
|
Table with emission source and pollutant as index. |
Source code in siem/siem.py
to_cmaq(wrfinput, griddesc_path, btrim, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, path='../results')
Create CMAQ emission file.
Create CMAQ emission file. All EmissionSource and GroupSources need to have same speciation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
WRF wrfinput file. |
required |
griddesc_path
|
str
|
Location of GRIDDESC file. |
required |
btrim
|
int
|
BTRIM value in MCIP. |
required |
start_date
|
str
|
Start date of emissions. |
required |
end_date
|
str
|
End date of emissions. |
required |
week_profile
|
list[float]
|
Emission weights of days of week. |
[1]
|
pm_name
|
str
|
PM name in pol_ef or pol_emiss. |
'PM'
|
voc_name
|
str
|
VOC name in pol_ef or pol_emiss. |
'VOC'
|
write_netcdf
|
bool
|
Save CMAQ emission file. |
False
|
path
|
str
|
Location to save CMAQ emission file. |
'../results'
|
Returns:: Keys are emission days. Values are emission in CMAQ emission file netCDF format.
Source code in siem/siem.py
to_wrfchemi(wrfinput, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, nc_format='NETCDF3_64BIT', path='../results')
Create WRF-Chem emission file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
WRF-Chem wrfinput. |
required |
start_date
|
str
|
Start date of emission. |
required |
end_date
|
str
|
End date of emission. |
required |
week_profile
|
list[float]
|
Emission weights of days of week. |
[1]
|
pm_name
|
str
|
PM name in emissions. |
'PM'
|
voc_name
|
str
|
VOC name in emissions. |
'VOC'
|
write_netcdf
|
bool
|
Save wrfchemi file. |
False
|
nc_format
|
str
|
wrfchemi NetCDF file. |
'NETCDF3_64BIT'
|
path
|
str
|
Location to save wrfchemi file. |
'../results'
|
Returns:
| Type | Description |
|---|---|
Dataset
|
Emission file in WRF-Chem wrfchemi netCDF format. |
Source code in siem/siem.py
PointSources
Point sources.
A class to read points emission sources in a table where columns are longitude, latitude, and the total emissions of diferent pollutants in kTn (Gg) year^-1
Attributes name : Name of the point emission sources. spatial_emission : Spatially distributed emissions in simulation domain. pol_emiss : Names of considered pollutants (columns). temporal_prof : Temporal profile to temporal emission distribution. voc_spc : VOC speciation dict. Keys are VOC species, values are fractions. pm_spc : PM speciation dict. Keys are PM species, values are fractions.
Source code in siem/siem.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |
__init__(name, point_emiss, pol_emiss, temporal_prof, voc_spc, pm_spc)
Create PointSource object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of point sources emissions. |
required |
point_emiss
|
Dataset
|
Points sources in table read with |
required |
pol_emiss
|
dict
|
Keys are columns in point_emiss. Values are the molecular weight. |
required |
temporal_prof
|
list[float]
|
Hourly fractions to temporally distribute emissions. |
required |
voc_spc
|
dict
|
Keys are VOC species. Values are fractions from the total VOC. |
required |
pm_spc
|
dict
|
Keys are PM species. Values are fractions from the total PM. |
required |
Source code in siem/siem.py
__str__()
Print summary of PointSource attributes.
Returns:
| Type | Description |
|---|---|
|
Print name, number, pollutants, |
|
|
and VOC and PM species information |
|
|
from EmissionSource. |
Source code in siem/siem.py
report_emissions()
Return the total emission for each pollutant in pol_ef.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A table with pollutants as index and total emissions |
DataFrame
|
as columns. |
Source code in siem/siem.py
to_cmaq(wrfinput, griddesc_path, btrim, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, path='../results')
Create CMAQ emission file.
Create and save CMAQ emission file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
WRF wrfinput. |
required |
griddesc_path
|
str
|
Location of GRIDDESC file. |
required |
btrim
|
int
|
BTRIM value in MCIP. |
required |
start_date
|
str
|
Start date of emission. |
required |
end_date
|
str
|
End date of emission. |
required |
week_profile
|
list[float]
|
Emission weights of days of week. |
[1]
|
pm_name
|
str
|
PM name in pol_emiss. |
'PM'
|
voc_name
|
str
|
VOC name in pol_emiss. |
'VOC'
|
write_netcdf
|
bool
|
Save CMAQ emission file. |
False
|
path
|
str
|
Location to save CMAQ emission file. |
'../results'
|
Returns: Keys are simulation day. Values are Daset in CMAQ emission file netcdf format.
Source code in siem/siem.py
to_wrfchemi(wrfinput, start_date, end_date, week_profile=[1], pm_name='PM', voc_name='VOC', write_netcdf=False, nc_format='NETCDF3_64BIT', path='../results/')
Create WRF-Chem emission file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wrfinput
|
Dataset
|
WRF wrfinput. |
required |
start_date
|
str
|
Start date of emission. |
required |
end_date
|
str
|
End date of emission. |
required |
week_profile
|
list[float]
|
Emission weights of days of week. |
[1]
|
pm_name
|
str
|
PM name in pol_emiss. |
'PM'
|
voc_name
|
str
|
VOC name in pol_emiss. |
'VOC'
|
write_netcdf
|
bool
|
Write wrfchemi netCDF. |
False
|
nc_format
|
str
|
wrfchemi NetCDF file format. |
'NETCDF3_64BIT'
|
path
|
str
|
Location to save wrfchemi files. |
'../results/'
|
Returns:
| Type | Description |
|---|---|
Dataset
|
Emission file in wrfchemi netCDF format. |
Source code in siem/siem.py
total_emission(pol_name)
Calculate total emission of a pollutant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pol_name
|
str
|
Pollutant name to calculate the total emission. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Total emission of a pollutant in KTn (Gg) year^-1 |