Hello everyone,
I have converted RADOLAN data to xarray dataset.
dataset = xr.open_dataset('C:/Users/v-sandeepa/Desktop/Personal/Thesis/2022.nc')
dataset
Out[8]:
<xarray.Dataset>
Dimensions: (time: 8760, y: 254, x: 256)
Coordinates:
* time (time) datetime64[ns] 2022-01-01T00:50:00 ... 2022-12-31T23:50:00
* y (y) float64 -4.171e+06 -4.17e+06 ... -3.919e+06 -3.918e+06
* x (x) float64 8.904e+04 9.004e+04 9.104e+04 ... 3.43e+05 3.44e+05
Data variables:
RW (time, y, x) float32 ...
Attributes:
radarid: 10000
formatversion: 3
radolanversion: 2.29.1
radarlocations: ['asb', 'boo', 'ros', 'hnr', 'umd', 'pro', 'ess', 'fld',...
moduleflag: 1
rw_variable = dataset['RW']
rw_variable
Out[10]:
<xarray.DataArray 'RW' (time: 8760, y: 254, x: 256)>
[569610240 values with dtype=float32]
Coordinates:
* time (time) datetime64[ns] 2022-01-01T00:50:00 ... 2022-12-31T23:50:00
* y (y) float64 -4.171e+06 -4.17e+06 ... -3.919e+06 -3.918e+06
* x (x) float64 8.904e+04 9.004e+04 9.104e+04 ... 3.43e+05 3.44e+05
Attributes:
valid_min: 0
valid_max: 4095
standard_name: rainfall_rate
long_name: RW
unit: mm h-1
grid_mapping: spatial_ref
# Group the data by time and calculate the mean along x and y dimensions
grouped_data = rw_variable.groupby("time").mean(dim=('x', 'y'))
grouped_data
Out[11]:
<xarray.DataArray 'RW' (time: 8760)>
array([0.13057493, 0.16935617, 0.16515529, ..., nan, nan,
nan], dtype=float32)
Coordinates:
* time (time) datetime64[ns] 2022-01-01T00:50:00 ... 2022-12-31T23:50:00
Attributes:
valid_min: 0
valid_max: 4095
standard_name: rainfall_rate
long_name: RW
unit: mm h-1
grid_mapping: spatial_ref
# Calculate the sum of precipitation for the entire year
yearly_precipitation_2022 = grouped_data.sum(dim='time')
yearly_precipitation_2022
Out[13]:
<xarray.DataArray 'RW' ()>
array(2064.6753, dtype=float32)
From the above line, we can say annual precipitation for 2022 according to the code is 2064.7mm.
However, according to this [Annual rainfall of German federal states in 2022](Rainfall in Germany by season and annual average by year, month and land, federated state (ru-geld.de)) , annual rainfall is only 435mm.
I am wondering why there is so much difference. Is there any scale factor for RADOLAN data set? Seeking the help of experts @kmuehlbauer @mgrover1
Thanks in advance
sandeep