scaled "effective" exposure time of IID counts. This can be used by lenstronomy to estimate the Poisson errors
        keeping the assumption that the counts are IIDs (even if they are not).

        :return: scaled exposure time
491928
def scaled_exposure_time(self):
        
        if self._data_count_unit == 'ADU':
            exp_time = self.ccd_gain * self.exposure_time
        else:
            exp_time = self.exposure_time
        return exp_time
1354018
def _jmomentsurfaceIntegrand(vz,vR,vT,R,z,df,sigmaR1,gamma,sigmaz1,n,m,o): #pragma: no cover because this is too slow; a warning is shown
    """"""
    return df(R,vR*sigmaR1,vT*sigmaR1*gamma,z,vz*sigmaz1,use_physical=False,
              func= (lambda x,y,z: x**n*y**m*z**o))
664857
private boolean robustFitTrifocal(List<AssociatedTriple> associated) {
		// Fit a trifocal tensor to the observations robustly
		ransac.process(associated);

		inliers = ransac.getMatchSet();
		TrifocalTensor model = ransac.getModelParameters();
		if( verbose != null )
			verbose.println("Remaining after RANSAC "+inliers.size()+" / "+associated.size());

		// estimate using all the inliers
		// No need to re-scale the input because the estimator automatically adjusts the input on its own
		if( !trifocalEstimator.process(inliers,model) ) {
			if( verbose != null ) {
				verbose.println("Trifocal estimator failed");
			}
			return false;
		}
		return true;
	}
1083714
def filterdata(data, plinds, d, threshold, ignorestr):
    

    logger.info('Ignoring times from ignorestr {0}'.format(ignorestr))
    ignoret = parseignoret(ignorestr)

    thresh0 = d['sigma_image1']
    thresh1 = d['sigma_plot']

    plinds['cir'] = calcinds(data, thresh0, ignoret=ignoret) # positive cands
    plinds['cro'] = calcinds(data, -1*thresh0, ignoret=ignoret) # negative cands
    plinds['edg'] = calcinds(data, thresh1, ignoret=ignoret) # cands with png plots
    sortinds = sorted(set(plinds['cir'] + plinds['cro'] + plinds['edg']))
    logger.info('Selected {} ({} linked) points.'.format(len(sortinds), len(plinds['edg'])))
    
    logger.info('Estimated total on target time: {} s\n'.format(calcontime(
        data, inds=plinds['cir']+plinds['cro']+plinds['edg'])))
    
    # these must get get rescaled when cands are ignored
    data['zs'] = normprob(d, data['snrs'], inds=sortinds)   

    # print high 1s bin counts
    logger.info('Finding high 1-second bins with threshold {0}'.format(threshold))
    hight, highcount = findhight(data, ignoret=ignoret, threshold=threshold)
    if len(hight):
        logger.info('High times \t High counts:')
        for i in range(len(hight)):
              logger.info('{0}\t{1}'.format(hight[i], highcount[i]))
    else:
        logger.info('No high 1s bin counts.\n')

    # print high cands and their times
    biginds = np.argsort(data['abssnr'][sortinds])[-5:]    
    logger.info('Top 5 abs(snr) candidates and times:')
    for ind in biginds[::-1]:
        logger.info('{0} {1}'.format(data['snrs'][sortinds][ind], data['time'][sortinds][ind]))
    logger.info('\n')
615667
private void validateTimes(int idx, SubPicture subPic,
			SubPicture subPicNext, SubPicture subPicPrev) {
		long startTime = subPic.getStartTime();
		long endTime = subPic.getEndTime();
		final long delay = 5000 * 90; // default delay for missing end time (5
										// seconds)

		idx += 1; // only used for display

		// get end time of last frame
		long lastEndTime = subPicPrev != null ? subPicPrev.getEndTime() : -1;

		if (startTime < lastEndTime) {
			startTime = lastEndTime;
		}

		// get start time of next frame
		long nextStartTime = subPicNext != null ? subPicNext.getStartTime() : 0;

		if (nextStartTime == 0) {
			if (endTime > startTime) {
				nextStartTime = endTime;
			} else {
				// completely messed up:
				// end time and next start time are invalid
				nextStartTime = startTime + delay;
			}
		}

		if (endTime <= startTime) {
			endTime = startTime + delay;
			if (endTime > nextStartTime) {
				endTime = nextStartTime;
			}
		} else if (endTime > nextStartTime) {
			endTime = nextStartTime;
		}

		int minTimePTS = configuration.getMinTimePTS();
		if (endTime - startTime < minTimePTS) {
			if (configuration.getFixShortFrames()) {
				endTime = startTime + minTimePTS;
				if (endTime > nextStartTime) {
					endTime = nextStartTime;
				}
			}
		}

		if (subPic.getStartTime() != startTime) {
			subPic.setStartTime(SubtitleUtils.syncTimePTS(startTime,
					configuration.getFpsTrg(), configuration.getFpsTrg()));
		}
		if (subPic.getEndTime() != endTime) {
			subPic.setEndTime(SubtitleUtils.syncTimePTS(endTime,
					configuration.getFpsTrg(), configuration.getFpsTrg()));
		}
	}
