aerocm.utils.classes¶
Module containing the ClimateModel class for climate model implementations.
ClimateModel ¶
ClimateModel(start_year, end_year, specie_name, specie_inventory, specie_settings, model_settings)
Bases: ABC
Super class for climate model implementations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_year
|
int
|
Start year of the simulation. |
required |
end_year
|
int
|
End year of the simulation. |
required |
specie_name
|
str
|
Name of the species. |
required |
specie_inventory
|
list or ndarray
|
Emission profile for the species. |
required |
specie_settings
|
dict
|
Dictionary containing species settings. |
required |
model_settings
|
dict
|
Dictionary containing model settings. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
available_species |
list
|
Supported species names for the climate model. |
available_species_settings |
dict
|
Dictionary containing available settings for each species, their type and default value. |
available_model_settings |
dict
|
Dictionary containing available model settings, their type and default value. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the species is not supported or if any mandatory setting is missing. |
TypeError
|
If any setting has an incorrect type. |
ValueError
|
If the emission profile length does not match the simulation period. |
Initialize the climate model with the provided settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_year
|
int
|
Start year of the simulation. |
required |
end_year
|
int
|
End year of the simulation. |
required |
specie_name
|
str
|
Name of the species. |
required |
specie_inventory
|
list or ndarray
|
Emission profile for the species. |
required |
specie_settings
|
dict
|
Dictionary containing species settings. |
required |
model_settings
|
dict
|
Dictionary containing model settings. |
required |
Source code in aerocm/utils/classes.py
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 | |
run
abstractmethod
¶
run()
Run the climate model with the provided input data.
Subclasses must return a dict with keys: 'radiative_forcing', 'effective_radiative_forcing', and 'temperature', which are the outputs of the climate model. Example: { 'radiative_forcing': np.zeros(end_year - start_year + 1), 'effective_radiative_forcing': np.zeros(end_year - start_year + 1), 'temperature': np.zeros(end_year - start_year + 1) }
Source code in aerocm/utils/classes.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
validate_model_settings ¶
validate_model_settings(model_settings)
Validate the provided model settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_settings
|
dict
|
Dictionary containing model settings. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If any setting has an incorrect type. |
Source code in aerocm/utils/classes.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
validate_specie_settings ¶
validate_specie_settings(specie_name, specie_settings)
Validate the provided species settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specie_name
|
str
|
Name of the species. |
required |
specie_settings
|
dict
|
Dictionary containing species settings. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the species is not supported or if any mandatory setting is missing. |
TypeError
|
If any setting has an incorrect type. |
Source code in aerocm/utils/classes.py
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 | |
validate_inventory ¶
validate_inventory(start_year, end_year, specie_inventory)
Validate the provided emission inventory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_year
|
int
|
Start year of the simulation. |
required |
end_year
|
int
|
End year of the simulation. |
required |
specie_inventory
|
list or ndarray
|
Emission profile to validate. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the emission profile length does not match the simulation period. |
Source code in aerocm/utils/classes.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |