Changeset 25027 for branches/pap/extsrc/gpcsw
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 18 edited
- 8 copied
-
. (modified) (1 prop)
-
extsrc/gpcsw (modified) (1 prop)
-
extsrc/gpcsw/Makefile.in (modified) (6 diffs)
-
extsrc/gpcsw/burntool.nopsf/Makefile (modified) (1 diff)
-
extsrc/gpcsw/burntool.nopsf/psfstats.c (modified) (1 diff)
-
extsrc/gpcsw/configure.tcsh (modified) (2 diffs)
-
extsrc/gpcsw/gpcsrc/analysis/libpscoords/man (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/analysis/libpscoords/man )
-
extsrc/gpcsw/gpcsrc/analysis/libpscoords/man/libpscoords.1 (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/analysis/libpscoords/man/libpscoords.1 )
-
extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.c (modified) (8 diffs)
-
extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.h (modified) (6 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/Makefile (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/burntool/burnfix.c (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c (modified) (14 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/burntool.h (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1 (modified) (3 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/psfstamp.c (modified) (8 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/psfstats.c (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/libfh/fh.c (modified) (9 diffs)
-
extsrc/gpcsw/gpcsrc/fits/libfh/fh_table.c (modified) (2 diffs)
-
extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_telescope.h (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak )
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak/Make.Common (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak/Make.Common )
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak/Makefile (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak/Makefile )
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak/linearfit.c (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak/linearfit.c )
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak/sort.c (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak/sort.c )
-
extsrc/gpcsw/gpcsrc/fits/tiltystreak/tiltystreak.c (copied) (copied from trunk/extsrc/gpcsw/gpcsrc/fits/tiltystreak/tiltystreak.c )
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/extsrc/gpcsw
- Property svn:ignore
-
old new 5 5 man 6 6 Makefile 7 Makefile.bak
-
- Property svn:ignore
-
branches/pap/extsrc/gpcsw/Makefile.in
r23926 r25027 2 2 default: all 3 3 4 all: burntool 4 all: burntool tiltystreak 5 5 6 6 install: all … … 24 24 svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/libfhreg gpcsrc/fits/libfhreg.new 25 25 svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/burntool gpcsrc/fits/burntool.new 26 svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/tiltystreak gpcsrc/fits/tiltystreak.new 27 # ensure the target directory exists 28 mkdir -p gpcsrc/analysis/libpscoords 29 mkdir -p gpcsrc/analysis/libpsf 30 mkdir -p gpcsrc/fits/libfh 31 mkdir -p gpcsrc/fits/libfhreg 32 mkdir -p gpcsrc/fits/burntool 33 mkdir -p gpcsrc/fits/tiltystreak 26 34 # replace new files with those from the imported directories 27 35 cp -rf gpcsrc/analysis/libpscoords.new/* gpcsrc/analysis/libpscoords … … 30 38 cp -rf gpcsrc/fits/libfhreg.new/* gpcsrc/fits/libfhreg 31 39 cp -rf gpcsrc/fits/burntool.new/* gpcsrc/fits/burntool 40 cp -rf gpcsrc/fits/tiltystreak.new/* gpcsrc/fits/tiltystreak 32 41 # remove the temp directory 33 42 rm -rf gpcsrc/analysis/libpscoords.new … … 36 45 rm -rf gpcsrc/fits/libfhreg.new 37 46 rm -rf gpcsrc/fits/burntool.new 47 rm -rf gpcsrc/fits/tiltystreak.new 38 48 # modify burntool to avoid libpsf (which requires fortran) 39 49 cp -f burntool.nopsf/Makefile gpcsrc/fits/burntool … … 48 58 ln -sf ../Make.Common gpcsrc/fits/libfhreg/Make.Common 49 59 ln -sf ../Make.Common gpcsrc/fits/burntool/Make.Common 60 ln -sf ../Make.Common gpcsrc/fits/tiltystreak/Make.Common 50 61 51 62 burntool: … … 54 65 cd gpcsrc && make -C analysis/libpscoords install 55 66 cd gpcsrc && make -C fits/burntool install 67 68 tiltystreak: 69 cd gpcsrc && make -C fits/libfh install 70 cd gpcsrc && make -C fits/libfhreg install 71 cd gpcsrc && make -C fits/tiltystreak install -
branches/pap/extsrc/gpcsw/burntool.nopsf/Makefile
r23924 r25027 32 32 pscoords/pscoords.h 33 33 34 $(OBJ)/psfstats.o: psfstats.c burntool.h psf/psf.h34 $(OBJ)/psfstats.o: psfstats.c burntool.h 35 35 36 36 $(OBJ)/sort.o: sort.c -
branches/pap/extsrc/gpcsw/burntool.nopsf/psfstats.c
r23924 r25027 10 10 #include "burntool.h" 11 11 #include "math.h" 12 #include "psf/psf.h"13 12 14 13 /****************************************************************/ 15 14 /* psf_stats(): Tell us about this PSF star */ 16 STATIC int psf_stats(int nx, int ny, IMTYPE *data, int bias, 17 double *fwhm, double *q)15 STATIC int psf_stats(int nx, int ny, IMTYPE *data, int bias, 16 double *fwhm, double *q) 18 17 { 19 18 return(1); -
branches/pap/extsrc/gpcsw/configure.tcsh
r23488 r25027 22 22 23 23 while ("$1" != "") 24 echo "checking $1" 24 25 switch ("$1") 25 26 # switch options passed by build systems which we ignore … … 34 35 case --enable-profile 35 36 case --pedantic 36 shift37 37 breaksw; 38 38 # key/value options passed by build systems which we ignore -
branches/pap/extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.c
r23490 r25027 24 24 rcsid[] = "$Id: pscoords.c,v 1.2 2008/09/06 03:26:48 jt Exp jt $"; 25 25 26 #define MRAD2 (0.001) /* Convert from mrad to rad, used for PSC_OFFROT_T */ 27 26 28 /* Overall focal plane offset and rotation (um, rad) */ 27 constPSC_OFFROT_T psc_psc_fpoff={0.,0.,0.};29 PSC_OFFROT_T psc_psc_fpoff={0.,0.,0.}; 28 30 29 31 /* Offsets and rotations of each OTA (um, millirad) */ 30 const PSC_OFFROT_T psc_otaoff[PSC_NX*PSC_NY]={ /* Offsets and rotations derived o4885 090228 */ 32 PSC_OFFROT_T psc_otaoff[PSC_NX*PSC_NY]={ /* Offsets and rotations derived o4885 090516 */ 33 { 0.0, 0.0, 0.00}, { -6.8, -32.4, -1.30}, /* OTA00 , OTA10 */ 34 { 15.7,-130.7, 0.07}, { -9.4, -43.5, -1.34}, /* OTA20 , OTA30 */ 35 { 17.8, 71.7, -0.48}, { 7.2, 41.3, -0.82}, /* OTA40 , OTA50 */ 36 { 22.1, -48.3, -1.74}, { 0.0, 0.0, 0.00}, /* OTA60 , OTA70 */ 37 { -23.0, -12.9, 0.68}, { -52.0, -52.2, 0.88}, /* OTA01 , OTA11 */ 38 { 28.8, -10.9, -0.73}, { -22.9, 18.1, -0.89}, /* OTA21 , OTA31 */ 39 { -13.8, 45.9, 0.90}, { -12.2, 49.7, -0.32}, /* OTA41 , OTA51 */ 40 { -31.9, -9.8, -1.60}, { 1.9, 8.0, 0.53}, /* OTA61 , OTA71 */ 41 { -27.2, 42.6, 2.73}, { 6.5, -52.6, 0.48}, /* OTA02 , OTA12 */ 42 { 10.1, -37.9, -1.53}, { 3.1,-139.0, 1.75}, /* OTA22 , OTA32 */ 43 { -21.4, 25.6, -1.12}, { -13.8, 0.9, 0.02}, /* OTA42 , OTA52 */ 44 { -1.8, -16.1, -2.06}, { 76.0, 31.7, 1.70}, /* OTA62 , OTA72 */ 45 { -15.7, 24.1, 0.14}, {-104.2, -76.8, 1.97}, /* OTA03 , OTA13 */ 46 { 75.4, 31.8, 1.04}, { -18.7, 14.6, 0.51}, /* OTA23 , OTA33 */ 47 { -30.6, 53.4, -0.78}, { 12.6, 24.4, 0.43}, /* OTA43 , OTA53 */ 48 { 8.0, -34.9, 1.44}, { 6.4, -73.2, -0.93}, /* OTA63 , OTA73 */ 49 { -31.2, 11.2, 0.23}, { -10.3, -2.1, 0.14}, /* OTA04 , OTA14 */ 50 { 33.2, 207.9, -0.40}, { -75.7,-105.9, 0.93}, /* OTA24 , OTA34 */ 51 { 8.1, -15.9, -0.03}, { -16.1, -13.3, -0.06}, /* OTA44 , OTA54 */ 52 { 4.1, 47.6, 1.26}, { 71.6, -6.0, 0.42}, /* OTA64 , OTA74 */ 53 { -23.4, 46.7, 2.65}, { 31.1, 5.5, -0.64}, /* OTA05 , OTA15 */ 54 { -43.2, -6.5, 1.68}, { -26.0, -53.2, 0.00}, /* OTA25 , OTA35 */ 55 { -43.0, 9.1, -0.69}, { 30.1, 69.7, 0.62}, /* OTA45 , OTA55 */ 56 { -48.5, 61.6, -0.51}, { 65.5, -30.1, 0.69}, /* OTA65 , OTA75 */ 57 { 2.5, 57.2, 0.17}, { 0.6, 25.4, -0.91}, /* OTA06 , OTA16 */ 58 { -70.8, -17.4, 1.36}, { 13.6, -24.2, 0.53}, /* OTA26 , OTA36 */ 59 { -6.8, 28.1, -1.35}, { 20.9, 42.0, 0.19}, /* OTA46 , OTA56 */ 60 { 6.2, 13.2, -1.50}, { 36.5, 48.8, -0.36}, /* OTA66 , OTA76 */ 61 { 0.0, 0.0, 0.00}, { 20.4, 1.7, 0.09}, /* OTA07 , OTA17 */ 62 { 83.8, 11.8, -0.56}, { -26.5, -21.2, 0.56}, /* OTA27 , OTA37 */ 63 { -70.5, 7.2, -1.05}, { -41.2, -3.6, -1.89}, /* OTA47 , OTA57 */ 64 { -35.0, 49.5, -0.40}, { 0.0, 0.0, 0.00}}; /* OTA67 , OTA77 */ 65 66 /* Offsets and rotations of each OTA (um, millirad) */ 67 #ifdef RUN_THREE_V1 68 PSC_OFFROT_T psc_otaoff[PSC_NX*PSC_NY]={ /* Offsets and rotations derived o4885 090228 */ 31 69 { 0.0, 0.0, 0.00}, { 20.2, -59.5, -1.23}, /* OTA00 , OTA10 */ 32 70 { 28.1,-138.1, 0.18}, { 2.0, -43.6, -1.22}, /* OTA20 , OTA30 */ … … 61 99 { -74.8, 0.3, -0.92}, { -44.6, -1.6, -1.78}, /* OTA47 , OTA57 */ 62 100 { -50.3, 72.1, -0.47}, { 0.0, 0.0, 0.00}}; /* OTA67 , OTA77 */ 101 #endif 63 102 64 103 #ifdef RUN_TWO … … 136 175 #endif 137 176 138 static int DOOFFSET ; /* Do these offsets or no? */177 static int DOOFFSET=1; /* Do these offsets or no? */ 139 178 140 179 #if 0 … … 143 182 #endif 144 183 145 /* Enable application of chip offsets? */ 184 /* Enable application of chip offsets (um, mrad)? */ 185 int psc_load_otaoff(const char *fname) 186 { 187 int i; 188 char rbuf[1024]; 189 FILE *fp; 190 if( (fp=fopen(fname, "r")) == NULL) { 191 fprintf(stderr, "error: Error opening OTA offset file '%s'\n", fname); 192 return(-1); 193 } 194 for(i=0; i<PSC_NX*PSC_NY; i++) { 195 if(fgets(rbuf, 1024, fp) == NULL || 196 sscanf(rbuf, "%lf %lf %lf", &psc_otaoff[i].dx, 197 &psc_otaoff[i].dy, &psc_otaoff[i].rot) != 3) { 198 fprintf(stderr, "error: Error reading OTA offset file '%s' line %d\n", 199 fname, i); 200 fclose(fp); 201 return(-1); 202 } 203 } 204 fclose(fp); 205 return(0); 206 } 207 208 /* Load up a new offset table? */ 146 209 int psc_do_chipoff(int doit) 147 210 { … … 196 259 /* Position wrt OTA center after correction for offset and rotation */ 197 260 if(DOOFFSET) { 198 x = (xp-psc_otaoff[idx].dx)*cos(psc_otaoff[idx].rot* 0.001) +199 (yp-psc_otaoff[idx].dy)*sin(psc_otaoff[idx].rot* 0.001);200 y = -(xp-psc_otaoff[idx].dx)*sin(psc_otaoff[idx].rot* 0.001) +201 (yp-psc_otaoff[idx].dy)*cos(psc_otaoff[idx].rot* 0.001);261 x = (xp-psc_otaoff[idx].dx)*cos(psc_otaoff[idx].rot*MRAD2) + 262 (yp-psc_otaoff[idx].dy)*sin(psc_otaoff[idx].rot*MRAD2); 263 y = -(xp-psc_otaoff[idx].dx)*sin(psc_otaoff[idx].rot*MRAD2) + 264 (yp-psc_otaoff[idx].dy)*cos(psc_otaoff[idx].rot*MRAD2); 202 265 } else { 203 266 x = xp; … … 228 291 /* Position wrt nominal OTA center after its offset and rotation */ 229 292 if(DOOFFSET) { 230 xp = psc_otaoff[idx].dx + x*cos(psc_otaoff[idx].rot* 0.001) - y*sin(psc_otaoff[idx].rot*0.001);231 yp = psc_otaoff[idx].dy + x*sin(psc_otaoff[idx].rot* 0.001) + y*cos(psc_otaoff[idx].rot*0.001);293 xp = psc_otaoff[idx].dx + x*cos(psc_otaoff[idx].rot*MRAD2) - y*sin(psc_otaoff[idx].rot*MRAD2); 294 yp = psc_otaoff[idx].dy + x*sin(psc_otaoff[idx].rot*MRAD2) + y*cos(psc_otaoff[idx].rot*MRAD2); 232 295 } else { 233 296 xp = x; … … 292 355 293 356 /* Evaluate an optical model: arcsec -> microns notionally */ 357 /* Offset, scale with quadratic and cubic distortion, rotate */ 358 int psc_psoptics2(double x, double y, double dx, double dy, double dpa, 359 double pscale, double d2, double d3, double *xfp, double *yfp) 360 { 361 double w2=((x-dx)*(x-dx)+(y-dy)*(y-dy)), w; 362 w = sqrt(w2); 363 x = pscale * (1.0 + d2*w + d3*w2) * (x-dx); 364 y = pscale * (1.0 + d2*w + d3*w2) * (y-dy); 365 /* Apply any extra TP-FP rotation */ 366 *xfp = x * cos(dpa) + y * sin(dpa); 367 *yfp = -x * sin(dpa) + y * cos(dpa); 368 return(0); 369 } 370 371 /* Evaluate an inverse optical model: microns -> arcsec notionally */ 372 /* Offset, scale with *small* quadratic and cubic distortion, rotate */ 373 int psc_invoptics2(double xfp, double yfp, double dx, double dy, double dpa, 374 double pscale, double d2, double d3, double *x, double *y) 375 { 376 double xp, yp, w; 377 /* Undo any extra TP-FP rotation */ 378 xp = (xfp * cos(dpa) - yfp * sin(dpa)) / pscale; 379 yp = (xfp * sin(dpa) + yfp * cos(dpa)) / pscale; 380 w = sqrt(xp*xp+yp*yp); 381 *x = xp / (1.0 + d2*w + d3*(xp*xp+yp*yp)) + dx; 382 *y = yp / (1.0 + d2*w + d3*(xp*xp+yp*yp)) + dy; 383 return(0); 384 } 385 386 387 /* Evaluate an optical model: arcsec -> microns notionally */ 294 388 /* Offset, scale with distortion, rotate */ 295 389 int psc_psoptics(double x, double y, double dx, double dy, double dpa, … … 318 412 return(0); 319 413 } 320 321 414 322 415 /* Project RA,Dec (a,d) to the tangent plane (x,y) at (a0,d0,pa) [radians] */ -
branches/pap/extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.h
r23924 r25027 2 2 #define NINT(x) (x<0?(int)((x)-0.5):(int)((x)+0.5)) 3 3 4 #define OTA_CTE (5.0e-6) /* Coefficient of thermal expansion of Si+Mo */ 5 #define CFFP_CTE (0.5e-6) /* Coefficient of thermal expansion of CFFP */ 6 #define DELTA_T (-100.0) /* Operating temp minus metrology temp */ 7 8 #define OTA_SCALE (1.0+OTA_CTE*DELTA_T) /* Room temp um to operating um of Si+Mo */ 9 #define CFFP_SCALE ((1.0+CFFP_CTE*DELTA_T)*25400) /* Room temp inches to um on CFFP */ 10 4 11 /* Silicon layout of OTAs (um) */ 5 #define PSC_PIXEL 10.0/* Pixel size of an OTA */6 #define PSC_HCELL 5900.0/* Horizontal cell size */7 #define PSC_VCELL 5980.0/* Vertical cell size */8 #define PSC_HSTREET 120.0/* Horizontal street between cells (HS) */9 #define PSC_VSTREET 180.0/* Vertical street between cells (VS) */10 #define PSC_LBORDER 442.0/* Left border (to left-most cell) (LB) */11 #define PSC_RBORDER 418.0/* Right border (to right-most vertical street) (RB) */12 #define PSC_TBORDER 354.5/* Top border (to top-most cell) (TB) */13 #define PSC_BBORDER 975.5/* Bottom border (to lowest horizontal street) (BB) */14 #define PSC_HDIE 49500.0/* Horizontal size of silicon die */15 #define PSC_VDIE 50130.0/* Vertical size of silicon die */12 #define PSC_PIXEL (10.0*OTA_SCALE) /* Pixel size of an OTA */ 13 #define PSC_HCELL (5900.0*OTA_SCALE) /* Horizontal cell size */ 14 #define PSC_VCELL (5980.0*OTA_SCALE) /* Vertical cell size */ 15 #define PSC_HSTREET (120.0*OTA_SCALE) /* Horizontal street between cells (HS) */ 16 #define PSC_VSTREET (180.0*OTA_SCALE) /* Vertical street between cells (VS) */ 17 #define PSC_LBORDER (442.0*OTA_SCALE) /* Left border (to left-most cell) (LB) */ 18 #define PSC_RBORDER (418.0*OTA_SCALE) /* Right border (to right-most vertical street) (RB) */ 19 #define PSC_TBORDER (354.5*OTA_SCALE) /* Top border (to top-most cell) (TB) */ 20 #define PSC_BBORDER (975.5*OTA_SCALE) /* Bottom border (to lowest horizontal street) (BB) */ 21 #define PSC_HDIE (49500.0*OTA_SCALE) /* Horizontal size of silicon die */ 22 #define PSC_VDIE (50130.0*OTA_SCALE) /* Vertical size of silicon die */ 16 23 17 24 /* Mechanical layout of OTAs (um) */ 18 #define PSC_HMECH (1.957* 25400) /* Horizontal mech spacing of OTA placement */19 #define PSC_VMECH (2.025* 25400) /* Vertical mech spacing of OTA placement */20 #define PSC_VMOFF (PSC_VDIE-(1.568+0.375)* 25400) /* Vert die offset between sides */25 #define PSC_HMECH (1.957*CFFP_SCALE) /* Horizontal mech spacing of OTA placement */ 26 #define PSC_VMECH (2.025*CFFP_SCALE) /* Vertical mech spacing of OTA placement */ 27 #define PSC_VMOFF (PSC_VDIE-(1.568+0.375)*CFFP_SCALE) /* Vert die offset between sides */ 21 28 22 29 #define PSC_REFRACT_CONST 60.0 /* Standard refraction ("/tanz) at STP */ … … 123 130 124 131 /* Overall focal plane offset and rotation (um, rad) */ 125 constPSC_OFFROT_T psc_fpoff;132 PSC_OFFROT_T psc_fpoff; 126 133 127 134 /* Offsets and rotations of each OTA (um, millirad) */ 128 const PSC_OFFROT_T psc_otaoff[PSC_NX*PSC_NY]; 129 135 PSC_OFFROT_T psc_otaoff[PSC_NX*PSC_NY]; 136 137 138 /* This is from Run 3, 090516 */ 139 #define PS_scale 38.7932 /* Default PS plate scale [um/arcsec] */ 140 #define PS_d2 9.78e-7 /* Default quadratic PS distortion [arcsec^-1] */ 141 #define PS_d3 3.16e-11 /* Default cubic PS distortion [arcsec^-2] */ 142 143 144 #ifdef RUN_THREE_V1 /* This is from Run 3, 090228 */ 130 145 #define PS_scale 38.860 /* Default PS plate scale [um/arcsec] */ 131 #define PS_d3 1.49e-10 /* Default PS distortion [arcsec^-2] */ 146 #define PS_d3 1.49e-10 /* Default cubic PS distortion [arcsec^-2] */ 147 #endif 148 149 132 150 #define PS_airdens 0.71 /* Default PS1 qir density (Haleakala) */ 133 151 … … 139 157 * --------------------------------------------------------------------------- 140 158 * psc_tproject(a, d, a0, d0, pa, density, pi/2-alt, vertical, &x, &y); 141 * psc_psoptics (x/sec2rad, y/sec2rad, dx, dy, dpa, pscale, d3, &xfp, &yfp);159 * psc_psoptics2(x/sec2rad, y/sec2rad, dx, dy, dpa, pscale, d2, d3, &xfp, &yfp); 142 160 * psc_fp_to_pixel(xfp, yfp, &ota_xid, &ota_yid, &xota, &yota); 143 161 * psc_pixel_to_cell(xota, yota, &cell_xid, &cell_yid, &xcell, &ycell); 162 * 163 * can also use 164 * psc_psoptics(x/sec2rad, y/sec2rad, dx, dy, dpa, pscale, d3, &xfp, &yfp); 165 * 144 166 * 145 167 * To go from cell coords to a position (a,d) relative to (a0,d0,pa) pointing: … … 147 169 * psc_cell_to_pixel(cell_xid,cell_yid, xcell,ycell, &xota,&yota); 148 170 * psc_pixel_to_fp(ota_xid, ota_yid, xota, yota, &xfp, &yfp); 171 * psc_invoptics2(xfp, yfp, dx, dy, dpa, pscale, d2, d3, &x, &y); 172 * psc_tplonglat(x*sec2rad, y*sec2rad, a0, d0, pa, density, pi/2-alt, vertical, &a, &d); 173 * 174 * can also use 149 175 * psc_invoptics(xfp, yfp, dx, dy, dpa, pscale, d3, &x, &y); 150 * psc_tplonglat(x*sec2rad, y*sec2rad, a0, d0, pa, density, pi/2-alt, vertical, &a, &d);151 176 */ 152 177 … … 155 180 /**************/ 156 181 /* Enable application of chip offsets? */ 157 int psc_do_chipoff(int doit); /* Apply chip offsets? (0/1, default= 0) */182 int psc_do_chipoff(int doit); /* Apply chip offsets? (0/1, default=1) */ 158 183 159 184 /* Convert a focal plane position to OTA otax,otay, Cell cellx,celly, Pixel */ … … 202 227 double pscale/*38.86um/sec*/, double d3/*1.49e-10sec^-2*/, 203 228 double *xfp_um, double *yfp_um); 229 230 /* Evaluate an inverse optical model: microns -> arcsec notionally */ 231 /* Offset, scale with *small* distortion, rotate */ 232 int psc_invoptics2(double xfp_um, double yfp_um, double dx_sec, double dy_sec, double dpa_rad, 233 double pscale/*38.793um/sec*/, 234 double d2/*9.8e-7sec^-2*/, double d3/*3.1e-11sec^-2*/, 235 double *x_sec, double *y_sec); 236 237 /* Evaluate an optical model: arcsec -> microns notionally */ 238 /* Offset, scale with distortion, rotate */ 239 int psc_psoptics2(double x_sec, double y_sec, double dx_sec, double dy_sec, double dpa_rad, 240 double pscale/*38.793um/sec*/, 241 double d2/*9.8e-7sec^-2*/, double d3/*3.1e-11sec^-2*/, 242 double *xfp_um, double *yfp_um); 243 244 /* Enable application of chip offsets (um, mrad)? */ 245 int psc_load_otaoff(const char *fname); -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/Makefile
r23924 r25027 32 32 pscoords/pscoords.h 33 33 34 $(OBJ)/psfstats.o: psfstats.c burntool.h psf/psf.h34 $(OBJ)/psfstats.o: psfstats.c burntool.h 35 35 36 36 $(OBJ)/sort.o: sort.c -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/burnfix.c
r23490 r25027 105 105 if(!cell->persist[k].fiterr) 106 106 sub_fit(nx, ny, NX, buf, &(cell->persist[k]), -1); 107 } 108 return(0); 109 } 110 111 112 /****************************************************************/ 113 /* burn_apply(): Subtract the trail fits from the image */ 114 STATIC int burn_apply(int nx, int ny, int NX, IMTYPE *buf, CELL *cell) 115 { 116 int k; 117 118 /* Restore all the burns */ 119 for(k=0; k<cell->npersist; k++) { 120 if(!cell->persist[k].fiterr) 121 sub_fit(nx, ny, NX, buf, &(cell->persist[k]), +1); 107 122 } 108 123 return(0); -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c
r23924 r25027 33 33 int otanum; 34 34 int nextend, cellxy, cell, cellcode; 35 int ext, update, restore, psfsize, psfavg;35 int ext, update, restore, apply, tableonly, psfsize, psfavg; 36 36 IMTYPE *buf; 37 37 const char *burnfile=NULL, *persistfile=NULL, *persistfitsfile=NULL; … … 102 102 /* Parse the args */ 103 103 cellxy = -1; 104 update = 1; 105 restore = 0; 104 update = 1; /* Calc fits, apply fits, write img and table */ 105 restore = 0; /* Restore previous fit only, write img */ 106 apply = 0; /* Apply previous fit only, write img */ 107 tableonly = 0; /* Calc fits (apply fits), write table only */ 106 108 psfsize = 32; 107 109 psfavg = 0; … … 137 139 update = argv[i][7] == 'y' || argv[i][7] == '1' || argv[i][7] == 't'; 138 140 139 /* Modify the input MEF by subtractingfits? */141 /* Modify the input MEF by adding back fits? */ 140 142 } else if(strncmp(argv[i], "restore=", 8) == 0) { /* restore={t|f} */ 141 143 restore = argv[i][8] == 'y' || argv[i][8] == '1' || argv[i][8] == 't'; 144 145 /* Modify the input MEF by subtracting previously calculated fits? */ 146 } else if(strncmp(argv[i], "apply=", 6) == 0) { /* apply={t|f} */ 147 apply = argv[i][6] == 'y' || argv[i][6] == '1' || argv[i][6] == 't'; 148 149 /* Calculate and write tables only? */ 150 } else if(strncmp(argv[i], "tableonly=", 10) == 0) {/* tableonly={t|f} */ 151 tableonly = argv[i][10] == 'y' || argv[i][10] == '1' || argv[i][10] == 't'; 142 152 143 153 /* Output file for burn streaks */ … … 150 160 151 161 /* Input text file for previous burn persistence streaks */ 152 } else if(strncmp(argv[i], " infits=", 8) == 0) { /*in=fname */162 } else if(strncmp(argv[i], "trailin=", 8) == 0) {/* trailin=fname */ 153 163 persistfile = argv[i] + 8; 154 164 155 165 /* Same thing, but information is stored in tables in a FITS file. */ 156 } else if(strncmp(argv[i], "trailinfits=", 8) == 0) { /*infits=fname */166 } else if(strncmp(argv[i], "trailinfits=", 12) == 0) { /* trailinfits=fname */ 157 167 persistfitsfile = argv[i] + 12; 158 168 … … 162 172 163 173 /* Same thing, but information is stored in tables in a FITS file. */ 164 } else if(strncmp(argv[i], " trailinfits=", 8) == 0) { /* trailin=fname */165 persistfitsfile = argv[i] + 12;174 } else if(strncmp(argv[i], "infits=", 7) == 0) { /* infits=fname */ 175 persistfitsfile = argv[i] + 7; 166 176 167 177 /* Output file for PSF gallery */ … … 322 332 /* If there is no other persistence info supplied, try getting 323 333 * it from the input FITS file. */ 324 if( restore&& persistfile == NULL) {325 if(persistfitsfile == NULL) persistfitsfile = ifilename;334 if((restore || apply) && persistfile == NULL) { 335 if(persistfitsfile == NULL) persistfitsfile = ifilename; 326 336 } 327 337 … … 334 344 335 345 /* Read the persistence data for this OTA */ 336 if(persistfile != NULL) { 346 if(persistfile != NULL) { /* Text data file */ 337 347 if(persist_read(OTA, persistfile)) exit(EXIT_FAILURE); 338 } 339 else if(persistfitsfile != NULL) {340 if(persist_fits_read(OTA, persistfitsfile) != FH_SUCCESS)exit(EXIT_FAILURE);348 } else if(persistfitsfile != NULL) { /* FITS table */ 349 if(persist_fits_read(OTA, persistfitsfile) != FH_SUCCESS) 350 exit(EXIT_FAILURE); 341 351 } 342 352 … … 369 379 "warning: Restoring old burns, but header indicates no burns previously corrected.\n"); 370 380 } 371 else if ( update&& (burn_applied == FH_TRUE)) {381 else if ((update||apply) && (burn_applied == FH_TRUE)) { 372 382 fprintf(stderr, 373 383 "warning: Applying burn correction, but header indicates burns previously corrected.\n"); … … 491 501 492 502 if(VERBOSE & VERB_NORM) { 493 printf("nx=%d ny=%d prex=%d postx=%d posty=%d BZERO=% .1f\n",503 printf("nx=%d ny=%d prex=%d postx=%d posty=%d BZERO=%d\n", 494 504 naxis1, naxis2, prescan1, ovrscan1, ovrscan2, BZERO); 495 505 } … … 542 552 } 543 553 544 545 if(!restore) { 546 554 if(apply) { 555 /* Use the table-driven fits instead of calculating new ones */ 556 burn_apply(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, 557 buf, OTA+cell); 558 /* Tell us about it? */ 559 if(VERBOSE & VERB_NORM) burn_blab(OTA+cell); 560 561 } else if(restore) { 562 /* Restore the old burns */ 563 burn_restore(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, 564 buf, OTA+cell); 565 566 } else { 547 567 /* Fix up the burns */ 548 568 burn_fix(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, naxis2, buf, … … 559 579 if(VERBOSE & VERB_NORM) burn_blab(OTA+cell); 560 580 561 /* Fix up the streaks */562 persist_fix(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, buf,563 OTA+cell);564 581 /* Fix up the streaks (don't bother if table only) */ 582 if(!tableonly) { 583 persist_fix(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, buf, 584 OTA+cell); 565 585 /* Tell us about it? */ 566 if(VERBOSE & VERB_NORM) persist_blab(OTA+cell); 567 568 } else { 569 /* Restore the old burns */ 570 burn_restore(naxis1-ovrscan1, naxis2-ovrscan2, naxis1, 571 buf, OTA+cell); 586 if(VERBOSE & VERB_NORM) persist_blab(OTA+cell); 587 } 572 588 } 573 589 574 590 /* Write the corrected data back to the FITS. */ 575 if( update) {591 if(!tableonly && update) { 576 592 fh_ehu(ehu, 0); /* Seek back to the start of data */ 577 593 if (fh_write_padded_image(ehu, fh_file_desc(ehu), buf, … … 590 606 591 607 /* Dump out the postage stamp file */ 592 if(psffile != NULL ) {608 if(psffile != NULL && !restore && !apply) { 593 609 psf_write(psfsize, psfsize, OTA, otanum, psffile); 594 610 } 595 611 596 612 /* Dump out the PSF stats */ 597 if(psfstatfile != NULL ) {613 if(psfstatfile != NULL && !restore && !apply) { 598 614 psf_write_stats(psfsize, psfsize, OTA, otanum, psfstatfile, psfavg); 599 615 } … … 601 617 /* Write burn info to FITS file. */ 602 618 if(update) persist_fits_write(OTA, ihu); 603 604 619 605 if(restore ) {620 if(restore || tableonly) { 606 621 /* Indicate in the header that the burns are not applied. */ 607 fh_set_bool(ihu, FH_AUTO, PHU_NAME_BURN_APPLIED, 608 FH_FALSE, PHU_COMMENT_BURN_APPLIED); 609 fh_rewrite(ihu); 622 fh_set_bool(ihu, FH_AUTO, PHU_NAME_BURN_APPLIED, 623 FH_FALSE, PHU_COMMENT_BURN_APPLIED); 624 fh_rewrite(ihu); 625 } else if(apply) { 626 /* Indicate in the header that the burns have been applied. */ 627 fh_set_bool(ihu, FH_AUTO, PHU_NAME_BURN_APPLIED, 628 FH_TRUE, PHU_COMMENT_BURN_APPLIED); 629 fh_rewrite(ihu); 610 630 } 611 631 … … 711 731 printf(" cell=N Work on just one cell? Cell count [0:63] mode.\n"); 712 732 printf(" mask=0101... 64 digits to work on cells 0:63.\n"); 713 printf(" update={t|f} Modify the input MEF bysubtracting fits?\n");733 printf(" update={t|f} Modify the input MEF writing table and subtracting fits?\n"); 714 734 printf(" restore={t|f} Restore the input MEF by adding input fits?\n"); 735 printf(" apply={t|f} Modify the input MEF by subtracting previously calculated fits?\n"); 736 printf(" tableonly={t|f} Calculate fits but do *not* modify the input MEF images, only write tables\n"); 715 737 printf(" in=fname Input file for previous burn persistence streaks\n"); 716 738 printf(" infits=fname Input FITS file for previous burn persistence streaks (stored\n"); -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.h
r23924 r25027 173 173 MTYPE *mask, OBJBOX *box); 174 174 STATIC int burn_restore(int nx, int ny, int NX, IMTYPE *buf, CELL *cell); 175 STATIC int burn_apply(int nx, int ny, int NX, IMTYPE *buf, CELL *cell); 175 176 STATIC int persist_read(CELL *cell, const char *infile); 176 177 STATIC int persist_write(CELL *cell, const char *outfile); -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1
r23924 r25027 66 66 inhibited from subtracting the fits by "update=f". 67 67 68 Two other modes can be invoked using "tableonly=t" and "apply=t". 69 The first mode is just like "update=t", except that it does not write 70 the modified images, only the FITS table and/or tabulated fit data. 71 The second mode is like "restore=t", except that it subtracts the 72 tabulated fits instead of adding them back in. Note that this requires 73 slightly different specifications for the "in=" file: 74 75 update or tableonly: in=previous_file_for_persistence 76 restore or apply: in=this_file_for_burn_and_persistence 77 78 Thus a sequence of images could be processed (leaving off usual 79 arguments such as mask=, etc) to immediately fit and subtract: 80 81 burntool o4991g0001o24.fits \ 82 out=o4991g0001o24.burn \ 83 psfstat=o4991g0001o24.stat psf=o4991g0001o24.psf 84 85 burntool o4991g0002o24.fits \ 86 in=o4991g0001o24.burn out=o4991g0002o24.burn \ 87 psfstat=o4991g0002o24.stat psf=o4991g0002o24.psf 88 89 burntool o4991g0003o24.fits \ 90 in=o4991g0002o24.burn out=o4991g0003o24.burn \ 91 psfstat=o4991g0003o24.stat psf=o4991g0003o24.psf 92 93 or as a two step process of generating tables: 94 95 burntool o4991g0001o24.fits tableonly=t \ 96 out=o4991g0001o24.burn \ 97 psfstat=o4991g0001o24.stat psf=o4991g0001o24.psf 98 99 burntool o4991g0002o24.fits tableonly=t \ 100 in=o4991g0001o24.burn out=o4991g0002o24.burn \ 101 psfstat=o4991g0002o24.stat psf=o4991g0002o24.psf 102 103 burntool o4991g0003o24.fits tableonly=t \ 104 in=o4991g0002o24.burn out=o4991g0003o24.burn \ 105 psfstat=o4991g0003o24.stat psf=o4991g0003o24.psf 106 107 and then later on carrying out the subtractions of the fits: 108 109 burntool o4991g0001o24.fits apply=t 110 burntool o4991g0002o24.fits apply=t 111 burntool o4991g0003o24.fits apply=t 112 68 113 The identification of significant (but unsaturated) stars is an 69 114 important component of burntool's mask generation, and if requested 70 115 burntool can assemble a gallery of postage stamps of suitable stars. 116 This does not work with "restore=t" or "apply=t" of course, since 117 these work only on previous tables and do not examine the images. 71 118 72 119 Any star whose maximum exceeds PSF_THRESH above sky but is not deemed … … 125 172 qt=-5.201 Tangential quadrupole [pix^2] (-99.99 if fails) 126 173 q+ * cos(2*phi) + qx * sin(2*phi) 174 q3c=-1.193 Cosine trefoil measure [pix^2] (-99.99 if fails) 175 q3s=-0.038 Sine trefoil measure [pix^2] (-99.99 if fails) 127 176 qpm=5.154 Plus quadrupole averaged over psfavg 128 177 qcm=0.560 Cross quadrupole averaged over psfavg 129 178 qtm=-5.201 Tangential averaged over psfavg 179 q3cm=-1.230 Cosine trefoil averaged over psfavg 180 q3sm=-0.079 Sine trefoil averaged over psfavg 181 182 The net, polar coordinate quadrupole can be assembled from 183 184 Qmagnitude = sqrt(qpm^2+qcm^2) 185 Qtheta = 0.5 * atan2(qcm, qpm) 130 186 131 187 Helpful utilities include: … … 151 207 152 208 update={t|f} 153 Modify the input MEF by subtracting fits (default t)? 209 Calculate fits and modify the input MEF images by subtracting 210 the trail fits and writing a FITS table (default t). If 211 false the MEF is not altered, although PSF can be calculated. 154 212 155 213 restore={t|f} 156 Restore the input MEF by adding input fits (default f)? 214 Restore the input MEF by adding input fits (default f) 215 216 apply={t|f} 217 Use previously calculated fits to modify the input MEF image 218 by subtraction (default f) 219 220 tableonly={t|f} 221 Calculate fits but do *not* modify the input MEF images, 222 only write the fit data as a FITS and/or text table (default f) 157 223 158 224 in=fname -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/psfstamp.c
r23490 r25027 136 136 int i, k, l, nstar, fdout, otacx, otacy, xid, yid, ntot=0, sumax; 137 137 int cellcount, ota_xid, ota_yid; 138 double scale, phi, fwhm[3], q[ 3], qt, xfp, yfp, pi=4*atan(1.0);138 double scale, phi, fwhm[3], q[5], qt, xfp, yfp, pi=4*atan(1.0); 139 139 IMTYPE *median_image; 140 140 CELL *cell; … … 203 203 qt = -q[1] * cos(2*phi) - q[2] * sin(2*phi); 204 204 205 printf("N= %d PSFmaj= %.2f min= %.2f theta= %.1f m2= %.2f q+= %.3f qx= %.3f qt= %.3f\n", 206 nstar, fwhm[0], fwhm[1], fwhm[2]*180/pi, q[0], q[1], q[2], qt); 205 printf("N= %d PSFmaj= %.2f min= %.2f theta= %.1f m2= %.2f q+= %.3f qx= %.3f qt= %.3f q3c= %.3f q3s= %.3f\n", 206 nstar, fwhm[0], fwhm[1], fwhm[2]*180/pi, q[0], q[1], q[2], qt, 207 q[3], q[4]); 207 208 208 209 if(CONCAT_FITS) { … … 258 259 double m2[MAXPSFMEDIAN], qp[MAXPSFMEDIAN], qc[MAXPSFMEDIAN]; 259 260 double qt[MAXPSFMEDIAN], fwavg[MAXPSFMEDIAN]; 261 double q3c[MAXPSFMEDIAN], q3s[MAXPSFMEDIAN]; 260 262 double qpavg[MAXPSFMEDIAN], qcavg[MAXPSFMEDIAN], qtavg[MAXPSFMEDIAN]; 263 double q3cavg[MAXPSFMEDIAN], q3savg[MAXPSFMEDIAN]; 261 264 int nstar[MAXCELL], nfw[MAXCELL]; 262 265 double fwmed[MAXCELL], m2med[MAXCELL]; 263 266 double qpmed[MAXCELL], qcmed[MAXCELL], qtmed[MAXCELL]; 264 double qpmacro, qcmacro, qtmacro, fwmacro; 267 double q3cmed[MAXCELL], q3smed[MAXCELL]; 268 double qpmacro, qcmacro, qtmacro, fwmacro, q3cmacro, q3smacro; 265 269 FILE *fp; 266 270 CELL *cell; … … 304 308 qp[nstar[k]] = q[1]; 305 309 qc[nstar[k]] = q[2]; 310 q3c[nstar[k]] = q[3]; 311 q3s[nstar[k]] = q[4]; 306 312 /* Get the position in the focal plane and therefore the qt statistic */ 307 313 psc_cell_to_pixel(cellx, celly, 0.5*PSC_HCELL/PSC_PIXEL, … … 325 331 qcmed[k] = double_median(nstar[k], qc); 326 332 qtmed[k] = double_median(nstar[k], qt); 333 q3cmed[k] = double_median(nstar[k], q3c); 334 q3smed[k] = double_median(nstar[k], q3s); 327 335 } else { 328 336 m2med[k] = qpmed[k] = qcmed[k] = qtmed[k] = -99.99; 337 q3cmed[k] = q3smed[k] = -99.99; 329 338 } 330 339 /* Toss these results into the macrocell median hopper */ … … 337 346 qcavg[nqavg] = qc[l]; 338 347 qtavg[nqavg] = qt[l]; 348 q3cavg[nqavg] = q3c[l]; 349 q3savg[nqavg] = q3s[l]; 339 350 nqavg++; 340 351 } … … 346 357 qcmacro = double_median(nqavg, qcavg); 347 358 qtmacro = double_median(nqavg, qtavg); 348 if(nqavg == 0) qpmacro = qcmacro = qtmacro = -99.99; 359 q3cmacro = double_median(nqavg, q3cavg); 360 q3smacro = double_median(nqavg, q3savg); 361 if(nqavg == 0) qpmacro = qcmacro = qtmacro = q3cmacro = q3smacro = -99.99; 349 362 fwmacro = double_median(nfwave, fwavg); 350 363 … … 357 370 cell = ota + k; 358 371 359 fprintf(fp, "ext=xy%1d%1d bias=%d sky=%d rmssky=%d npsf=%d fwhm=%.2f fwmed=%.2f m2=%.2f qp=%.3f qc=%.3f qt=%.3f q pm=%.3f qcm=%.3f qtm=%.3f\n",372 fprintf(fp, "ext=xy%1d%1d bias=%d sky=%d rmssky=%d npsf=%d fwhm=%.2f fwmed=%.2f m2=%.2f qp=%.3f qc=%.3f qt=%.3f q3c=%.3f q3s=%.3f qpm=%.3f qcm=%.3f qtm=%.3f q3cm=%.3f q3sm=%.3f\n", 360 373 cellx, celly, cell->bias, cell->sky, cell->rms, 361 374 nstar[k], fwmed[k], fwmacro, m2med[k], 362 qpmed[k], qcmed[k], qtmed[k], 363 qpmacro, qcmacro, qtmacro );375 qpmed[k], qcmed[k], qtmed[k], q3cmed[k], q3smed[k], 376 qpmacro, qcmacro, qtmacro, q3cmacro, q3smacro); 364 377 } 365 378 } -
branches/pap/extsrc/gpcsw/gpcsrc/fits/burntool/psfstats.c
r23924 r25027 10 10 #include "burntool.h" 11 11 #include "math.h" 12 #include "psf/psf.h"13 12 14 13 /****************************************************************/ 15 14 /* psf_stats(): Tell us about this PSF star */ 16 STATIC int psf_stats(int nx, int ny, IMTYPE *data, int bias, 17 double *fwhm, double *q)15 STATIC int psf_stats(int nx, int ny, IMTYPE *data, int bias, 16 double *fwhm, double *q) 18 17 { 19 18 return(1); -
branches/pap/extsrc/gpcsw/gpcsrc/fits/libfh/fh.c
r23490 r25027 200 200 /* Functions that do file operations WITH RETRY: */ 201 201 static int write_file(int fd, const void* buf, int len); 202 static int read_file(int fd, constvoid* buf, int len);202 static int read_file(int fd, void* buf, int len); 203 203 static int seek_file(int fd, off_t off); /* Performs lseek(SEEK_SET) */ 204 204 static int fh_lock_file(HeaderUnit hu, int fd, fh_mode mode); … … 234 234 * this information in debug mode. 235 235 */ 236 const char* fh_rcs_version(void); /* proto to make gcc happy */ 236 237 const char* fh_rcs_version(void) { return rcs_id; } 237 238 … … 274 275 275 276 static void 276 null_log(const char* s) { if (s) ; }277 null_log(const char* s) { if (s) return; } 277 278 /* 278 279 * It's also possible to pass a NULL to fh_log_xxx() and rely only on the … … 309 310 310 311 HeaderUnit 311 fh_create( )312 fh_create(void) 312 313 { 313 314 HeaderUnitStruct* rtn; … … 1941 1942 HeaderUnitStruct* list = FH_HU(hu); 1942 1943 char writebuf[FH_BLOCK_SIZE]; 1943 int i = 0, writelen; 1944 int i = 0; 1945 unsigned int writelen; 1944 1946 int blocks_left; 1945 1947 fh_result result; … … 2446 2448 else /* byte-swapping case requires a temporary buffer */ 2447 2449 { 2448 unsigned char outbuf[32768];2450 unsigned char* outbuf[32768]; 2449 2451 2450 2452 while (bytes_left) … … 2811 2813 while (len) 2812 2814 { 2813 rtn = write(fd, (char*)buf, len); 2815 rtn = write(fd, (const char*)buf, len); 2816 2817 switch (rtn) 2818 { 2819 case -1: if (errno == EINTR || errno == EAGAIN) 2820 continue; /* retry */ 2821 return -1; /* permanent failure */ 2822 case 0: return count; 2823 default: 2824 { 2825 len -= rtn; 2826 count += rtn; 2827 buf = (const char*)buf + rtn; 2828 } 2829 } 2830 } 2831 return count; 2832 } 2833 2834 static int 2835 read_file(int fd, void* buf, int len) 2836 { 2837 int rtn; 2838 int count = 0; 2839 2840 while (len) 2841 { 2842 rtn = read(fd, (char*)buf, len); 2814 2843 2815 2844 switch (rtn) … … 2831 2860 2832 2861 static int 2833 read_file(int fd, const void* buf, int len)2834 {2835 int rtn;2836 int count = 0;2837 2838 while (len)2839 {2840 rtn = read(fd, (char*)buf, len);2841 2842 switch (rtn)2843 {2844 case -1: if (errno == EINTR || errno == EAGAIN)2845 continue; /* retry */2846 return -1; /* permanent failure */2847 case 0: return count;2848 default:2849 {2850 len -= rtn;2851 count += rtn;2852 buf = (char*)buf + rtn;2853 }2854 }2855 }2856 return count;2857 }2858 2859 static int2860 2862 seek_file(int fd, off_t off) 2861 2863 { … … 2969 2971 fh_compare(const void* a, const void* b) 2970 2972 { 2971 double diff = (*((FitsCard* *)a))->idx - (*((FitsCard**)b))->idx;2973 double diff = (*((FitsCard* const*)a))->idx - (*((FitsCard* const*)b))->idx; 2972 2974 2973 2975 if (diff < 0) return -1; -
branches/pap/extsrc/gpcsw/gpcsrc/fits/libfh/fh_table.c
r23924 r25027 180 180 181 181 /* Write the format specifiers for each column. */ 182 for(i=0; i < table->num_cols; i++) 183 { 182 for (i=0; i < table->num_cols; i++) 183 { 184 int n; 185 184 186 idx = 5.0 + i/10.; 185 intn = i + 1; /* FITS numbering scheme starts from 1. */187 n = i + 1; /* FITS numbering scheme starts from 1. */ 186 188 snprintf(keyword, FH_NAME_SIZE + 1, "TFORM%d", n); 187 189 if((table->cols[i].format == FH_TABLE_FORMAT_FLOAT) || … … 214 216 * nice to have from a self-documenting perspective, isn't strictly 215 217 * necessary to interpret the actual table values. */ 216 for(i=0; i < table->num_cols; i++) 217 { 218 for (i=0; i < table->num_cols; i++) 219 { 220 int n; 221 218 222 idx = 7.0 + i/10.; 219 intn = i + 1; /* FITS numbering scheme starts from 1. */223 n = i + 1; /* FITS numbering scheme starts from 1. */ 220 224 snprintf(keyword, FH_NAME_SIZE + 1, "TTYPE%d", n); 221 225 fh_set_str(hu, idx, keyword, table->cols[i].name, -
branches/pap/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_telescope.h
r23924 r25027 89 89 MK_PFL( 523.3, COMALT ,6, "Commanded telescope pointing altitude (degrees)" ) 90 90 MK_PFL( 523.4, COMROT ,6, "Commanded telescope rotator angle (degrees)" ) 91 MK_PFL( 523.5, MOONANG ,6, "Angular distance to moon (degrees)" ) 91 92 MK_CMT( 530.00,CMTTELO1, "NOTE: Telescope RA DEC or ALT AZ already include") 92 93 MK_CMT( 530.10,CMTTELO2, " the following offsets. Do not re-apply!" )
Note:
See TracChangeset
for help on using the changeset viewer.
