radar
nimrod #
extract_nimrod_from_archive #
extract_nimrod_from_archive(
archive_file_path: str | Path, output_directory: str | Path = None
) -> Path
Extract nimrod data from an archive file. If no output directory is provided, the extracted data will be saved to the archive file's directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
archive_file_path
|
str | Path
|
Path to the archive file |
required |
output_directory
|
str | Path
|
Optional output directory. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the extracted nimrod data file |
Source code in geospatial_tools/radar/nimrod.py
20 21 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 | |
load_nimrod_cubes #
load_nimrod_cubes(filenames: list[str | Path]) -> Generator[Cube | Any, Any, None]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filenames
|
list[str | Path]
|
List of nimrod files |
required |
Returns:
| Type | Description |
|---|---|
None
|
Generator of cubes |
Source code in geospatial_tools/radar/nimrod.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
load_nimrod_from_archive #
load_nimrod_from_archive(filename: str | Path) -> Generator[Cube | Any, Any, None]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str | Path
|
Path to the archive file |
required |
Returns:
| Type | Description |
|---|---|
None
|
Generator of cubes |
Source code in geospatial_tools/radar/nimrod.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
merge_nimrod_cubes #
merge_nimrod_cubes(cubes: list[Cube]) -> Cube
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cubes
|
list[Cube]
|
List of cubes to merge |
required |
Returns:
| Type | Description |
|---|---|
Cube
|
Merged cube |
Source code in geospatial_tools/radar/nimrod.py
95 96 97 98 99 100 101 102 103 104 105 106 | |
mean_nimrod_cubes #
mean_nimrod_cubes(merged_cubes: Cube) -> Cube
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
merged_cubes
|
Cube
|
Merged cube |
required |
Returns:
| Type | Description |
|---|---|
Cube
|
Mean cube |
Source code in geospatial_tools/radar/nimrod.py
109 110 111 112 113 114 115 116 117 118 119 | |
write_cube_to_file #
write_cube_to_file(cube: Cube, output_name: str | Path) -> None
Save a nimrod cube to a Netcdf file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cube
|
Cube
|
Cube to save |
required |
output_name
|
str | Path
|
Output filename |
required |
Source code in geospatial_tools/radar/nimrod.py
122 123 124 125 126 127 128 129 130 | |
assert_dataset_time_dim_is_valid #
assert_dataset_time_dim_is_valid(
dataset: Dataset, time_dimension_name: str = "time"
) -> None
Ths function checks that the time dimension of a given dataset
- Is composed of 5-minute time bins - Which is the native Nimrod format
- Contains a continuous time series, without any holes - which would lead to false statistics when resampling
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
Merged nimrod cube |
required |
time_dimension_name
|
str
|
Name of the time dimension |
'time'
|
Returns:
| Type | Description |
|---|---|
None
|
Bool value indicating if the time bins are 5 minutes long and if there are no |
None
|
gaps in the time series |
Source code in geospatial_tools/radar/nimrod.py
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 | |
resample_nimrod_timebox_30min_bins #
resample_nimrod_timebox_30min_bins(
filenames: list[str | Path], output_name: str | Path
) -> str | Path
This will resample nimrod data's bins to 30-minute interval instead of their normal 5-minute interval. It uses a mean resampling, and creates time bins like follows :
ex. [[09h00, < 9h05], [09h05, < 9h10], ... ] -> [[09h00, < 9h30], [09h30, < 10h], ... ]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filenames
|
list[str | Path]
|
List of netcdf nimrod files |
required |
output_name
|
str | Path
|
Output filename |
required |
Returns:
| Type | Description |
|---|---|
str | Path
|
Path to the output file |
Source code in geospatial_tools/radar/nimrod.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |