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...
xarray.Dataset
    • time: 8640
    • n_spectra: 128
    • spectrum_n_samples: 64
    • range: 128
    • range
      (range)
      float32
      0.0 35.0 ... 4.41e+03 4.445e+03
      standard name :
      projection_range_coordinate
      long_name :
      range_to_measurement_volume
      units :
      meters
      spacing_is_constant :
      true
      meters_to_center_of_first_gate :
      0.0
      meters_between_gates :
      35.0
      axis :
      radial_range_coordinate
      array([   0.,   35.,   70.,  105.,  140.,  175.,  210.,  245.,  280.,  315.,
              350.,  385.,  420.,  455.,  490.,  525.,  560.,  595.,  630.,  665.,
              700.,  735.,  770.,  805.,  840.,  875.,  910.,  945.,  980., 1015.,
             1050., 1085., 1120., 1155., 1190., 1225., 1260., 1295., 1330., 1365.,
             1400., 1435., 1470., 1505., 1540., 1575., 1610., 1645., 1680., 1715.,
             1750., 1785., 1820., 1855., 1890., 1925., 1960., 1995., 2030., 2065.,
             2100., 2135., 2170., 2205., 2240., 2275., 2310., 2345., 2380., 2415.,
             2450., 2485., 2520., 2555., 2590., 2625., 2660., 2695., 2730., 2765.,
             2800., 2835., 2870., 2905., 2940., 2975., 3010., 3045., 3080., 3115.,
             3150., 3185., 3220., 3255., 3290., 3325., 3360., 3395., 3430., 3465.,
             3500., 3535., 3570., 3605., 3640., 3675., 3710., 3745., 3780., 3815.,
             3850., 3885., 3920., 3955., 3990., 4025., 4060., 4095., 4130., 4165.,
             4200., 4235., 4270., 4305., 4340., 4375., 4410., 4445.], dtype=float32)
    • time
      (time)
      datetime64[ns]
      2025-06-22T00:00:00.003011072 .....
      standard name :
      time
      long_name :
      time_in_seconds_since_volume_start
      array(['2025-06-22T00:00:00.003011072', '2025-06-22T00:00:10.002994176',
             '2025-06-22T00:00:20.003004160', ..., '2025-06-22T23:59:30.003008000',
             '2025-06-22T23:59:40.003004160', '2025-06-22T23:59:50.003009024'],
            dtype='datetime64[ns]')
    • latitude
      (time)
      float32
      51.93 51.93 51.93 ... 51.93 51.93
      units :
      degrees_north
      array([51.93348, 51.93348, 51.93348, ..., 51.93348, 51.93348, 51.93348],
            dtype=float32)
    • longitude
      (time)
      float32
      4.0 4.0 4.0 4.0 ... 4.0 4.0 4.0 4.0
      units :
      degrees_east
      array([3.999866, 3.999866, 3.999866, ..., 3.999866, 3.999866, 3.999866],
            dtype=float32)
    • altitude
      (time)
      float32
      4.0 4.0 4.0 4.0 ... 4.0 4.0 4.0 4.0
      units :
      meters
      array([4., 4., 4., ..., 4., 4., 4.], dtype=float32)
    • D
      (time, n_spectra, spectrum_n_samples)
      float32
      dask.array<chunksize=(360, 128, 64), meta=np.ndarray>
      standard name :
      drop_sizes
      long_name :
      units :
      1
      index_var_name :
      block_avg_length :
      0
      is_spectrum :
      true
      Array Chunk
      Bytes 270.00 MiB 11.25 MiB
      Shape (8640, 128, 64) (360, 128, 64)
      Dask graph 24 chunks in 73 graph layers
      Data type float32 numpy.ndarray
      64 128 8640
    • LWC
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      mass_concentration_of_liquid_water_in_air
      long_name :
      units :
      g m-3
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • ML
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      melting_layer
      long_name :
      units :
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • N
      (time, n_spectra, spectrum_n_samples)
      float32
      dask.array<chunksize=(1, 128, 64), meta=np.ndarray>
      standard name :
      drop_size_distribution
      long_name :
      units :
      1
      index_var_name :
      block_avg_length :
      0
      is_spectrum :
      true
      Array Chunk
      Bytes 270.00 MiB 32.00 kiB
      Shape (8640, 128, 64) (1, 128, 64)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      64 128 8640
    • PIA
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      path_integrated_rain_attenuation
      long_name :
      units :
      dB
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • RR
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      rainfall_rate
      long_name :
      units :
      mm h-1
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • SNR
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      signal_to_noise_ratio
      long_name :
      units :
      dB
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • VEL
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      radial_velocity_of_scatterers_towards_instrument
      long_name :
      units :
      m s-1
      field_folds :
      true
      fold_limit_lower :
      -0.0
      fold_limit_upper :
      11.890331
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • WIDTH
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      doppler_spectrum_width
      long_name :
      units :
      m/s
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • Z
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      log_reflectivity
      long_name :
      units :
      dBZ
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • Za
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      log_attenuated_reflectivity
      long_name :
      units :
      dBZ
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • Ze
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      equivalent_reflectivity_factor
      long_name :
      units :
      dBZ
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • Zea
      (time, range)
      float32
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      attenuated_equivalent_reflectivity_factor
      long_name :
      units :
      dBZ
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      false
      Array Chunk
      Bytes 4.22 MiB 512 B
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • calibration_constant
      (time)
      float32
      1.038e+07 1.038e+07 ... 1.038e+07
      array([10375414., 10375414., 10375414., ..., 10375414., 10375414.,
             10375414.], dtype=float32)
    • doppler_shift_spectrum
      (time)
      float32
      0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
      array([0., 0., 0., ..., 0., 0., 0.], dtype=float32)
    • index_spectra
      (time, range)
      float64
      dask.array<chunksize=(1, 128), meta=np.ndarray>
      standard_name :
      index variable spectra
      long_name :
      units :
      field_folds :
      false
      fold_limit_lower :
      0.0
      fold_limit_upper :
      0.0
      thresholding_xml :
      legend_xml :
      is_discreet :
      true
      Array Chunk
      Bytes 8.44 MiB 1.00 kiB
      Shape (8640, 128) (1, 128)
      Dask graph 8640 chunks in 49 graph layers
      Data type float64 numpy.ndarray
      128 8640
    • spectrum_raw
      (time, n_spectra, spectrum_n_samples)
      float32
      dask.array<chunksize=(1, 128, 64), meta=np.ndarray>
      standard name :
      log_attenuated_power
      long_name :
      units :
      dB
      index_var_name :
      block_avg_length :
      0
      is_spectrum :
      true
      Array Chunk
      Bytes 270.00 MiB 32.00 kiB
      Shape (8640, 128, 64) (1, 128, 64)
      Dask graph 8640 chunks in 49 graph layers
      Data type float32 numpy.ndarray
      64 128 8640
    • time_coverage_end
      (time)
      |S128
      b'2025-06-22T00:59:50Z' ... b'20...
      array([b'2025-06-22T00:59:50Z', b'2025-06-22T00:59:50Z',
             b'2025-06-22T00:59:50Z', ..., b'2025-06-22T23:59:50Z',
             b'2025-06-22T23:59:50Z', b'2025-06-22T23:59:50Z'], dtype='|S128')
    • time_coverage_start
      (time)
      |S128
      b'2025-06-22T00:00:00Z' ... b'20...
      array([b'2025-06-22T00:00:00Z', b'2025-06-22T00:00:00Z',
             b'2025-06-22T00:00:00Z', ..., b'2025-06-22T23:00:00Z',
             b'2025-06-22T23:00:00Z', b'2025-06-22T23:00:00Z'], dtype='|S128')
    • time_reference
      (time)
      |S128
      b'1970-01-01T00:00:00Z' ... b'19...
      array([b'1970-01-01T00:00:00Z', b'1970-01-01T00:00:00Z',
             b'1970-01-01T00:00:00Z', ..., b'1970-01-01T00:00:00Z',
             b'1970-01-01T00:00:00Z', b'1970-01-01T00:00:00Z'], dtype='|S128')
    • transfer_function
      (time, range)
      float32
      dask.array<chunksize=(360, 128), meta=np.ndarray>
      Array Chunk
      Bytes 4.22 MiB 180.00 kiB
      Shape (8640, 128) (360, 128)
      Dask graph 24 chunks in 73 graph layers
      Data type float32 numpy.ndarray
      128 8640
    • volume_number
      (time)
      int32
      0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
      array([0, 0, 0, ..., 0, 0, 0], dtype=int32)
    • range
      PandasIndex
      PandasIndex(Index([   0.0,   35.0,   70.0,  105.0,  140.0,  175.0,  210.0,  245.0,  280.0,
              315.0,
             ...
             4130.0, 4165.0, 4200.0, 4235.0, 4270.0, 4305.0, 4340.0, 4375.0, 4410.0,
             4445.0],
            dtype='float32', name='range', length=128))
    • time
      PandasIndex
      PandasIndex(DatetimeIndex(['2025-06-22 00:00:00.003011072',
                     '2025-06-22 00:00:10.002994176',
                     '2025-06-22 00:00:20.003004160',
                     '2025-06-22 00:00:30.002996992',
                     '2025-06-22 00:00:40.002995968',
                     '2025-06-22 00:00:50.003011840',
                     '2025-06-22 00:01:00.003002880',
                     '2025-06-22 00:01:10.003025920',
                     '2025-06-22 00:01:20.002994944',
                     '2025-06-22 00:01:30.003002880',
                     ...
                     '2025-06-22 23:58:20.003001088',
                     '2025-06-22 23:58:30.003011840',
                     '2025-06-22 23:58:40.003026944',
                     '2025-06-22 23:58:50.003001856',
                     '2025-06-22 23:59:00.002995968',
                     '2025-06-22 23:59:10.002993152',
                     '2025-06-22 23:59:20.003035136',
                        '2025-06-22 23:59:30.003008',
                     '2025-06-22 23:59:40.003004160',
                     '2025-06-22 23:59:50.003009024'],
                    dtype='datetime64[ns]', name='time', length=8640, freq=None))
  • 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_reflectivity,N
    institution :
    Delft University of Technology
    source :
    vertically profiling micro rain radar
    history :
    Sun Jun 22 03:05:06 2025: /home/ruisdael/miniconda3/bin/ncpdq -O -7 -L 5 --pck_map=dbl_flt --output=/mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc /mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc Sun Jun 22 03:05:04 2025: /home/ruisdael/miniconda3/bin/ncap2 -O -s latitude=double(51.933481);longitude=double(3.999866);altitude=double(4) --output=/mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc /mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc Sun Jun 22 03:05:02 2025: /home/ruisdael/miniconda3/bin/ncks -C -x -v azimuth,elevation,instrument_type,sweep_end_ray_index,sweep_mode,sweep_number,sweep_start_ray_index,fixed_angle --overwrite --output=/mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc /mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc Sun Jun 22 03:05:02 2025: /home/ruisdael/miniconda3/bin/ncatted -O -a comment,global,o,c,- -a contributors,global,o,c,Marc Schleiss, Saverio Guzzo, Rob Mackenzie, Andre Castro, Mahaut Sourzac -a frequency,global,o,c,24.23 GHz -a institution,global,o,c,Delft University of Technology -a instrument_firmware,global,o,c,MRR Pro 1.2.5 -a instrument_id,global,o,c,MRRPro62 -a instrument_name,global,o,c,METEK MRR Pro -a instrument_serial_number,global,o,c,0513108322 -a instrument_type,global,o,c,MRR Pro by Metek GmbH -a sensor_name,global,o,c,MRR005 -a project_name,global,o,c,https://ruisdael-observatory.nl/ -a sampling_frequency,global,o,c,500 kHz -a site_name,global,o,c,Slufter -a source,global,o,c,vertically profiling micro rain radar -a wavelength,global,o,c,1.238 cm -a license,global,o,c,https://creativecommons.org/licenses/by-sa/4.0/ --output=/mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc /mnt/c/ftp/mrrpro62/202506/20250622/20250622_000000.nc
    comment :
    -
    instrument_name :
    METEK MRR Pro
    site_name :
    Slufter
    contributors :
    Marc Schleiss, Saverio Guzzo, Rob Mackenzie, Andre Castro, Mahaut Sourzac
    frequency :
    24.23 GHz
    instrument_firmware :
    MRR Pro 1.2.5
    instrument_id :
    MRRPro62
    instrument_serial_number :
    0513108322
    instrument_type :
    MRR Pro by Metek GmbH
    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 = http://nco.sf.net, Code = http://github.com/nco/nco)
In [8]:
# Single variable visualization
plt.figure(figsize=(15,4))
data['RR'].plot(y='range', vmin=0, vmax=5, cmap='YlOrRd')
plt.show()
No description has been provided for this image
In [ ]: