Readers

Cloudnet

This script contains functions to read cloudnet data.

orbital_radar.readers.cloudnet.convert_time(ds, time_variable, base_time, factor=1)[source]

Convert time in seconds since base_time to datetime64.

Parameters:
dsxarray.Dataset

Dataset containing the time variable.

time_variablestr

Name of the time variable.

base_timestr

Base time as string (e.g. “1970-01-01”)

factorfloat, optional

Factor to convert time to nanoseconds. Default is 1.

orbital_radar.readers.cloudnet.read_cloudnet(attenuation_correction_input, date, site_name, path, add_date=True)[source]

Reads Cloudnet data.

The following file naming is expected (e.g. for 2022-02-14 at Mindelo): 20220214_mindelo_ecmwf.nc 20220214_mindelo_categorize.nc

Parameters:
attenuation_correction_input: str

Cloudnet product to read. Either ‘categorize’ or ‘ecmwf’.

date: np.datetime64

Date for which data is read.

site_name: str

Name of the site.

path: str

Path to the Cloudnet data. The path should contain the year, month, and day as subdirectories.

add_date: bool, optional

If True, the date is added to the path. Default is True.

Returns:
ds: xarray.Dataset

Cloudnet data.

Config

Reads TOML configuration

orbital_radar.readers.config.check_config(config)[source]

Check config file for consistency

orbital_radar.readers.config.read_config(filename)[source]

Reads user configuration from TOML file.

Parameters:
filename: str

Name of the TOML file

Returns:
config: dict

Configuration dictionary

Radar

This script contains all reader functions for the different radar formats. These functions are wrapped by the main function, which picks the correct reader depending on the radar site.

The final output is always an xarray.Dataset with the two variables radar reflectivity “ze” in [mm6 m-3] and “vm” in [m s-1] as a function of range and time.

The input Doppler velocity should be negative for downward motion and positive for upward motion. This is changed to negative upward and positive downward to match spaceborne convention.

class orbital_radar.readers.radar.Radar(date, site_name, path, input_radar_format)[source]

This class selects the reading function for the provided site and performs quality-checks of the imported data. The output contains “ze” and “vm” variables.

Methods

convert_and_sort_time(base_time)

Convert time in seconds since base to np.datetime64 format and sort time.

get_all_files(pattern)

Lists all radar files in the directory.

make_date_path()

Creates path with date structure if it exists.

read_arm()

Reader for ARM radar data.

read_bco()

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC.

read_cloudnet()

Reads radar reflectivity and Doppler velocity from Cloudnet categorize files.

read_geoms()

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC.

read_mirac_p5()

This function reads the radar netCDF files of the RPG W-band radar onboard the Polar 5 aircraft.

read_pamtra()

Reads PAMTRA simulation for a point location as a function of time.

read_rasta()

This function reads the radar netCDF files of the airborne RASTA radar.

read_uoc_v0()

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC.

read_uoc_v1()

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC.

read_uoc_v2()

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC.

remove_duplicate_times(ds)

Removes duplicate times.

status_message(i, file, files)

This message will be printed while reading the radar data.

convert_and_sort_time(base_time)[source]

Convert time in seconds since base to np.datetime64 format and sort time.

Parameters:
base_timestr

Base time as string (e.g. “1970-01-01”)

get_all_files(pattern)[source]

Lists all radar files in the directory.

Parameters:
patternstr

Specific file pattern depending on the product.

Returns:
list

list of all files inside the directory

make_date_path()[source]

Creates path with date structure if it exists. Otherwise, uses regular path without date extension.

read_arm()[source]

Reader for ARM radar data. The reader uses the best estimate of the radar reflectivity.

Units of file: ze unit: dBZ vm unit: m s-1

read_bco()[source]

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC. They correspond to the level 2 version of the data processing

Units of file: ze unit: dBZ vm unit: m s-1

Note: Only one file per day

read_cloudnet()[source]

Reads radar reflectivity and Doppler velocity from Cloudnet categorize files.

Note: Cloudnet height is already in height above mean sea level.

read_geoms()[source]

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC. They correspond to the level 2 version of the data processing

Units of file: ze unit: mm6 m-3 vm unit: m s-1

Note: fill value -999 in attributes not recognized by xarray.

read_mirac_p5()[source]

This function reads the radar netCDF files of the RPG W-band radar onboard the Polar 5 aircraft.

Units of file: ze unit: dBZ

Note: no mean Doppler velocity available.

read_pamtra()[source]

Reads PAMTRA simulation for a point location as a function of time.

Attenuation: The output radar reflectivity contains attenuation for bottom-up view (groundbased radar), and additionally one radar reflectivity without attenuation.

Convention of output: ze: radar reflectivity without attenuation ze_top_down: radar reflectivity with attenuation for top-down view ze_bottom_up: radar reflectivity with attenuation for bottom-up view

Units of file: ze unit: dBZ vm unit: m s-1

read_rasta()[source]

This function reads the radar netCDF files of the airborne RASTA radar. The time-dependent height is interpolated onto a regular height grid. No correction for gas attenuation is applied (gaseous_twowayatt). The horizontal aircraft speed is also read.

The following two flags are applied to ze and vm:

First flag array: flag (1 and 2 are removed) -4: nadir not available -3: Last gates not valid -2: First gates not valid -1: beyond maximum range 0: no cloud 1: cloud or precipitation 2: possible cloud 3: ground echo 4: ghost ground echo (downward domain) 5: ghost ground echo (upward domain) 6: underground signal 7: underground noise 8: Z can be interpolated

Second flag array: flag_Z_interpolated (2 and 3 are removed) 0: no interpolation 1: interpolated but data available 2: interpolated and no data available 3: ghost ground echo (upward) is interpolated

Units of file: ze unit: dBZ vm unit: m s-1 ac_speed unit: m s-1

Note: only the vertical-pointing antennas are used.

read_uoc_v0()[source]

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC. They correspond to the level 2 version of the data processing

Units of file: ze unit: dBZ vm unit: m s-1

Note: Only one file per day

read_uoc_v1()[source]

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC. They correspond to the level 2 version of the data processing

Units of file: ze unit: mm6 m-3 vm unit: m s-1

Note: Doppler spectra are not read to improve performance.

read_uoc_v2()[source]

This function reads the radar netCDF files of the RPG w-band radar The data are precessed with the Matlab code of the Uuniversity of Cologne, UoC. They correspond to the level 2 version of the data processing

Units of file: ze unit: mm6 m-3 vm unit: m s-1

Note: fill value -999 in attributes not recognized by xarray.

static remove_duplicate_times(ds)[source]

Removes duplicate times.

Parameters:
dsxr.Dataset

Any data with a “time” coordinate.

static status_message(i, file, files)[source]

This message will be printed while reading the radar data.

Range weighting function

Reads weighting function from EarthCARE CPR.

orbital_radar.readers.rangewf.read_range_weighting_function(file)[source]

Reads EarthCARE CPR range weighting function. The pulse length factor is reversed to match the sign convention of the groundbased radar.

Parameters:
filestr

Path to file containing weighting function

Returns:
wfxarray.Dataset

Weighting function

Spaceview

This script reads the output of the simulator

orbital_radar.readers.spaceview.read_spaceview(file)[source]

Reads the output of the simulator.

Parameters:
file: str

Path to the NetCDF file.

Returns:
ds: xarray.Dataset

Dataset containing the output of the simulator.