Commits
514 514 | mask = -1 # No mask, so everything is unmasked |
515 515 | |
516 516 | # If model image exists, calc model flux, else set to 0 |
517 517 | model_sum = 0 |
518 518 | if os.path.exists(self.modelname): |
519 519 | ia.open(self.modelname) |
520 520 | model_data = ia.getchunk(blc, trc, dropdeg=True) |
521 521 | model_sum = np.sum(model_data) |
522 522 | ia.close() |
523 523 | |
524 - | peak_resid = np.amax(data*mask) |
524 + | if mask > 0: |
525 + | peak_resid = np.amax(data*mask) |
526 + | else: |
527 + | peak_resid = np.amax(data) |
528 + | |
525 529 | if fullsummary: |
526 530 | peak_resid_NM = np.amax(data) |
527 531 | mask_sum = np.sum(mask) |
528 532 | |
529 533 | summaryparams = dict() |
530 534 | # This entire function is only invoked in the special case of niter=0 |
531 535 | summaryparams['iterDone'] = [0.0,] |
532 536 | summaryparams['peakRes'] = [peak_resid,] |
533 537 | # model flux has to be zero because no iterations were performed |
534 538 | summaryparams['modelFlux'] = [model_sum,] |