RAVE
pypolarnav.c File Reference

Python module for performing basic polar navigation. More...

#include "pyravecompat.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "pypolarnav.h"
#include "pyrave_debug.h"
#include "rave_alloc.h"

Macros

#define PYPOLARNAV_MODULE
 to get correct part of pypolarnav.h
 
#define raiseException_gotoTag(tag, type, msg)
 Sets a python exception and goto tag.
 
#define raiseException_returnNULL(type, msg)
 Sets a python exception and returns NULL.
 

Functions

 PYRAVE_DEBUG_MODULE ("_polarnav")
 Debug this module.
 
 PyDoc_STRVAR (_pypolarnavigator_module_doc, "Routines for navigating in polar space taking into account, earths sphere, radar rays and longitude/latitude.\n" "Another aspect is that it also takes into account the refraction, i.e. dndh.\n\n" "One very commonly used approach is to calculate where on earth you are from a specific lon/lat position, following the radar ray x meters outward and determine height and position\n\n" "The member attributes configurable are:\n" " poleradius - the radius to the poles (in meters).\n" " equatorradius - the radius at the equator (in meters).\n" " lon0 - the origin longitude (in radians)\n" " lat0 - the origin latitude (in radians)\n" " alt0 - the origin altitude (in meters)\n" " dndh - dndh (deflection)\n" "Usage:\n" "import _polarnav, math\n" "nav = _polarnav.new()\n" "nav.lon0 = 14.0*math.pi/180.0\n" "nav.lat0 = 60.0*math.pi/180.0\n" "nav.alt0 = 110.0\n" "(lat,lon) = nav.daToLl(30000.0, 90.0*math.pi/180.0)\n" "print(\"Longitude/latitude 30km east from origin is %f / %f\"%(lat*180.0/math.pi, lon*180.0/math.pi))\n" "# Gives: Lon/lat 30km east of origin is 60.000000/14.540345")
 
 MOD_INIT (_polarnav)
 Initializes polar navigator.
 

Variables

PyTypeObject PyPolarNavigator_Type
 

Detailed Description

Python module for performing basic polar navigation.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2009-10-21

Macro Definition Documentation

◆ PYPOLARNAV_MODULE

#define PYPOLARNAV_MODULE

to get correct part of pypolarnav.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 returns NULL.

Function Documentation

◆ MOD_INIT()

MOD_INIT ( _polarnav )

Initializes polar navigator.

◆ PYRAVE_DEBUG_MODULE()

PYRAVE_DEBUG_MODULE ( "_polarnav" )

Debug this module.

Variable Documentation

◆ PyPolarNavigator_Type

PyTypeObject PyPolarNavigator_Type

Type definitions