Skip to content
Daniel Wolfensberger edited this page May 7, 2020 · 31 revisions

cosmo_pol : a polarimetric radar forward operator for the COSMO model

Description

cosmo_pol is a forward polarimetric radar operator for the COSMO numerical weather prediction (NWP) model. Unfortunately it only works in Linux. Its main specifies are the following.

  • Simulates measurements of radar reflectivity at horizontal polarization (ZH), differential reflectivity (ZDR), specific differential phase shift (KDP) and Doppler variables (RVEL and/or Doppler spectrum)
  • Takes into account attenuation, atmospheric refraction, beam-broadening, and partial beam-blocking
  • Works for ground based or spaceborne (GPM-DPR satellite radar) radar scans
  • Includes a new Doppler scheme, which allows to estimate the full Doppler spectrum
  • Includes a melting scheme which allows to represent the very specific polarimetric signature of melting hydrometeors. *Works for both the one-moment and two-moment microphysical parameterizations of COSMO

Installation

I highly suggest to use Anaconda as a python distribution, as it will make the installation much easier.

Start by installing my other library pycosmo which is required to read the input COSMO files. Check the wiki to see how to install it. Most of the dependencies of cosmo_pol are also dependencies of pycosmo.

Then the only additional required dependency is Py-ART, a well known library for radar processing.

Once the dependencies have been installed simply download the source code, go to the root directory, and run

sudo python setup.py install

