pyrad.proc.process_grid_stats#

pyrad.proc.process_grid_stats(procstatus, dscfg, radar_list=None)[source]#

computes spatial statistics of a field within a Cartesian grid. the statistic is computed at every Cartesian grid cell using all the polar gates that fall within the region of interest of this grid cell.

Parameters:
  • procstatus (int) – Processing status: 0 initializing, 1 processing volume, 2 post-processing

  • dscfg (dictionary of dictionaries) –

    data set configuration. Accepted Configuration Keywords:

    datatype : list of string. Dataset keyword
        The input data types, can be any datatype supported by pyrad
    gridconfig : dictionary. Dataset keyword
        Dictionary containing some or all of this keywords:
        xmin, xmax, ymin, ymax, zmin, zmax : floats
            minimum and maximum horizontal distance from grid origin [km]
            and minimum and maximum vertical distance from grid origin [m]
            Defaults -40, 40, -40, 40, 0., 10000.
        latmin, latmax, lonmin, lonmax : floats
            minimum and maximum latitude and longitude [deg], if specified
            xmin, xmax, ymin, ymax, latorig, lonorig will be ignored
        hres, vres : floats
            horizontal and vertical grid resolution [m]
            Defaults are 1000. for hres and (zmax - zmin + 1) for vres
            which ensures that there is only one single grid cell in the
            vertical dimension (extending from zmin to zmax)
        latorig, lonorig, altorig : floats
            latitude and longitude of grid origin [deg] and altitude of
            grid origin [m MSL]
            Defaults the latitude, longitude and altitude of the radar
    wfunc : str. Dataset keyword
        the weighting function used to compute the weights of the radar gates close to a
        grid point. Possible values BARNES, BARNES2, CRESSMAN, NEAREST, GRID.
        GRID will give a weight of 1 to all polar gates which centroids fall within the Cartesian grid cell, 0 otherwise
        Default GRID
    roif_func : str. Dataset keyword
        the function used to compute the region of interest.
        Possible values: dist_beam, constant
    roi : float. Dataset keyword
        the (minimum) radius of the region of interest in m. Default half
        the largest resolution
    beamwidth : float. Dataset keyword
        the radar antenna beamwidth [deg]. If None that of the key
        radar_beam_width_h in attribute instrument_parameters of the radar
        object will be used. If the key or the attribute are not present
        a default 1 deg value will be used
    beam_spacing : float. Dataset keyword
        the beam spacing, i.e. the ray angle resolution [deg]. If None,
        that of the attribute ray_angle_res of the radar object will be
        used. If the attribute is None a default 1 deg value will be used
    statistic : string. Dataset Keyworrd
        Statistic to compute: Can be mean, std, min, max, and QXX (where XX is a 2 number digit, for example Q25)
        Default mean
    weighted : bool. Dataset Keyword
        Whether to weigh the statistics by the weights of the polar gates for every Cartesian grid cell.
        if wfunc == GRID, this keyword is ignored.
        Default False
    
  • radar_list (list of Radar objects) – Optional. list of radar objects

Returns:

  • new_dataset (dict) – dictionary containing the output fields corresponding to datatypes

  • ind_rad (int) – radar index