def scaleFluxes(self): ''' When all fluxes have been collected, run this to re-scale the fluxes of each comparison star to the flux of the target star. Do the same transformation on the errors. ''' for star in self.allStarsDict: if star != self.targetKey: self.allStarsDict[star]['scaledFlux'], m = mathMethods.regressionScale(self.getFluxes(star),self.getFluxes(self.targetKey),self.getTimes(),self.ingress,self.egress,returncoeffs=True) print m self.allStarsDict[star]['scaledError'] = np.abs(m)*self.getErrors(star) if star == self.targetKey: ## (Keep the target star the same) self.allStarsDict[star]['scaledFlux'] = self.allStarsDict[star]['rawFlux'] self.allStarsDict[star]['scaledError'] = self.allStarsDict[star]['rawError']
def scaleFluxes_multirad(self): ''' When all fluxes have been collected, run this to re-scale the fluxes of each comparison star to the flux of the target star. Do the same transformation on the errors. ''' for star in self.allStarsDict: for apertureRadiusIndex in range(len(self.apertureRadii)): if star != self.targetKey: print self.getFluxes_multirad(star,apertureRadiusIndex)[0] self.allStarsDict[star]['scaledFlux'][apertureRadiusIndex], m = mathMethods.regressionScale(self.getFluxes_multirad(star,apertureRadiusIndex),self.getFluxes_multirad(self.targetKey,apertureRadiusIndex),self.getTimes(),self.ingress,self.egress,returncoeffs=True) #print m self.allStarsDict[star]['scaledError'][apertureRadiusIndex] = np.abs(m)*self.getErrors_multirad(star,apertureRadiusIndex) if star == self.targetKey: ## (Keep the target star the same) self.allStarsDict[star]['scaledFlux'][apertureRadiusIndex] = self.allStarsDict[star]['rawFlux'][apertureRadiusIndex] self.allStarsDict[star]['scaledError'][apertureRadiusIndex] = self.allStarsDict[star]['rawError'][apertureRadiusIndex]