You then need to add the scattering lookup tables. They are available here, in a rather large (14 Gb) tar file, that you need to uncompress in the cosmo_pol installation folder (by default this should be in <anaconda_path>/envs/<name_of_virtualenv>/lib/python3.6/site-packages/cosmo_pol/lookup/. Please contact me if the link above is dead.

Define the user configuration

To simulate radar variables, you first need to create a configuration file in a .yml format. Below is an example of such a file. All entries will be commented later.

radar:
    coords: [46.04079, 8.83321,1604]
    type: ground
    frequency: 35.6
    range: 95000
    radial_resolution: 500
    PRI: 700
    K_squared: 0.93
    FFT_length: 128
    sensitivity: [-15,10000]
    3dB_beamwidth: 1.
    antenna_speed: 0.2
integration:
    scheme: 1
    nh_GH: 5
    nv_GH: 9
    weight_threshold: 0.999
refraction:
    scheme: 1
attenuation:
    correction: 1
doppler:
    scheme: 1 
    motion_correction: 1
microphysics:
    with_melting: 1
    with_ice_crystals: 1
    with_attenuation: 1

All fields where MANDATORY is specified, are mandatory (no joke). So if you give no value, an error will be returned. All others are optional and a default value will be provided if they are missing or if you give an invalid value. Note that the orders of the specified options does not import.

  • radar: section with all radar properties
    • coords: MANDATORY, coordinates of the radar as a 3 element tuple (lat, lon, alt), where lat and lon are in degrees and the altitude is in meters
    • frequency: MANDATORY, frequency of the radar in GHz
    • range: the maximum range of the radars, in meters, default is 150000 meters
    • radial_resolution: the distance between two consecutive radar gates in meters, default is 500 meters
    • PRI: pulse repetition interval in mS, i.e. the time between two consecutive pulses, is used to derive the width of the velocity bins in the Doppler spectrum
    • FFT_length: the length of the FFT window used for the Doppler spectrum in number of bins, default is 256 bins
    • sensitivity: the sensitivity of the radar, three ways of specifying it are possible. The first is just a single value of reflectivity factor, ex. 14 dBZ, which means that all simulated radar observables will be removed if the reflectivity at that point is lower than the sensitivity. The second way is a tuple (amplitude, distance), where amplitude is a reflectivity factor in dBZ at a specified distance in meters. The third way is a tuple (sensitivity, gain, snr), where sensitivity is antenna sensitivity in dBm, gain, the total radar gain in dBm and snr, the desired signal-to-noise ratio (in dB). The default is [-5 dBZ, 10000 m]
    • 3dB_beamwidth: the 3dB beamwidth of the radar antenna in degrees, used for integration over the antenna pattern, the default is 1 degree.
    • K_squared: the value of |Kw|2 used in the computation of the reflectivity factor. The default (if no value is provided) is 0.93. IMPORTANT, if you leave a blank (i.e. K_squared: ), the value of |Kw|2 will be computed based on the specified radar frequency, at 10°C for liquid water.
    • antenna_speed: the angular velocity of the radar's antenna motion in rad/sec, default is 0.2 rad/sec. This is used only for correction the Doppler spectrum for broadening due to antenna rotation, if antenna_correction = 1 in the doppler section.
  • refraction: section for the specificities of the atmospheric refraction estimation
    • scheme: The scheme to be used, 1 = 4/3 Earth radius scheme, 2 = ODE method of Zeng and Blahak (2014), if the ODE method is used, then all variables needed to compute the atmospheric refractivity (pressure, vapour contentration and temperature) must be present in the provided COSMO GRIB file. Default is 1 (4/3)
  • integration: section for specificities of the antenna power density quadrature integration
    • scheme: the quadrature method to be used, there are several implemented methods, but I recommend only two of them: 1, the standard Gauss-Hermite quadrature where the antenna diagram is supposed to be Gaussian and 'ml': which is the standard Gauss-Hermite quadrature but with oversampling at the melting layer edges, which helps to avoid numerical artefacts due to the sharp transitions at the melting layer edges.
    • nv_GH: Number of quadrature points to be used in the vertical (elevational) direction. Default is 5. The larger the number of points, the higher the accuracy, but the computation cost increases almost linearly...
    • nh_GH: Number of quadrature points to be used in the horizontal (azimuthal) direction. Default is 3. The larger the number of points, the higher the accuracy, but the computation cost increases almost linearly...
    • weight_threshold: To improve the computation speed, the number of quadrature points to be used can be limited with this parameter. weight_threshold is a number between 0 and 1, which defines the number of quadrature points to be used, based on their relative weight, i.e. a value of 0 implies that no point will be used, 1 that all points are used, 0.4 that only the 40% of points with the highest weights will be used, 0.9 that the 90% of all points with the highest weights are used, and so on. Default is 1, because this method is NOT recommended, as the importance of a quadrature point depends not only on its weight but also and mostly on the precipitation along the corresponding radial.
  • doppler: section for specificities of the estimation of Doppler variables
    • scheme: The method to be used for the estimation of Doppler variables: 1 is a simple unweighted estimation of the average Doppler velocity, 2 is a relectivity weighted estimation of the average Doppler velocity, finally 3 is the full Doppler scheme, where the Doppler spectrum is returned at every radar gate (the average Doppler velocity is returned as well). Default is 1
    • turbulence_correction: For scheme == 3 only (full Doppler spectrum). Specify if the computed spectrum should be corrected (broadened) for turbulence effects. This requires the variable EDR (Eddy Dissipitation Rate) to be be present in the provided COSMO file, otherwise it will not be applied. Default is 0 (False)
    • motion_correction: For scheme == 3 only (full Doppler spectrum). Specify if the computed spectrum should be corrected (broadened) for antenna motion effects. This requires to provided a valid value of antenna_speed in the radar section. Default is 0 (False)
  • microphysics: section for specificities of the hydrometeor microphysics parameterization
    • with_melting: Whether or not to use the melting scheme, in which the co-existence of snow and/or graupel and rain implies the presence of melting hydrometeors, with a very specific polarimetric signature. Default is 0 (False).
    • with_ice_crystals: Whether or not to consider ice crystals in the scattering simulation. Default is 1 (True).
    • with_attenuation: Whether or not to consider attenuation for ZH and ZDR. Default is 1 (True).
    • scattering: Defines the scattering lookup tables used to retrieve the scattering properties of hydrometeors.

To use the radar operator follow this example:

from cosmo_pol import RadarOperator
radop = RadarOperator(options_file='config.yml')
cfile = '/ltedata/Daniel/cfiles_COSMO/lmConstPara_1158x774_0.01_20160106.grib'
radop.load_model_file('/data/cosmo_runs_monika/inlaf201708020015', cfilename = cfile)
ppi = radop.get_PPI(elevations = 1) # For PPI, for all azimuths from 0 to 360  with a step of 3DB beamwidth (as specified in config file)
rhi = radop.get_RHI(elevations = np.arange(0,90,3), azimuth = 10) # For RHI, for certain elevations only

gpm_file = '2B-CS-MXPOLCH.GPM.DPRGMI.CORRA2015.20170209-S233714-E233814.016776.V04A.HDF5'
gpm = radop.get_GPM_swath(gpm_file, band = 'Ku')