RAVE
pycartesiancomposite.c File Reference

Python version of the Cartesian Composite generator API. More...

#include "pyravecompat.h"
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pyrave_debug.h"
#include "pycartesiancomposite.h"
#include "pyarea.h"
#include "pycartesian.h"
#include "pycartesianparam.h"
#include <arrayobject.h>
#include "rave_alloc.h"
#include "raveutil.h"
#include "rave.h"

Macros

#define NPY_NO_DEPRECATED_API   NPY_1_7_API_VERSION
 
#define PYCARTESIANCOMPOSITE_MODULE
 to get correct part of pycartesiancomposite.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 ("_cartesiancomposite")
 Debug this module.
 
 PyDoc_STRVAR (_pycartesiancomposite_type_doc, "The cartesian composite is a product generator that creates a cartesian object with a specified area from a number of other cartesian objects.\n" "In order for this operation to be successful, a selection method has to be set and if SelectionMethod_DISTANCE, also the distance_field. Then when executing the " "transform (nearest) method, the cartesian result will be created.\n" "\n" "The member attributes that can be set in the composite generator are:\n" "time - Time the cartesian product should represent as a string with format HHmmSS.\n" "date - Date the cartesian product should represent as a string in the format YYYYMMDD.\n" "quantity - The parameter (quantity) that the composite should be created for.\n" "offset - The offset to be used in the result.\n" "gain - The gain to be used in the result.\n" "nodata - Nodata value to be used in the result.\n" "undetect - Undetect value to be used in the result.\n" "method - How the selection should be done when comparing the cartesian objects.\n" " Can be one of:\n" " SelectionMethod_FIRST - First found value for all overlapping radars.\n" " SelectionMethod_MINVALUE - Minimum value of all overlapping radars.\n" " SelectionMethod_MAXVALUE - Maximum value of all overlapping radars.\n" " SelectionMethod_AVGVALUE - Average value for all overlapping radars.\n" " SelectionMethod_DISTANCE - Min value according to the distance field. Requires a distance field.\n" "\n" "Usage:\n" " import _cartesiancomposte, _raveio\n" " generator = _cartesiancomposite.new()\n" " generator.add(_raveio.open(\"cartesian_object_1.h5\").object)\n" " generator.add(_raveio.open(\"cartesian_object_2.h5\").object)\n" " ...\n" " generator.method = _cartesiancomposite.SelectionMethod_DISTANCE\n" " generator.distance_field = \"se.smhi.composite.distance.radar\"\n" " generator.date = ....\n" " ....\n" " result = generator.nearest(area)\n")
 
 MOD_INIT (_cartesiancomposite)
 

Variables

PyTypeObject PyCartesianComposite_Type
 

Detailed Description

Python version of the Cartesian Composite generator API.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2013-10-09

Macro Definition Documentation

◆ PYCARTESIANCOMPOSITE_MODULE

#define PYCARTESIANCOMPOSITE_MODULE

to get correct part of pycartesiancomposite.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 ( "_cartesiancomposite" )

Debug this module.