BALTRAD PPC
pyppcradaroptions.c File Reference

Python API to the ppc radar options. More...

#include "pyppc_compat.h"
#include "Python.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pyppcradaroptions.h"
#include "pyrave_debug.h"
#include "rave_alloc.h"

Macros

#define PYPPCRADAROPTIONS_MODULE
 to get correct part in pyppcradaroptions
 
#define raiseException_gotoTag(tag, type, msg)
 Sets a python exception and goto tag.
 
#define raiseException_returnNULL(type, msg)
 Sets python exception and returns NULL.
 
#define raiseException_returnValue(val, type, msg)
 Sets python exception and returns specified value.
 

Functions

 PYRAVE_DEBUG_MODULE ("_ppcradaroptions")
 Debug this module.
 
 PyDoc_STRVAR (_pyppcro_setBand_doc, "Sets kdpUp, kdpDown and kdpStdThreshold based on what band.\n" " band = 's' => kdpUp = 14, kdpDown = -2, kdpStdThreshold = 5\n" " band = 'c' => kdpUp = 20, kdpDown = -2, kdpStdThreshold = 5\n" " band = 'x' => kdpUp = 40, kdpDown = -2, kdpStdThreshold = 5\n")
 
 PyDoc_STRVAR (_pyppcro_object_definition_doc, "Keeps track of options used for the different radar sources when it comes to the polarimetric process chain\n" "processing. In this documentation section all the available options are listed for the different radars and a description of the values they assume.\n" "\n" "The following settings are available:\n" "parametersUZ - parameters for TH, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "parametersVEL - parameters for VRADH, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "parametersTextPHIDP - parameters for the PHIDP texture, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "parametersRHV - parameters for RHOHV, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "parametersTextUZ - parameters for the TH texture, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "parametersClutterMap - parameters for the clutter map, 5 values separated by ',' Weight,X2,X3,Delta1,Delta2\n" " and the derived values will be X1=X2-Delta1, X3=X4-Delta2\n" "nodata - nodata to be used in most products\n" "minDBZ - min DBZ threshold in the clutter correction\n" "qualityThreshold - quality threshold in the clutter correction\n" "preprocessZThreshold - preprocessing Z threshold before starting actual processing\n" "residualMinZClutterThreshold - min z clutter threshold during residual clutter filtering\n" "residualThresholdZ - min Z threshold in the residual clutter filtering\n" "residualThresholdTexture - texture threshold in the residual clutter filtering\n" "residualClutterNodata - the nodata value to be used when creating the residual clutter image used for creating the mask\n" "residualClutterMaskNodata - Nodata value for the residual clutter mask\n" "residualClutterTextureFilteringMaxZ - Max Z value when creating the residual clutter mask, anything higher will be set to min value\n" "residualFilterBinSize - number of bins used in the window when creating the residual mask\n" "residualFilterRaySize - number of rays used in the window when creating the residual mask\n" "minZMedfilterThreshold - min z threshold used in the median filter that is used by the residual clutter filter\n" "processingTextureThreshold - threshold for the texture created in the pdp processing\n" "minWindow - min window size\n" "pdpRWin1 - pdp ray window 1\n" "pdpRWin2 - pdp ray window 2\n" "pdpNrIterations - number of iterations in pdp processing\n" "kdpUp - Maximum allowed value of Kdp\n" "kdpDown - Minimum allowed value of kdp\n" "kdpStdThreshold - Kdp STD threshold\n" "BB - BB value used in the zphi part of the pdp processing\n" "thresholdPhidp - threshold for PHIDP in the pdp processing\n" "minAttenuationMaskRHOHV - min RHOHV value for marking value as 1 in the attenuation mask\n" "minAttenuationMaskKDP - min KDP value for marking value as 1 in the attenuation mask\n" "minAttenuationMaskTH - min TH value for marking value as 1 in the attenuation mask\n" "attenuationGammaH - gamma h value used in the attenuation\n" "attenuationAlpha - alpha value used in the attenuation\n" "attenuationPIAminZ - min PIA Z value in attenuation process\n" "meltingLayerBottomHeight - The melting layer bottom height\n" "meltingLayerHourThreshold - The number of hours before default height should be used.\n" "invertPHIDP - if the PHIDP should be inverted (multiplied with -1) or not. Typically this can be needed if the RSP produces inverted values.\n" "requestedFields - '|' separated list of flags that defines what products should be added to the finished result.\n" " If the flag begins with a P, it means that the result is added as a parameter and the name of\n" " the parameter will be without the P_. If on the other hand the flag begins with a Q_ it means\n" " that the result is added as a quality field and in those cases the how/task name will be\n" " se.baltrad.ppc.<mask name without Q_ in lowercase>\n" " Available flags are:\n" " + P_TH_CORR\n" " + P_ATT_TH_CORR\n" " + P_DBZH_CORR\n" " + P_ATT_DBZH_CORR\n" " + P_KDP_CORR\n" " + P_RHOHV_CORR\n" " + P_PHIDP_CORR\n" " + P_ZDR_CORR\n" " + P_ZPHI_CORR\n" " + Q_RESIDUAL_CLUTTER_MASK\n" " + Q_ATTENUATION_MASK\n" " + Q_ATTENUATION\n")
 
 MOD_INIT (_ppcradaroptions)
 

Variables

PyTypeObject PyPpcRadarOptions_Type
 

Detailed Description

Python API to the ppc radar options.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2019-02-17

Macro Definition Documentation

◆ PYPPCRADAROPTIONS_MODULE

#define PYPPCRADAROPTIONS_MODULE

to get correct part in pyppcradaroptions

◆ raiseException_gotoTag

#define raiseException_gotoTag ( tag,
type,
msg )
Value:
{PyErr_SetString(type, msg); goto tag;}

