#include #include #include "s2plot.h" #include "us2spherical.h" /* Demonstration of the spherical grid functions in us2spherical.c * * Usage: * * Make a local copy of cbuild.csh from the S2PLOT source distribution * * cp ${S2PATH}/scripts/cbuild.csh . * * Make the following edits to cbuild.csh to add us2spherical.c and us2spherical.o * * $S2COMPILER ${S2EXTRAINC} -I${S2PATH}/src $source us2spherical.c * * $S2CLINKER -o $target ${object} us2spherical.o -L${S2PATH}/${S2KERNEL} ${S2LINKS} ${MLLINKS} ${SWLINKS} ${GLLINKS} -L${S2X11PATH}/lib${S2LBITS} ${S2FORMSLINK} -lX11 ${IMATH} -lm ${XLINKPATH} ${S2EXTRALIB} * * % ./cbuild.csh spheredemo * * % spheredemo [N] * where N = 1..7 * * Written by C.Fluke (Swinburne; cfluke@swin.edu.au) * March 2014 */ void RGBtoCI(COLOUR col, int ci) { s2scr(ci, (float)col.r, (float)col.g, (float)col.b); s2sci(ci); } int main(int argc, char *argv[]) { int mode = 0; if (argc == 2) { mode = atoi(argv[1]); } s2opend("/?",argc,argv); s2swin(-1,1,-1,1,-1,1); /* RA must be in decimal hours (0..24), DA must be in decimal degrees (-90..+90) */ int N = 10; float *ra = (float *)calloc(N, sizeof(float)); float *de = (float *)calloc(N, sizeof(float)); float *radius = (float *)calloc(N, sizeof(float)); COLOUR *col = (COLOUR *)calloc(N,sizeof(COLOUR)); int *sym = (int *)calloc(N, sizeof(int)); XYZ xyz; int i; for (i=0;i