829054
def _get_scaling_term(self, C, rrup):
        
        a_f = 0.15 + 0.0007 * rrup
        a_f[a_f > 0.35] = 0.35
        return C["af"] + a_f
966785
def getDarkCurrentAverages(exposuretimes, imgs):
    '''
    
    '''
    x, imgs_p = sortForSameExpTime(exposuretimes, imgs)
    s0, s1 = imgs[0].shape

    imgs = np.empty(shape=(len(x), s0, s1),
                    dtype=imgs[0].dtype)
    for i, ip in zip(imgs, imgs_p):
        if len(ip) == 1:
            i[:] = ip[0]
        else:
            i[:] = averageSameExpTimes(ip)
    return x, imgs
831699
def _naive_concordance_summary_statistics(event_times, predicted_event_times, event_observed):
    
    num_pairs = 0.0
    num_correct = 0.0
    num_tied = 0.0

    for a, time_a in enumerate(event_times):
        pred_a = predicted_event_times[a]
        event_a = event_observed[a]
        # Don't want to double count
        for b in range(a + 1, len(event_times)):
            time_b = event_times[b]
            pred_b = predicted_event_times[b]
            event_b = event_observed[b]

            if _valid_comparison(time_a, time_b, event_a, event_b):
                num_pairs += 1.0
                crct, ties = _concordance_value(time_a, time_b, pred_a, pred_b, event_a, event_b)
                num_correct += crct
                num_tied += ties

    return (num_correct, num_tied, num_pairs)
654905
def _af_inv_scaled(x):
    """"""
    x = _transform_to_2d(x)

    cov_matrix = np.atleast_2d(np.cov(x, rowvar=False))

    cov_matrix_power = _mat_sqrt_inv(cov_matrix)

    return x.dot(cov_matrix_power)
262456
public int getIfdImagesCount() {
    int c = 0;
    if (metadata.contains("IFD")) {
      List<TiffObject> l = getMetadataList("IFD");
      int n = 0;
      for (TiffObject to : l) {
        if (to instanceof IFD) {
          IFD ifd = (IFD) to;
          if (ifd.isImage())
            n++;
        }
      }
      c = n;
    }
    return c;
  }
209768
def check_time_event(oqparam, occupancy_periods):
    
    time_event = oqparam.time_event
    if time_event and time_event not in occupancy_periods:
        raise ValueError(
            'time_event is %s in %s, but the exposure contains %s' %
            (time_event, oqparam.inputs['job_ini'],
             ', '.join(occupancy_periods)))
96820
def integratedAutocorrelationTime(A_n, B_n=None, fast=False, mintime=3):
    

    g = statisticalInefficiency(A_n, B_n, fast, mintime)
    tau = (g - 1.0) / 2.0
    return tau
101952
def expected_runtime_seconds(report_count:)
      runs = report_count * options[:lines_multipliers].length
      warmup_time_seconds = runs * options[:benchmark_warmup]
      bench_time_seconds = runs * options[:benchmark_time]

      warmup_time_seconds + bench_time_seconds
    end
823922
def scale_errors(cov_axes, confidence_level=0.95):
    
    dof = len(cov_axes)
    x2t = chi2.ppf(confidence_level,dof)
    return N.sqrt(x2t*cov_axes)
763626
def _counts2radiance(self, counts, coefs, channel):
        """"""
        logger.debug('Converting counts to radiance')

        if self._is_vis(channel):
            # Since the scanline-detector assignment is unknown, use the average
            # coefficients for all scanlines.
            slope = np.array(coefs['slope']).mean()
            offset = np.array(coefs['offset']).mean()
            return self._viscounts2radiance(counts=counts, slope=slope,
                                            offset=offset)

        return self._ircounts2radiance(counts=counts, scale=coefs['scale'],
                                       offset=coefs['offset'])
252647
def success_count(self):
        
        return len([i for i, result in enumerate(self.data) if result.success])
1299877
def D_dt(self, H_0, Om0, Ode0=None):
        
        lensCosmo = self._get_cosom(H_0, Om0, Ode0)
        return lensCosmo.D_dt