Sets a python exception and goto tag.

◆ raiseException_returnNULL

#define raiseException_returnNULL ( type,
msg )
Value:
{PyErr_SetString(type, msg); return NULL;}

Sets python exception and returns NULL.

◆ raiseException_returnValue

#define raiseException_returnValue ( val,
type,
msg )
Value:
{PyErr_SetString(type, msg); return val;}

Sets python exception and returns specified value.

Function Documentation

◆ PyDoc_STRVAR()

PyDoc_STRVAR ( _pyppcro_object_definition_doc ,
"Keeps track of options used for the different radar sources when it comes to the polarimetric process chain\n" "processing. In this documentation section all the available options are listed for the different radars and a description of the values they assume.\n" "\n" "The following settings are available:\n" "parametersUZ - parameters for TH,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "parametersVEL                - parameters for VRADH,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "parametersTextPHIDP          - parameters for the PHIDP texture,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "parametersRHV                - parameters for RHOHV,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "parametersTextUZ             - parameters for the TH texture,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "parametersClutterMap         - parameters for the clutter map,
5 values separated by ' ,
' Weight,
X2 ,
X3 ,
Delta1 ,
Delta2\n" " and the derived values will be X1 = X2-Delta1,
X3 = X4-Delta2\n" "nodata                       - nodata to be used in most products\n" "minDBZ                       - min DBZ threshold in the clutter correction\n" "qualityThreshold             - quality threshold in the clutter correction\n" "preprocessZThreshold         - preprocessing Z threshold before starting actual processing\n" "residualMinZClutterThreshold - min z clutter threshold during residual clutter filtering\n" "residualThresholdZ           - min Z threshold in the residual clutter filtering\n" "residualThresholdTexture     - texture threshold in the residual clutter filtering\n" "residualClutterNodata        - the nodata value to be used when creating the residual clutter image used for creating the mask\n" "residualClutterMaskNodata    - Nodata value for the residual clutter mask\n" "residualClutterTextureFilteringMaxZ - Max Z value when creating the residual clutter mask,
anything higher will be set to min value\n" "residualFilterBinSize - number of bins used in the window when creating the residual mask\n" "residualFilterRaySize - number of rays used in the window when creating the residual mask\n" "minZMedfilterThreshold - min z threshold used in the median filter that is used by the residual clutter filter\n" "processingTextureThreshold - threshold for the texture created in the pdp processing\n" "minWindow - min window size\n" "pdpRWin1 - pdp ray window 1\n" "pdpRWin2 - pdp ray window 2\n" "pdpNrIterations - number of iterations in pdp processing\n" "kdpUp - Maximum allowed value of Kdp\n" "kdpDown - Minimum allowed value of kdp\n" "kdpStdThreshold - Kdp STD threshold\n" "BB - BB value used in the zphi part of the pdp processing\n" "thresholdPhidp - threshold for PHIDP in the pdp processing\n" "minAttenuationMaskRHOHV - min RHOHV value for marking value as 1 in the attenuation mask\n" "minAttenuationMaskKDP - min KDP value for marking value as 1 in the attenuation mask\n" "minAttenuationMaskTH - min TH value for marking value as 1 in the attenuation mask\n" "attenuationGammaH - gamma h value used in the attenuation\n" "attenuationAlpha - alpha value used in the attenuation\n" "attenuationPIAminZ - min PIA Z value in attenuation process\n" "meltingLayerBottomHeight - The melting layer bottom height\n" "meltingLayerHourThreshold - The number of hours before default height should be used.\n" "invertPHIDP - if the PHIDP should be inverted(multiplied with -1) or not. Typically this can be needed if the RSP produces inverted values.\n" "requestedFields - '|' separated list of flags that defines what products should be added to the finished result.\n" " If the flag begins with a P,
it means that the result is added as a parameter and the name of\n" " the parameter will be without the P_. If on the other hand the flag begins with a Q_ it means\n" " that the result is added as a quality field and in those cases the how/task name will be\n" " se.baltrad.ppc.< mask name without Q_ in lowercase >\n" " Available flags are:\n" "+P_TH_CORR\n" "+P_ATT_TH_CORR\n" "+P_DBZH_CORR\n" "+P_ATT_DBZH_CORR\n" "+P_KDP_CORR\n" "+P_RHOHV_CORR\n" "+P_PHIDP_CORR\n" "+P_ZDR_CORR\n" "+P_ZPHI_CORR\n" "+Q_RESIDUAL_CLUTTER_MASK\n" "+Q_ATTENUATION_MASK\n" "+Q_ATTENUATION\n"  )

Type definitions

◆ PYRAVE_DEBUG_MODULE()

PYRAVE_DEBUG_MODULE ( "_ppcradaroptions" )

Debug this module.