Basic concept of the Ruisdael data gather¶
In [1]:
import xarray as xr
import matplotlib.pyplot as plt
import os
import pooch
import pandas as pd
In [2]:
def sample_downloader(url):
file_path = pooch.retrieve(
url=url,
known_hash=None)
return file_path
In [3]:
def data_path_url(date):
path = (
f"{base_url}/{operation_mode}/"
f"{instrument_family}/{instrument_site_name}/"
f"{date.strftime('%Y/%m/%d')}"
)
target_file = f"{instrument_site_name}_{date.strftime('%Y%m%d_%H')}0000.nc"
return f"{path}/{target_file}"
In [4]:
# Base URL of the Ruisadel data collection
# https://opendap.4tu.nl/thredds/catalog/data2/Ruisdael/catalog.html
# Base URL for downloading Ruisdael data
base_url = 'https://opendap.4tu.nl/thredds/fileServer/data2/Ruisdael'
operation_mode = 'continuous_monitoring'
instrument_family = 'micro_rain_radar'
instrument_site_name = 'MRR005_Slufter'
In [5]:
# selected data
date = '20250622'
In [6]:
# URL data generator for the selected day
url_list = [data_path_url(d) for d in pd.date_range(f'{date} 00', f'{date} 23', freq='h')]
# Gathering the selected data
path_local_cache = [sample_downloader(u) for u in url_list]
# Reading the data
data = xr.open_mfdataset(path_local_cache, engine='netcdf4')
In [9]:
# Looking into the data
data
Out[9]:
<xarray.Dataset> Size: 915MB
Dimensions: (time: 8640, n_spectra: 128,
spectrum_n_samples: 64, range: 128)
Coordinates:
* range (range) float32 512B 0.0 35.0 ... 4.41e+03 4.445e+03
* time (time) datetime64[ns] 69kB 2025-06-22T00:00:00.00...
Dimensions without coordinates: n_spectra, spectrum_n_samples
Data variables: (12/25)
latitude (time) float32 35kB 51.93 51.93 ... 51.93 51.93
longitude (time) float32 35kB 4.0 4.0 4.0 4.0 ... 4.0 4.0 4.0
altitude (time) float32 35kB 4.0 4.0 4.0 4.0 ... 4.0 4.0 4.0
D (time, n_spectra, spectrum_n_samples) float32 283MB dask.array<chunksize=(360, 128, 64), meta=np.ndarray>
LWC (time, range) float32 4MB dask.array<chunksize=(1, 128), meta=np.ndarray>
ML (time, range) float32 4MB dask.array<chunksize=(1, 128), meta=np.ndarray>
... ...
spectrum_raw (time, n_spectra, spectrum_n_samples) float32 283MB dask.array<chunksize=(1, 128, 64), meta=np.ndarray>
time_coverage_end (time) |S128 1MB b'2025-06-22T00:59:50Z' ... b'20...
time_coverage_start (time) |S128 1MB b'2025-06-22T00:00:00Z' ... b'20...
time_reference (time) |S128 1MB b'1970-01-01T00:00:00Z' ... b'19...
transfer_function (time, range) float32 4MB dask.array<chunksize=(360, 128), meta=np.ndarray>
volume_number (time) int32 35kB 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0
Attributes: (12/23)
Conventions: CF/Radial
version: 1.3
title: METEK MRR Pro 1.2.5 Data
references:
field_names: Za,Z,Zea,Ze,RR,LWC,PIA,VEL,WIDTH,SNR,spectrum_...
institution: Delft University of Technology
... ...
sensor_name: MRR005
project_name: https://ruisdael-observatory.nl/
sampling_frequency: 500 kHz
wavelength: 1.238 cm
license: https://creativecommons.org/licenses/by-sa/4.0/
NCO: netCDF Operators version 5.0.6 (Homepage = htt...In [8]:
# Single variable visualization
plt.figure(figsize=(15,4))
data['RR'].plot(y='range', vmin=0, vmax=5, cmap='YlOrRd')
plt.show()
In [ ]: