RAVE
pycomposite.c File Reference

Python version of the Composite API. More...

#include "composite.h"
#include "pyravecompat.h"
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pyrave_debug.h"
#include "pycomposite.h"
#include "pypolarvolume.h"
#include "pypolarscan.h"
#include "pycartesian.h"
#include "pyarea.h"
#include "rave_alloc.h"
#include "raveutil.h"
#include "rave.h"
#include "pycompositealgorithm.h"

Macros

#define NPY_NO_DEPRECATED_API   NPY_1_7_API_VERSION
 
#define PYCOMPOSITE_MODULE
 to get correct part of pycomposite.h
 
#define raiseException_gotoTag(tag, type, msg)
 Sets a python exception and goto tag.
 
#define raiseException_returnNULL(type, msg)
 Sets a python exception and return NULL.
 

Functions

 PYRAVE_DEBUG_MODULE ("_pycomposite")
 Debug this module.
 
 PyDoc_STRVAR (_pycomposite_type_doc, "The composite type provides the possibility to create cartesian composites from a number of polar objects.\n" "To generate the composite, one or many polar scans or polar volumes has to be added to the generator. Then generate should be called with the expected area and an optional list of how/task quality field names.\n" "There are a few attributes that can be set besides the functions.\n" " height - The height in meters that should be used when generating a composite like CAPPI, PCAPPI or PMAX.\n" " elangle - The elevation angle in radians that should be used when generating a composite like PPI." " range - The range that should be used when generating the Pseudo MAX. This range is the limit in meters\n" " for when the vertical max should be used. When outside this range, the PCAPPI value is used instead.\n" " product - The product type that should be generated when generating the composite.\n" " Height/Elevation angle and range are used in combination with the products.\n" " PPI requires elevation angle\n" " CAPPI, PCAPPI and PMAX requires height above sea level\n" " PMAX also requires range in meters\n" " selection_method - The selection method to use when there are more than one radar covering same point. I.e. if for example taking distance to radar or height above sea level. Currently the following methods are available\n" " _pycomposite.SelectionMethod_NEAREST - Value from the nearest radar is selected.\n" " _pycomposite.SelectionMethod_HEIGHT - Value from radar which scan is closest to the sea level at current point.\n" " interpolation_method - Interpolation method is used to choose how to interpolate the surrounding values. The default behaviour is NEAREST.\n" " _pycomposite.InterpolationMethod_NEAREST - Nearest value is used\n" " _pycomposite.InterpolationMethod_LINEAR_HEIGHT - Value calculated by performing a linear interpolation between the closest positions above and below\n" " _pycomposite.InterpolationMethod_LINEAR_RANGE - Value calculated by performing a linear interpolation between the closest positions before\n" " and beyond in the range dimension of the ray\n" " _pycomposite.InterpolationMethod_LINEAR_AZIMUTH - Value calculated by performing a linear interpolation between the closest positions on each\n" " side of the position, i.e., interpolation between consecutive rays\n" " _pycomposite.InterpolationMethod_LINEAR_RANGE_AND_AZIMUTH - Value calculated by performing a linear interpolation in azimuth and range directions.\n" " _pycomposite.InterpolationMethod_LINEAR_3D - Value calculated by performing a linear interpolation in height, azimuth and range directions.\n" " _pycomposite.InterpolationMethod_QUADRATIC_HEIGHT - Value calculated by performing a quadratic interpolation between the closest positions before and beyond in\n" " the range dimension of the ray. Quadratic interpolation means that inverse distance weights raised to the\n" " power of 2 are used in value interpolation.\n" " _pycomposite.InterpolationMethod_QUADRATIC_3D - Value calculated by performing a quadratic interpolation in height, azimuth and range\n" " directions. Quadratic interpolation means that inverse distance weights raised to the\n" " power of 2 are used in value interpolation.\n" "" " interpolate_undetect - If undetect should be used in interpolation or not.\n" " If undetect not should be included in the interpolation, the behavior will be the following:\n" " * If all values are UNDETECT, then result will be UNDETECT.\n" " * If only one value is DATA, then use that value.\n" " * If more than one value is DATA, then interpolation.\n" " * If all values are NODATA, then NODATA.\n" " * If all values are either NODATA or UNDETECT, then UNDETECT.\n" "" " date - The nominal date as a string in format YYYYMMDD\n" " time - The nominal time as a string in format HHmmss\n" " quality_indicator_field_name - If this field name is set, then the composite will be generated by first using the quality indicator field for determining\n" " radar usage. If the field name is None, then the selection method will be used instead.\n" "\n" "Usage:\n" " import _pycomposite\n" " generator = _pycomposite.new()\n" " generator.selection_method = _pycomposite.SelectionMethod_HEIGHT\n" " generator.product = \"PCAPPI\"\n" " generator.height = 500.0\n" " generator.date = \"20200201\"\n" " generator.date = \"100000\"\n" " generator.addParameter(\"DBZH\", 2.0, 3.0, -30.0)\n" " generator.add(_rave.open(\"se1_pvol_20200201100000.h5\").object)\n" " generator.add(_rave.open(\"se2_pvol_20200201100000.h5\").object)\n" " generator.add(_rave.open(\"se3_pvol_20200201100000.h5\").object)\n" " result = generator.generate(myarea, [\"se.smhi.composite.distance.radar\",\"pl.imgw.radvolqc.spike\"])\n")
 
 MOD_INIT (_pycomposite)
 

Variables

PyTypeObject PyComposite_Type
 

Detailed Description

Python version of the Composite API.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2010-01-29

Macro Definition Documentation

◆ PYCOMPOSITE_MODULE

#define PYCOMPOSITE_MODULE

to get correct part of pycomposite.h

◆ 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 a python exception and return NULL.

Function Documentation

◆ PYRAVE_DEBUG_MODULE()

PYRAVE_DEBUG_MODULE ( "_pycomposite" )

Debug this module.