def model_uncert(self):
Y = self.photometry_array.T<EOL>Y /= np.median(Y, axis=<NUM_LIT:1>)[:, None]<EOL>C = np.median(Y, axis=<NUM_LIT:0>)<EOL>nstars, nobs = np.shape(Y)<EOL>Z = np.empty((nstars, <NUM_LIT:4>))<EOL>qs = self.qs.astype(int)<EOL>for s in range(<NUM_LIT:4>):<EOL><INDENT>Z[:, s] = np.median((Y / C)[:, qs == s], axis=<NUM_LIT:1>)<EOL><DEDENT>resid2 = (Y - Z[:, qs] * C)**<NUM_LIT:2><EOL>z = Z[:, qs]<EOL>trend = z * C[None, :]<EOL>lnS = np.log(np.nanmedian(resid2, axis=<NUM_LIT:0>))<EOL>jitter = np.log(<NUM_LIT:0.1>*np.nanmedian(np.abs(np.diff(Y, axis=<NUM_LIT:1>))))<EOL>cal_ferr = np.sqrt(np.exp(<NUM_LIT:2>*(jitter/trend))+z**<NUM_LIT:2>*np.exp(lnS)[None, :])<EOL>self.modeled_uncert = cal_ferr<EOL>self.target_uncert = cal_ferr[<NUM_LIT:0>]<EOL>
Estimate the photometric uncertainties on each data point following Equation A.2 of The Paper.
Based on the kepcal package of Dan Foreman-Mackey.