Skip to content

Commit

Permalink
added the lightning_flash_accumulation_in_vicinity cell method missin…
Browse files Browse the repository at this point in the history
…g from imengluk (#2064)

* added the lightning_flash_accumulation_in_vicinity cell method missing in imengluk

* Adding my details to the CONTRIBUTING.md and .mailmap files to prevent pre-commits failing

* Added missing cell methods for lightning_in_vicinity for imengluk

* Updated checksums
  • Loading branch information
maxwhitemet authored Dec 18, 2024
1 parent 9b2db98 commit 6906543
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Mark Baker <mark.baker@metoffice.gov.uk> <20327097+markysparks@users.noreply.git
Marcus Spelman <99179165+mspelman07@users.noreply.github.com> <99179165+mspelman07@users.noreply.github.com>
Mark Worsfold <mark.worsfold@metoffice.gov.uk> <mark.worsfold@metoffice.gov.uk>
Mark Worsfold <mark.worsfold@metoffice.gov.uk> <35810969+MarkWorsfold@users.noreply.github.com>
Max White <max.white@metoffice.gov.uk> <max.white@metoffice.gov.uk>
Meabh NicGuidhir <meabh.nicguidhir@metoffice.gov.uk> <meabh.nicguidhir@metoffice.gov.uk>
Neil Crosswaite <neil.crosswaite@metoffice.gov.uk> <43375279+neilCrosswaite@users.noreply.github.com>
Paul Abernethy <paul.abernethy@metoffice.gov.uk> <paul.abernethy@metoffice.gov.uk>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ below:
- Marcus Spelman (Met Office, UK)
- Belinda Trotta (Bureau of Meteorology, Australia)
- Tomasz Trzeciak (Met Office, UK)
- Max White (Met Office, UK)
- Mark Worsfold (Met Office, UK)
- Bruce Wright (Met Office, UK)
- Ying Zhao (Bureau of Meteorology, Australia)
Expand Down
9 changes: 8 additions & 1 deletion improver/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import iris
import numpy as np
from iris.coords import DimCoord
from iris.coords import CellMethod, DimCoord
from iris.cube import Cube, CubeList

from improver import PostProcessingPlugin
Expand Down Expand Up @@ -161,6 +161,13 @@ def process(self, *cubes: Union[Cube, CubeList]) -> Cube:
)
cube.add_aux_coord(coord)

cell_method = CellMethod(
"Sum",
coords="time",
comments="of number_of_lightning_flashes_per_unit_area",
)
cube.add_cell_method(cell_method)

return cube


Expand Down
4 changes: 2 additions & 2 deletions improver_tests/acceptance/SHA256SUMS
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ f0a89bda83864f490ea47fa929617ab60e8cb33ab0be912a7302a903c5f5faaa ./interpolate-
2ebd0073a5fd84f989c976229120b60fd720d1c4ed1f2229abaa675fef281c98 ./interpret_metadata/non_compliant_weather_codes.nc
c45d0da496a7c79052f60ae126cb51cd4a731659cec3470f9005e3996687dc99 ./interpret_metadata/temperature_realizations.nc
b58210883238b08d0fdf91dc054d38ac298f60442501d3e0e83b44a6d10db58a ./lightning-from-cape-and-precip/cape.nc
4fff3d221e52bc7e62d0225ea466d780a776833e4695edc74c684e88ac2f49f0 ./lightning-from-cape-and-precip/kgo.nc
dc3a698c9a3e699bebdb8a8ea2c58925a7ddb31f4ce8e9753348ec85ae064a4e ./lightning-from-cape-and-precip/kgo_with_model_config.nc
451117dd982c6fbd66c7815f8d5401de129420ab4f24164870b0a41223394bea ./lightning-from-cape-and-precip/kgo.nc
17b00c2946c65837d0f31fea4a146da3ca93054f7a944b3e400ead0e7372efee ./lightning-from-cape-and-precip/kgo_with_model_config.nc
e740ae94a72622fbbc82b53a65096058916e0e5a744443bbf1095dd5cabf1341 ./lightning-from-cape-and-precip/precipitation_rate.nc
49fa0d424e4f9b2281c2aa65e9e55c15dd6cd0500c765b29adca9f3ffb1364bb ./lightning-multivariate-probability-usaf2024/apcp.nc
ff80b3950adf7fa7fe74fba71393762f986fbca830873b28cf254cb9d3cd8623 ./lightning-multivariate-probability-usaf2024/cape.nc
Expand Down
6 changes: 6 additions & 0 deletions improver_tests/lightning/test_LightningFromCapePrecip.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import numpy as np
import pytest
from iris.coords import CellMethod
from iris.cube import Cube, CubeList

from improver.lightning import LightningFromCapePrecip
Expand Down Expand Up @@ -111,6 +112,11 @@ def expected_cube_fixture() -> Cube:
dtype=np.int32,
)

cell_method = CellMethod(
"Sum", coords="time", comments="of number_of_lightning_flashes_per_unit_area"
)
cube.add_cell_method(cell_method)

return cube


Expand Down

0 comments on commit 6906543

Please sign in to comment.