IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40518


Ignore:
Timestamp:
Aug 20, 2018, 11:22:14 AM (8 years ago)
Author:
eugene
Message:

accept input mask if supplied vector is an INT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/fitplx_irls.c

    r40418 r40518  
    8989  if (dDvec->Nelements != Ntotal) ESCAPE ("mis-match in vector lengths (mjd vs dD)  = (%d vs %d)\n", dDvec->Nelements, Ntotal);
    9090 
     91  // if mask exists and is an INT, treat as a supplied mask
     92  // otherwise, reset
     93
    9194  opihi_int *mask = NULL;
    9295  if (mvec) {
    93     ResetVector (mvec, OPIHI_INT, Ntotal);
    94     mask = mvec->elements.Int;
    95     for (i = 0; i < Ntotal; i++) { mask[i] = 1; }
     96    if (mvec->type != OPIHI_INT) {
     97      ResetVector (mvec, OPIHI_INT, Ntotal);
     98      mask = mvec->elements.Int;
     99      for (i = 0; i < Ntotal; i++) { mask[i] = 1; }
     100    } else {
     101      mask = mvec->elements.Int;
     102    }
    96103  }
    97104
Note: See TracChangeset for help on using the changeset viewer.