RAVE
pyqitotal.c File Reference

Python version of the QI total API. More...

#include "pyravecompat.h"
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pyrave_debug.h"
#include "pyravefield.h"
#include "pyqitotal.h"
#include "rave_alloc.h"

Macros

#define PYQITOTAL_MODULE
 to get correct part in pyqitotal.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 ("_qitotal")
 Debug this module.
 
PyTypeObject PyQITotal_Type
 
 PyDoc_STRVAR (_pyqitotal_type_doc, "Implementation of the QI total algorithms.\n" "\n" "This module is used for creating a quality index from a number of quality fields. Currently the 3 variants " "additive, multiplicative and minimum is supported.\n" "The calculations are performed in such a way that each quality field how/task name is assigned a weight and then " "the fields are evaluated according to the variant used." "\n" "There member variables within an instance are:\n" " * gain - the gain that should be used in the resulting field.\n" " * offset - the offset that should be used in the resulting field.\n" " * datatype - the datatype that should be used in the resulting field. See _rave for a list of available types.\n" "\n" "Assuming that you have 3 different quality fields you could create a QI total field like this:\n" " import _raveio, _qitotal\n" " qitotal = _qitotal.new()\n" " qitotal.setWeight(\"fi.fmi.ropo.detector.classification\", 1.0)\n" " qitotal.setWeight(\"se.smhi.detector.beamblockage\", 1.0)\n" " qitotal.setWeight(\"pl.imgw.radvolqc.broad\", 1.0)\n" "\n" " obj = _raveio.open(\"testscan.h5\").object.\n" " result = qitotal.minimum([obj.findQualityFieldByHowTask(\"fi.fmi.ropo.detector.classification\"),\n" " obj.findQualityFieldByHowTask(\"se.smhi.detector.beamblockage\"),\n" " obj.findQualityFieldByHowTask(\"pl.imgw.radvolqc.broad\")])\n")
 
 MOD_INIT (_qitotal)
 

Detailed Description

Python version of the QI total API.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2014-02-27

Macro Definition Documentation

◆ PYQITOTAL_MODULE

#define PYQITOTAL_MODULE

to get correct part in pyqitotal.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 ( "_qitotal" )

Debug this module.