Changeset 16983
- Timestamp:
- Mar 13, 2008, 11:51:41 AM (18 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 7 edited
-
include/addstar.h (modified) (1 diff)
-
src/ReadImageHeader.c (modified) (2 diffs)
-
src/addstar.c (modified) (1 diff)
-
src/addstarc.c (modified) (2 diffs)
-
src/args.c (modified) (2 diffs)
-
src/args_client.c (modified) (2 diffs)
-
src/fakeimage.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/addstar.h
r16973 r16983 105 105 double Latitude; // carried into image structure from config 106 106 double Longitude; // carried into image structure from config 107 Coords *MOSAIC; // carries the mosaic into gstars108 107 double FAKE_RA; // boresite coords for fake images 109 108 double FAKE_DEC; // boresite coords for fake images 110 109 double FAKE_THETA; // boresite angle for fake images 110 111 // carries the mosaic into gstars 111 112 112 113 /* these globals are used separately by both client and server (KEEP) */ -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r16810 r16983 33 33 /* only load astrometry, NAXIS1,2, and time if this is a MOSAIC_PHU (ctype is ....-DIS) */ 34 34 if (!strcmp (&image[0].coords.ctype[4], "-DIS")) { 35 MOSAIC = &image[0].coords;35 RegisterMosaic (&image[0].coords); 36 36 return (TRUE); 37 37 } … … 47 47 } 48 48 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 49 if ( MOSAIC == NULL) {49 if (!isRegisteredMosaic()) { 50 50 fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n"); 51 51 return (FALSE); 52 52 } 53 RegisterMosaic (MOSAIC);54 53 } else { 55 54 /* force image to lie in 0-360 range */ -
trunk/Ohana/src/addstar/src/addstar.c
r16810 r16983 61 61 case M_FAKEIMAGE: 62 62 images = fakeimage (argv[1], &Nimages, options.photcode); 63 RegisterMosaic (MOSAIC);64 63 ALLOCATE (skylist, SkyList, 1); 65 64 skylist[0].Nregions = 0; -
trunk/Ohana/src/addstar/src/addstarc.c
r16810 r16983 8 8 Stars *stars; 9 9 Image *images; 10 Coords MOSAIC; 10 11 11 12 /* load config and options */ … … 31 32 Send_Image (BindSocket, images, Nimages, FALSE); 32 33 if (options.mosaic) { 33 Send_Coords (BindSocket, MOSAIC, 1, FALSE); 34 GetRegisteredMosaic (&MOSAIC); 35 Send_Coords (BindSocket, &MOSAIC, 1, FALSE); 34 36 } 35 37 Send_Stars (BindSocket, stars, Nstars, FALSE); -
trunk/Ohana/src/addstar/src/args.c
r16973 r16983 112 112 } 113 113 /* provide a mosaic for distortion */ 114 MOSAIC = NULL;115 114 options.mosaic = FALSE; 116 115 if ((N = get_argument (argc, argv, "-mosaic"))) { 117 116 Header header; 118 ALLOCATE (MOSAIC, Coords, 1);117 Coords MOSAIC; 119 118 120 119 remove_argument (N, &argc, argv); … … 123 122 exit (1); 124 123 } 125 if (!GetCoords ( MOSAIC, &header)) {124 if (!GetCoords (&MOSAIC, &header)) { 126 125 fprintf (stderr, "ERROR: no astrometric solution in header\n"); 127 126 exit (1); 128 127 } 129 if (strcmp(&MOSAIC [0].ctype[4], "-DIS")) {128 if (strcmp(&MOSAIC.ctype[4], "-DIS")) { 130 129 fprintf (stderr, "ERROR: not a mosaic distortion header\n"); 131 130 exit (1); 132 131 } 132 RegisterMosaic (&MOSAIC); 133 133 remove_argument (N, &argc, argv); 134 134 gfits_free_header (&header); -
trunk/Ohana/src/addstar/src/args_client.c
r14590 r16983 62 62 } 63 63 /* provide a mosaic for distortion */ 64 MOSAIC = NULL;65 64 options.mosaic = FALSE; 66 65 if ((N = get_argument (argc, argv, "-mosaic"))) { 67 66 Header header; 68 ALLOCATE (MOSAIC, Coords, 1);67 Coords MOSAIC; 69 68 70 69 remove_argument (N, &argc, argv); … … 73 72 exit (1); 74 73 } 75 if (!GetCoords ( MOSAIC, &header)) {74 if (!GetCoords (&MOSAIC, &header)) { 76 75 fprintf (stderr, "ERROR: no astrometric solution in header\n"); 77 76 exit (1); 78 77 } 79 if (strcmp(&MOSAIC [0].ctype[4], "-DIS")) {78 if (strcmp(&MOSAIC.ctype[4], "-DIS")) { 80 79 fprintf (stderr, "ERROR: not a mosaic distortion header\n"); 81 80 exit (1); 82 81 } 82 RegisterMosaic (&MOSAIC); 83 83 remove_argument (N, &argc, argv); 84 84 gfits_free_header (&header); -
trunk/Ohana/src/addstar/src/fakeimage.c
r16810 r16983 12 12 Image *image; 13 13 e_time MosaicTime; 14 Coords MOSAIC; 14 15 15 16 /* this is a somewhat bogus method to set a time for the exposure */ … … 33 34 34 35 /* create a mosaic distortion structure */ 35 ALLOCATE (MOSAIC, Coords, 1); 36 strcpy (MOSAIC[0].ctype, "RA---DIS"); 37 MOSAIC[0].crval1 = FAKE_RA; 38 MOSAIC[0].crval2 = FAKE_DEC; 36 strcpy (MOSAIC.ctype, "RA---DIS"); 37 MOSAIC.crval1 = FAKE_RA; 38 MOSAIC.crval2 = FAKE_DEC; 39 39 40 MOSAIC [0].crpix1 = MOSAIC[0].crpix2 = 0.0;40 MOSAIC.crpix1 = MOSAIC.crpix2 = 0.0; 41 41 42 42 /* mosaic 'pixels' are millimeters */ 43 43 ScanConfig (config, "PLATE_SCALE", "%lf", 0, &pltscale); 44 MOSAIC [0].cdelt1 = MOSAIC[0].cdelt2 = pltscale / 3600.0;44 MOSAIC.cdelt1 = MOSAIC.cdelt2 = pltscale / 3600.0; 45 45 46 MOSAIC [0].pc1_1 = cos(FAKE_THETA*RAD_DEG);47 MOSAIC [0].pc1_2 = -sin(FAKE_THETA*RAD_DEG);48 MOSAIC [0].pc2_1 = sin(FAKE_THETA*RAD_DEG);49 MOSAIC [0].pc2_2 = cos(FAKE_THETA*RAD_DEG);46 MOSAIC.pc1_1 = cos(FAKE_THETA*RAD_DEG); 47 MOSAIC.pc1_2 = -sin(FAKE_THETA*RAD_DEG); 48 MOSAIC.pc2_1 = sin(FAKE_THETA*RAD_DEG); 49 MOSAIC.pc2_2 = cos(FAKE_THETA*RAD_DEG); 50 50 51 MOSAIC [0].Npolyterms = 3;51 MOSAIC.Npolyterms = 3; 52 52 for (i = 0; i < 7; i++) { 53 MOSAIC [0].polyterms[i][0] = 0;54 MOSAIC [0].polyterms[i][1] = 0;53 MOSAIC.polyterms[i][0] = 0; 54 MOSAIC.polyterms[i][1] = 0; 55 55 } 56 56 ScanConfig (config, "DPLATE_X", "%lf", 0, &pltscale); 57 MOSAIC [0].polyterms[3][0] = pltscale; // L : X^3 Y^058 MOSAIC [0].polyterms[5][0] = pltscale; // L : X^1 Y^257 MOSAIC.polyterms[3][0] = pltscale; // L : X^3 Y^0 58 MOSAIC.polyterms[5][0] = pltscale; // L : X^1 Y^2 59 59 ScanConfig (config, "DPLATE_Y", "%lf", 0, &pltscale); 60 MOSAIC[0].polyterms[4][1] = pltscale; // M : X^0 Y^0 61 MOSAIC[0].polyterms[6][1] = pltscale; // M : X^2 Y^0 60 MOSAIC.polyterms[4][1] = pltscale; // M : X^0 Y^0 61 MOSAIC.polyterms[6][1] = pltscale; // M : X^2 Y^0 62 63 RegisterMosaic (&MOSAIC); 62 64 63 65 /* some basic data about the chisp */ … … 160 162 strcpy (image[0].name, rootname); 161 163 162 image[0].coords = MOSAIC [0];163 strcpy (image[0].coords.ctype, MOSAIC [0].ctype);164 image[0].coords = MOSAIC; 165 strcpy (image[0].coords.ctype, MOSAIC.ctype); 164 166 165 167 image[0].sidtime = 0.0;
Note:
See TracChangeset
for help on using the changeset viewer.
