diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-10-26 21:13:00 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-10-26 21:13:00 (GMT) |
commit | da2e3d212171bbe64c1af39114fd067308656990 (patch) | |
tree | 9601f7ed15fa1394762124630c12a792bc073ec2 /funtools/doc/twcs.c | |
parent | 76b109ad6d97d19ab835596dc70149ef379f3733 (diff) | |
download | blt-da2e3d212171bbe64c1af39114fd067308656990.zip blt-da2e3d212171bbe64c1af39114fd067308656990.tar.gz blt-da2e3d212171bbe64c1af39114fd067308656990.tar.bz2 |
rm funtools for update
Diffstat (limited to 'funtools/doc/twcs.c')
-rw-r--r-- | funtools/doc/twcs.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/funtools/doc/twcs.c b/funtools/doc/twcs.c deleted file mode 100644 index 2da9319..0000000 --- a/funtools/doc/twcs.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * twcs.c -- example using WCS Library - * - */ - -#include <funtools.h> - -int main(int argc, char **argv) -{ - int i; - Fun fun; - struct WorldCoor *wcs; /* WCS info */ - double x,y,ra,dec,xr,yr; - - if(argc == 1){ - fprintf(stderr, "usage: twcs iname\n"); - exit(1); - } - - /* open Funtools file */ - /* Funopen makes initial WCS library call: wcs = wcsinit(header_string) */ - if( !(fun = FunOpen(argv[1], "r ", NULL)) ){ - fprintf(stderr, "ERROR can't open file: %s\n", argv[1]); - exit(1); - } - - /* get wcs structure */ - FunInfoGet(fun,FUN_WCS,&wcs,0); - if( !wcs || !iswcs(wcs) ){ - fprintf(stderr,"No WCS data"); - return(1); - } - - /* read input, convert pixels to wcs and back */ - while(1){ - fprintf(stdout,"\nInput x y: "); - if(scanf("%lf %lf", &x, &y) != EOF){ - if(x <= -999) - break; - /* convert image pixels to sky coords */ - pix2wcs(wcs, x, y, &ra, &dec); - fprintf(stdout,"Convert from pixels to ra,dec using pix2wcs()\n"); - fprintf(stdout, "x=%.10g y=%.10g -> ra=%.10g dec=%.10g\n", - x, y, ra, dec); - /* convert sky coords to image pixels */ - fprintf(stdout,"Convert from ra,dec -> pixels using wcs2pix()\n"); - wcs2pix(wcs, ra, dec, &xr, &yr, &i); - fprintf(stdout, "ra=%.10g dec=%.10g -> x=%.10g y=%.10g offscale=%d\n", - ra, dec, xr, yr, i); - } - else - break; - } - - /* clean up */ - /* FunClose makes final WCS library call: wcsfree(wcs) */ - FunClose(fun); - return(0); -} - |