casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
casacore::python::numpy Namespace Reference

Classes

struct  array_scalar_from_python
 Struct with static functions to convert a numpy array scalar to the templated type (e.g. More...
 

Functions

bool PycArrayScalarCheck (PyObject *obj, int &type)
 Check if it is an array scalar object. More...
 
DataType PycArrayScalarType (PyObject *obj_ptr)
 Get the data type of the array scalar object. More...
 
ValueHolder makeScalar (PyObject *obj, int type)
 Make a scalar object. More...
 
void register_convert_arrayscalars ()
 Register all array scalar converters. More...
 
template<typename T >
getScalar (const ValueHolder &)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Bool getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Char getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
uChar getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Short getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
uShort getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Int getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
uInt getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Long getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
uLong getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Int64 getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
uInt64 getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Float getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Double getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
Complex getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 
template<>
DComplex getScalar (const ValueHolder &vh)
 Templated helper function to get a value from a ValueHolder. More...
 

Function Documentation

template<typename T >
T casacore::python::numpy::getScalar ( const ValueHolder &  )
inline
template<>
Bool casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 66 of file PycArrayNP.h.

References casacore::ValueHolder::asBool().

template<>
Char casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 68 of file PycArrayNP.h.

References casacore::ValueHolder::asShort().

template<>
uChar casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 70 of file PycArrayNP.h.

References casacore::ValueHolder::asuChar().

template<>
Short casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 72 of file PycArrayNP.h.

References casacore::ValueHolder::asShort().

template<>
uShort casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 74 of file PycArrayNP.h.

References casacore::ValueHolder::asuShort().

template<>
Int casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 76 of file PycArrayNP.h.

References casacore::ValueHolder::asInt().

template<>
uInt casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 78 of file PycArrayNP.h.

References casacore::ValueHolder::asuInt().

template<>
Long casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 80 of file PycArrayNP.h.

References casacore::ValueHolder::asInt().

template<>
uLong casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 82 of file PycArrayNP.h.

References casacore::ValueHolder::asuInt().

template<>
Int64 casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 84 of file PycArrayNP.h.

References casacore::ValueHolder::asInt().

template<>
uInt64 casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 86 of file PycArrayNP.h.

References casacore::ValueHolder::asuInt().

template<>
Float casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 88 of file PycArrayNP.h.

References casacore::ValueHolder::asFloat().

template<>
Double casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 90 of file PycArrayNP.h.

References casacore::ValueHolder::asDouble().

template<>
Complex casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 92 of file PycArrayNP.h.

References casacore::ValueHolder::asComplex().

template<>
DComplex casacore::python::numpy::getScalar ( const ValueHolder &  )
inline

Templated helper function to get a value from a ValueHolder.

Specialize for each type supported.

Definition at line 94 of file PycArrayNP.h.

References casacore::ValueHolder::asDComplex().

ValueHolder casacore::python::numpy::makeScalar ( PyObject *  obj,
int  type 
)
bool casacore::python::numpy::PycArrayScalarCheck ( PyObject *  obj,
int &  type 
)
DataType casacore::python::numpy::PycArrayScalarType ( PyObject *  obj_ptr)

Get the data type of the array scalar object.

It returns TpBool, TpInt, TpFloat, or TpComplex. TpOther is returned if unrecognized.

void casacore::python::numpy::register_convert_arrayscalars ( )

Register all array scalar converters.