IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40524


Ignore:
Timestamp:
Aug 30, 2018, 5:42:14 PM (8 years ago)
Author:
eugene
Message:

fix bug in output fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/avselect.c

    r40523 r40524  
    312312  // only write the fields which were in a valid catalog
    313313  if (RESULT_FILE) {
     314    int NfieldsOut = Nfields;
    314315    if (IDXvec) {
    315316      // extend the array by one to hold index array
    316       Nfields ++;
    317       REALLOCATE (vec, Vector *, Nfields);
    318       vec[Nfields-1] = IDXvec;
     317      NfieldsOut ++;
     318      REALLOCATE (vec, Vector *, NfieldsOut);
     319      vec[NfieldsOut-1] = IDXvec;
    319320    }
    320321    if (RADvec) {
    321322      // extend the array by one to hold index array
    322       Nfields ++;
    323       REALLOCATE (vec, Vector *, Nfields);
    324       vec[Nfields-1] = RADvec;
    325     }
    326     int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nfields, FALSE, FALSE, NULL, 0);
     323      NfieldsOut ++;
     324      REALLOCATE (vec, Vector *, NfieldsOut);
     325      vec[NfieldsOut-1] = RADvec;
     326    }
     327    int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, NfieldsOut, FALSE, FALSE, NULL, 0);
    327328    if (!status) goto escape;
    328329  }
Note: See TracChangeset for help on using the changeset viewer.