IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2020, 2:04:27 PM (6 years ago)
Author:
tdeboer
Message:

quick undo

File:
1 edited

Legend:

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

    r41340 r41341  
    1111    remove_argument (N, &argc, argv);
    1212    if ((mvec = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
     13    remove_argument (N, &argc, argv);
     14  }
     15
     16  Vector *WxOutV = NULL; // mask vector
     17  if ((N = get_argument (argc, argv, "-Wxvec"))) {
     18    remove_argument (N, &argc, argv);
     19    if ((WxOutV = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
     20    remove_argument (N, &argc, argv);
     21  }
     22  Vector *WyOutV = NULL; // mask vector
     23  if ((N = get_argument (argc, argv, "-Wyvec"))) {
     24    remove_argument (N, &argc, argv);
     25    if ((WyOutV = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    1326    remove_argument (N, &argc, argv);
    1427  }
     
    101114      mask = mvec->elements.Int;
    102115    }
     116  }
     117
     118  if (WxOutV) {
     119    ResetVector (WxOutV, OPIHI_FLT, Ntotal);
     120    for (i = 0; i < Ntotal; i++) { WxOutV->elements.Flt[i] = NAN; }
     121  }
     122  if (WyOutV) {
     123    ResetVector (WyOutV, OPIHI_FLT, Ntotal);
     124    for (i = 0; i < Ntotal; i++) { WyOutV->elements.Flt[i] = NAN; }
    103125  }
    104126
     
    169191        }
    170192      }
     193    }
     194  }
     195  if (WxOutV) {
     196    // save the calculated weights
     197    for (i = 0; i < fitdata.Npts; i++) {
     198      // fitdata only includes the previously unmasked points
     199      int n = fitdata.index[i];
     200      WxOutV->elements.Flt[n] = fitdata.Wx[i];
     201    }
     202  }
     203  if (WyOutV) {
     204    // save the calculated weights
     205    for (i = 0; i < fitdata.Npts; i++) {
     206      // fitdata only includes the previously unmasked points
     207      int n = fitdata.index[i];
     208      WyOutV->elements.Flt[n] = fitdata.Wy[i];
    171209    }
    172210  }
Note: See TracChangeset for help on using the changeset viewer.