Changeset 38062 for trunk/Ohana/src/opihi/cmd.data/read_vectors.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/Ohana
- Property svn:mergeinfo deleted
-
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r37807 r38062 372 372 } 373 373 374 int VERBOSE = FALSE; 375 if ((N = get_argument (argc, argv, "-v"))) { 376 remove_argument (N, &argc, argv); 377 VERBOSE = TRUE; 378 } 379 374 380 int start = 0; 375 381 int Nrows = -1; // -1 : read entire table … … 399 405 // } 400 406 401 if (argc < 2) ESCAPE ("USAGE: read -fits extension [-extnum] [-keyword key] name name ...\n"); 407 if ((argc < 2) && !getSizes) ESCAPE ("USAGE: read -fits extension [-extnum] [-keyword key] name name ...\n"); 408 if ((argc != 1) && getSizes) ESCAPE ("USAGE: read -sizes -fits extension [-extnum] (does not read data values)\n"); 402 409 403 410 if (f == NULL) ESCAPE ("file not found\n"); … … 436 443 if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]); 437 444 if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n"); 438 if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]); 445 446 // just a warning: 447 if (start + Nrows > header.Naxis[1]) { 448 if (VERBOSE) gprint (GP_ERR, "NOTE: reading last block will return only %d rows\n", header.Naxis[1] - start); 449 } 439 450 440 451 // Ny = 100, start = 0, Nrows = -1 -> Nrows => 100 … … 472 483 } 473 484 485 if (getSizes) { 486 read_table_sizes (&header); 487 if (CCDKeyword != NULL) free (CCDKeyword); 488 gfits_free_header (&header); 489 return TRUE; 490 } 491 474 492 if (Nrows == -1) { 475 493 Nrows = header.Naxis[1] - start; … … 478 496 if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]); 479 497 if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n"); 480 if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]); 498 499 // just a warning: 500 if (start + Nrows > header.Naxis[1]) { 501 if (VERBOSE) gprint (GP_ERR, "NOTE: reading last block will return only %d rows\n", header.Naxis[1] - start); 502 } 481 503 482 504 if (!gfits_fread_ftable_range (f, padIfShort, &table, start, Nrows)) ESCAPE ("error reading table for extension %d\n", Nextend); … … 603 625 604 626 set_int_variable ("table:Nx", header->Naxis[0]); 605 set_int_variable ("table:N x", header->Naxis[0]);627 set_int_variable ("table:Ny", header->Naxis[1]); 606 628 set_int_variable ("table:Nfields", Nfields); 607 629
Note:
See TracChangeset
for help on using the changeset viewer.
