Add scaling for each specie #94
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
It extends the time interpolation and scaling capabilities of OpenAirClim to support individual scaling factors per species in the emission inventory.
This allows, for instance, different scaling factors to be applied when using multiple fuel types or accounting for species-specific emission changes.
This improvement addresses the TODO note previously present in apply_scaling:
Main changes
Updated scale_inv and apply_scaling to handle multiple emission scaling factors (one per species).
Modified to generate a coherent example including species-dependent scaling.
Updated unit tests to reflect the new behavior.
Type of change
How has this been tested?
<class 'netCDF4.Dataset'> root group (NETCDF4 data model, file format HDF5): Title: Time scaling example Convention: CF-XXX Type: scaling dimensions(sizes): time(210), species(5) variables(dimensions): float32 scaling(time, species), int64 time(time), <class 'str'> species(species) groups:Example
print(file2read.variables['species'][:]) # ['fuel' 'CO2' 'H2O' 'NOx' 'distance']To reproduce:
Test configuration:
Checklist
__about__.pyaccording to the semantic versioning scheme