#include "arr_desc.h" // Numpy data type holding a cluster PyArray_Descr* cluster_dt(){ import_array(); PyObject *dict; PyArray_Descr *dtype = NULL; dict = Py_BuildValue("[(s, s),(s, s),(s, s, (i))]", "x", "u2", "y", "u2", "data", "i4", 9); PyArray_DescrConverter(dict, &dtype); Py_DECREF(dict); return dtype; } // Numpy data type holding the result of a cluster analysis PyArray_Descr *cluster_analysis_dt() { import_array(); //TODO! Correct placement for this? PyObject *dict; PyArray_Descr *dtype; dict = Py_BuildValue("[(s, s),(s, s),(s, s)]", "tot3", "i4", "tot2", "i4", "corner", "u4"); PyArray_DescrConverter(dict, &dtype); Py_DECREF(dict); return dtype; }