static VALUE radrec(VALUE self, VALUE range, VALUE right_ascension, VALUE declination) { double vector[3]; radrec_c(NUM2DBL(range), NUM2DBL(right_ascension), NUM2DBL(declination), vector); return rb_nmatrix_dense_create(FLOAT64, (size_t *) VECTOR_SHAPE, 2, (void *) vector, 3); }
int main (int argc, char **argv) { SpiceInt i, nres; SPICEDOUBLE_CELL(cnfine,2); SPICEDOUBLE_CELL(result,2*MAXWIN); SpiceDouble beg,end; furnsh_c("/home/barrycarter/BCGIT/ASTRO/standard.tm"); // this will represent the stars position planets[0] = -1; // convert ra and dec to starpos radrec_c(1,atof(argv[1]),atof(argv[2]),starpos); // planets array and count for (i=1; i<argc-2; i++) {planets[i] = atoi(argv[i+2]);} planetcount = argc-2; printf("CONJUNCTIONS FOR %f degrees, planets: %s %s %d %d %d %d %d %d\n",r2d(MAXSEP),argv[1],argv[2],(int)planets[1],(int)planets[2],(int)planets[3],(int)planets[4],(int)planets[5],(int)planets[6]); // TODO: this is for testing only // wninsd_c(unix2et(0),unix2et(2147483647),&cnfine); wninsd_c (-479695089600.+86400*468, 479386728000., &cnfine); // 1 second tolerance (serious overkill, but 1e-6 is default, worse!) gfstol_c(1.); // find under MAXSEP degrees... // TODO: The 90 days below is just for testing, not accurate!!!! gfuds_c(gfq,gfdecrx,"<",MAXSEP,0.,86400.*90,MAXWIN,&cnfine,&result); nres = wncard_c(&result); for (i=0; i<nres; i++) { wnfetd_c(&result,i,&beg,&end); // R = range, M = min printf("R %f %f\n",et2jd(beg),et2jd(end)); findmins(beg,end); } // printf("There are %d results\n",wncard_c(&result)); return 0; }