[Kst] extragear/graphics/kst/kst/datasources/healpix
Ted Kisner
tskisner.public at gmail.com
Sun Oct 9 17:39:30 CEST 2005
SVN commit 468902 by tskisner:
additional small healpix changes. fix derivative works statement.
M +25 -9 healpix.cpp
M +6 -2 healpix_source.h
M +9 -1 healpix_tools_pix.cpp
--- trunk/extragear/graphics/kst/kst/datasources/healpix/healpix.cpp #468901:468902
@@ -49,10 +49,15 @@
_projNX = 640;
_projNY = 480;
_projType = HEALPIX_PROJ_SIN;
- _projPhiMin = 0.69;
- _projThetaMin = 2.05;
- _projPhiMax = 2.1;
- _projThetaMax = 2.65;
+ //_projPhiMin = 0.69;
+ //_projThetaMin = 2.05;
+ //_projPhiMax = 2.1;
+ //_projThetaMax = 2.65;
+ _projPhiMin = 0.01;
+ _projThetaMin = 0.0;
+ _projPhiMax = 2*HEALPIX_PI;
+ _projThetaMax = HEALPIX_PI;
+ _projUnits = 0;
// populate the metadata
QString metaVal;
@@ -159,9 +164,9 @@
int HealpixSource::readField(double *v, const QString& field, int s, int n) {
-
+ Q_UNUSED(s)
if (_valid && _fieldList.contains(field)) {
- int fieldnum = _fieldList.findIndex(field);
+ //int fieldnum = _fieldList.findIndex(field);
for (int i = 0; i < n; i++) {
v[i] = 0.0;
@@ -293,14 +298,25 @@
// Project sphere data onto matrix, given the projection
// parameters.
+ data->xMin = _projPhiMin;
+ data->yMin = _projThetaMax;
+
+ if (_projUnits == 0) { // radians
+ data->yStepSize = (_projThetaMax - _projThetaMin)/(double)_projNY;
+ }
data->xStepSize = 1.0;
- data->yStepSize = 1.0;
- data->xMin = (double)xStart;
- data->yMin = (double)yStart;
+
+
+
double theta, phi;
size_t ppix;
+ // set the matrix to NULL
+ for (int i = 0; i < nxread*nyread; i++) {
+ data->z[i] = HEALPIX_NULL;
+ }
+
if (_projType == HEALPIX_PROJ_CAR) {
for (int i = xStart; i < nxread; i++) {
for (int j = yStart; j < nyread; j++) {
--- trunk/extragear/graphics/kst/kst/datasources/healpix/healpix_source.h #468901:468902
@@ -72,8 +72,12 @@
double _projPhiMin;
double _projThetaMax;
double _projPhiMax;
- int _projTunits;
- int _projPunits;
+ // Units choices are:
+ // 0 : (theta, phi) in Radians
+ // 1 : (theta, phi) in Degrees
+ // 2 : (lat, long) in Degrees
+ // 3 : (RA, DEC) in Degrees
+ int _projUnits;
/* grid lines */
double _gridXspace;
--- trunk/extragear/graphics/kst/kst/datasources/healpix/healpix_tools_pix.cpp #468901:468902
@@ -14,8 +14,16 @@
* (at your option) any later version. *
* *
***************************************************************************/
+
+/***************************************************************************
+ * Some of these pixel tools are based on code from Healpix_cxx 2.00. *
+ * See http://sourceforge.net/projects/healpix/ for the original code *
+ * *
+ * Healpix 2.00 is copyright 2005 by E. Hivon, M. Reinecke, W. O'Mullane, *
+ * H.K. Eriksen, K.M. Gorski, A.J. Banday *
+ ***************************************************************************/
+
-
#include "healpix_tools.h"
#include <qmutex.h>
#include <ksdebug.h>
More information about the Kst
mailing list