Changeset 27435 for trunk/Ohana/src/opihi/cmd.data
- Timestamp:
- Mar 24, 2010, 11:22:25 AM (16 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 17 edited
-
. (modified) (1 prop)
-
src/opihi/cmd.data/dbconnect.c (modified) (4 diffs)
-
src/opihi/cmd.data/extract.c (modified) (1 diff)
-
src/opihi/cmd.data/keyword.c (modified) (2 diffs)
-
src/opihi/cmd.data/list_header.c (modified) (1 diff)
-
src/opihi/cmd.data/matrix.c (modified) (1 diff)
-
src/opihi/cmd.data/rd.c (modified) (2 diffs)
-
src/opihi/cmd.data/rdseg.c (modified) (1 diff)
-
src/opihi/cmd.data/read_vectors.c (modified) (6 diffs)
-
src/opihi/cmd.data/rebin.c (modified) (1 diff)
-
src/opihi/cmd.data/relocate.c (modified) (1 diff)
-
src/opihi/cmd.data/rotate.c (modified) (6 diffs)
-
src/opihi/cmd.data/test/dimendown.sh (modified) (2 diffs)
-
src/opihi/cmd.data/test/integrate.sh (modified) (1 diff)
-
src/opihi/cmd.data/test/interpolate.sh (modified) (1 diff)
-
src/opihi/cmd.data/test/periodogram.sh (modified) (1 diff)
-
src/opihi/cmd.data/wd.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/opihi/cmd.data/dbconnect.c
r14590 r27435 47 47 gprint (GP_ERR, "failed to set interactive timout\n"); 48 48 gprint (GP_ERR, "%s\n", mysql_error (connection)); 49 free (query);50 49 return (FALSE); 51 50 } … … 57 56 gprint (GP_ERR, "failed to set wait timout\n"); 58 57 gprint (GP_ERR, "%s\n", mysql_error (connection)); 59 free (query);60 58 return (FALSE); 61 59 } … … 71 69 gprint (GP_ERR, "failed to get timout\n"); 72 70 gprint (GP_ERR, "%s\n", mysql_error (connection)); 73 free (query);74 71 return (FALSE); 75 72 } … … 84 81 gprint (GP_ERR, "failed to get timout\n"); 85 82 gprint (GP_ERR, "%s\n", mysql_error (connection)); 86 free (query);87 83 return (FALSE); 88 84 } -
trunk/Ohana/src/opihi/cmd.data/extract.c
r26884 r27435 70 70 if ((out[0].header.Naxis[1] != Ny) || (out[0].header.Naxis[0] != Nx)) { 71 71 gprint (GP_ERR, "matrix sizes mis-matched\n"); 72 gprint (GP_ERR, "%d x %d vs % d x %d\n", Nx, Ny,73 out[0].header.Naxis[0],out[0].header.Naxis[1]);72 gprint (GP_ERR, "%d x %d vs %lld x %lld\n", Nx, Ny, 73 (long long) out[0].header.Naxis[0], (long long) out[0].header.Naxis[1]); 74 74 return (FALSE); 75 75 } -
trunk/Ohana/src/opihi/cmd.data/keyword.c
r7917 r27435 107 107 } 108 108 ivalue = !strcasecmp (line, "T"); 109 gfits_modify (&buf[0].header, argv[2], "%t", 1, ivalue);109 gfits_modify_alt (&buf[0].header, argv[2], "%t", 1, ivalue); 110 110 return (TRUE); 111 111 case KEYCOMMENT: 112 gfits_modify (&buf[0].header, argv[2], "%C", 1, line);112 gfits_modify_alt (&buf[0].header, argv[2], "%C", 1, line); 113 113 return (TRUE); 114 114 case COMMENT: 115 gfits_modify (&buf[0].header, argv[2], "%S", 0, line);115 gfits_modify_alt (&buf[0].header, argv[2], "%S", 0, line); 116 116 return (TRUE); 117 117 } … … 135 135 136 136 if (ascomment) { 137 status = gfits_scan (&buf[0].header, argv[2], "%C", 1, line);137 status = gfits_scan_alt (&buf[0].header, argv[2], "%C", 1, line); 138 138 if (!status) goto failure; 139 139 if (argc == 4) -
trunk/Ohana/src/opihi/cmd.data/list_header.c
r7917 r27435 49 49 gfits_modify (&buf[0].header, "BSCALE", "%lf", 1, bscale); 50 50 gfits_modify (&buf[0].header, "BZERO", "%lf", 1, bzero); 51 gfits_modify (&buf[0].header, "UNSIGN", "%t", 1, unsign);51 gfits_modify_alt (&buf[0].header, "UNSIGN", "%t", 1, unsign); 52 52 53 53 } else { -
trunk/Ohana/src/opihi/cmd.data/matrix.c
r26891 r27435 23 23 24 24 if (bufB[0].matrix.Naxis[0] != bufC[0].matrix.Naxis[1]) { 25 gprint (GP_ERR, "size mis-match in matrices: (% d x %d) * (%d x %d)\n",26 bufB[0].matrix.Naxis[0],bufB[0].matrix.Naxis[1],27 bufC[0].matrix.Naxis[0],bufC[0].matrix.Naxis[1]);25 gprint (GP_ERR, "size mis-match in matrices: (%lld x %lld) * (%lld x %lld)\n", 26 (long long) bufB[0].matrix.Naxis[0], (long long) bufB[0].matrix.Naxis[1], 27 (long long) bufC[0].matrix.Naxis[0], (long long) bufC[0].matrix.Naxis[1]); 28 28 return (FALSE); 29 29 } -
trunk/Ohana/src/opihi/cmd.data/rd.c
r20652 r27435 153 153 buf[0].header.Naxes = 0; 154 154 ALLOCATE (buf[0].matrix.buffer, char, 1); 155 buf[0].matrix. size = 0;155 buf[0].matrix.datasize = 0; 156 156 buf[0].bitpix = 16; 157 157 buf[0].bzero = 0; … … 222 222 buf[0].unsign = buf[0].header.unsign; 223 223 224 gprint (GP_LOG, "read % d bytes from %s into buffer %s\n",225 buf[0].header.size + buf[0].matrix.size, argv[2], argv[1]);224 gprint (GP_LOG, "read %lld bytes from %s into buffer %s\n", 225 (long long) buf[0].header.datasize + buf[0].matrix.datasize, argv[2], argv[1]); 226 226 227 227 blank = 0xffff; -
trunk/Ohana/src/opihi/cmd.data/rdseg.c
r20652 r27435 62 62 buf[0].bzero = buf[0].header.bzero; /* store the original values */ 63 63 buf[0].unsign = buf[0].header.unsign; 64 gprint (GP_LOG, "read %d bytes from %s into buffer %s\n", 65 buf[0].header.size + buf[0].matrix.size, argv[2], argv[1]); 64 gprint (GP_LOG, "read %lld bytes from %s into buffer %s\n", (long long) buf[0].header.datasize + buf[0].matrix.datasize, argv[2], argv[1]); 66 65 67 66 gfits_scan (&buf[0].header, "BLANK", "%d", 1, &blank); -
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r20936 r27435 57 57 return (FALSE); 58 58 } 59 fseek (f, 0, SEEK_SET);59 fseeko (f, 0LL, SEEK_SET); 60 60 61 61 Nvec = (argc - 1) / 2; … … 159 159 int read_table_vectors (int argc, char **argv, char *extname) { 160 160 161 int i, j, k, N, Nbytes, Nextend, Ny, Binary, vecType; 161 off_t Nbytes; 162 int i, j, k, N, Nextend, Ny, Binary, vecType; 162 163 char type[16], ID[80], *CCDKeyword; 163 164 FTable table; … … 184 185 185 186 if (f == NULL) ESCAPE ("file not found"); 186 fseek (f, 0, SEEK_SET);187 fseeko (f, 0LL, SEEK_SET); 187 188 table.header = &header; 188 189 … … 193 194 if (!gfits_load_header (f, &header)) ESCAPE ("error reading primary header for file"); 194 195 Nbytes = gfits_data_size (&header); 195 fseek (f, Nbytes, SEEK_CUR);196 fseeko (f, Nbytes, SEEK_CUR); 196 197 gfits_free_header (&header); 197 198 … … 200 201 Nbytes = gfits_data_size (&header); 201 202 /* skip the prior data buffers */ 202 fseek (f, Nbytes, SEEK_CUR);203 fseeko (f, Nbytes, SEEK_CUR); 203 204 gfits_free_header (&header); 204 205 } … … 215 216 216 217 while (1) { 217 if (!gfits_load_header (f, &header)) ESCAPE ("extensio not found in file");218 if (!gfits_load_header (f, &header)) ESCAPE ("extension not found in file"); 218 219 Nbytes = gfits_data_size (&header); 219 220 220 221 if (!gfits_scan (&header, CCDKeyword, "%s", 1, ID)) { 221 fseek (f, Nbytes, SEEK_CUR);222 fseeko (f, Nbytes, SEEK_CUR); 222 223 gfits_free_header (&header); 223 224 continue; 224 225 } 225 226 if (strcmp (ID, extname)) { 226 fseek (f, Nbytes, SEEK_CUR);227 fseeko (f, Nbytes, SEEK_CUR); 227 228 gfits_free_header (&header); 228 229 continue; -
trunk/Ohana/src/opihi/cmd.data/rebin.c
r21064 r27435 63 63 } 64 64 } 65 if (VERBOSE) gprint (GP_LOG, "rebin %s to %s (% d,%d to %d,%d)\n", argv[1], argv[2], in[0].header.Naxis[0],in[0].header.Naxis[1], nx, ny);65 if (VERBOSE) gprint (GP_LOG, "rebin %s to %s (%lld,%lld to %d,%d)\n", argv[1], argv[2], (long long) in[0].header.Naxis[0], (long long) in[0].header.Naxis[1], nx, ny); 66 66 67 67 Nx = in[0].header.Naxis[0]; -
trunk/Ohana/src/opihi/cmd.data/relocate.c
r25757 r27435 3 3 int relocate (int argc, char **argv) { 4 4 5 char *end;6 5 int x, y; 7 6 int N, kapa; -
trunk/Ohana/src/opihi/cmd.data/rotate.c
r25584 r27435 43 43 gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, NY); 44 44 gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, NX); 45 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");45 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 46 46 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 47 47 out_buff = (float *)buf[0].matrix.buffer; … … 82 82 gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, NY); 83 83 gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, NX); 84 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");84 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 85 85 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 86 86 out_buff = (float *)buf[0].matrix.buffer; … … 120 120 121 121 if (!strcasecmp (argv[2], "UPSIDE") || (atof (argv[2]) == -180) || (atof (argv[2]) == 180)) { 122 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");122 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 123 123 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 124 124 out_buff = (float *)buf[0].matrix.buffer; … … 155 155 156 156 if (!strcasecmp (argv[2], "FLIPY")) { 157 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");157 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 158 158 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 159 159 out_buff = (float *)buf[0].matrix.buffer; … … 190 190 191 191 if (!strcasecmp (argv[2], "FLIPX")) { 192 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");192 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 193 193 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 194 194 out_buff = (float *)buf[0].matrix.buffer; … … 272 272 gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, Ly); 273 273 gfits_create_matrix (&buf[0].header, &buf[0].matrix); 274 gfits_print (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");274 gfits_print_alt (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!"); 275 275 out_buff = (float *)buf[0].matrix.buffer; 276 276 for (j = 0; j < Ly; j++) { -
trunk/Ohana/src/opihi/cmd.data/test/dimendown.sh
r16056 r27435 42 42 $startmem = $word:1 43 43 44 for i 0 1000 44 for i 0 10000 45 45 dimendown timg val 46 46 dimendown timg xc -x … … 53 53 $PASS = 1 54 54 55 if ($endmem - $startmem > 1 0)55 if ($endmem - $startmem > 128) 56 56 $PASS = 0 57 57 echo "growth: {$endmem-$startmem}" -
trunk/Ohana/src/opihi/cmd.data/test/integrate.sh
r16056 r27435 40 40 $PASS = 1 41 41 42 if ($endmem - $startmem > 1 0)42 if ($endmem - $startmem > 128) 43 43 $PASS = 0 44 44 echo "growth: {$endmem-$startmem}" -
trunk/Ohana/src/opihi/cmd.data/test/interpolate.sh
r16056 r27435 41 41 $PASS = 1 42 42 43 if ($endmem - $startmem > 1 0)43 if ($endmem - $startmem > 128) 44 44 $PASS = 0 45 45 echo "growth: {$endmem-$startmem}" -
trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh
r16465 r27435 136 136 $PASS = 1 137 137 138 if ($endmem - $startmem > 1 0)138 if ($endmem - $startmem > 180) 139 139 $PASS = 0 140 140 echo "growth: {$endmem-$startmem}" -
trunk/Ohana/src/opihi/cmd.data/wd.c
r20652 r27435 75 75 /* save the (float) version, write out a temporary buffer */ 76 76 temp_matrix = buf[0].matrix; 77 ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix. size));78 memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix. size);77 ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix.datasize)); 78 memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix.datasize); 79 79 temp_header = buf[0].header; 80 ALLOCATE (temp_header.buffer, char, MAX(1, temp_header. size));81 memcpy (temp_header.buffer, buf[0].header.buffer, temp_header. size);80 ALLOCATE (temp_header.buffer, char, MAX(1, temp_header.datasize)); 81 memcpy (temp_header.buffer, buf[0].header.buffer, temp_header.datasize); 82 82 83 83 if (temp_header.Naxes) { … … 88 88 gfits_modify (&temp_header, "BSCALE", "%lf", 1, outScale); 89 89 gfits_modify (&temp_header, "BZERO", "%lf", 1, outZero); 90 gfits_modify (&temp_header, "UNSIGN", "%t", 1, outUnsign);90 gfits_modify_alt (&temp_header, "UNSIGN", "%t", 1, outUnsign); 91 91 } 92 92 … … 94 94 Header Xhead; 95 95 FILE *f; 96 off_t nbytes; 96 97 int status, Nextend; 97 98 … … 109 110 } 110 111 111 gfits_modify (&Xhead, "EXTEND", "%t", 1, TRUE);112 gfits_modify_alt (&Xhead, "EXTEND", "%t", 1, TRUE); 112 113 113 114 Nextend = 0; … … 125 126 126 127 /* position to begining of file to write header */ 127 fseek (f, 0, SEEK_SET);128 status = fwrite (Xhead.buffer, 1, Xhead.size, f);129 if ( status != Xhead.size) {128 fseeko (f, 0LL, SEEK_SET); 129 nbytes = fwrite (Xhead.buffer, 1, Xhead.datasize, f); 130 if (nbytes != Xhead.datasize) { 130 131 gprint (GP_ERR, "ERROR: failed writing data to image header\n"); 131 132 status = FALSE; … … 144 145 145 146 /* position to end of file to write new extend */ 146 fseek (f, 0, SEEK_END);147 status = fwrite (temp_header.buffer, 1, temp_header.size, f);147 fseeko (f, 0LL, SEEK_END); 148 nbytes = fwrite (temp_header.buffer, 1, temp_header.datasize, f); 148 149 fclose (f); 149 if ( status != temp_header.size) {150 if (nbytes != temp_header.datasize) { 150 151 gprint (GP_ERR, "failed to write file\n"); 151 152 status = FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.
