def phot(self, obj_mapping, **kwargs): """ Phot the frames in the folder obj_mapping must be a dict mapping the normalized name of objects to a tuple containing the coordinate file and optionally a coords.Coords object containing the coordinates of the target. output_dir is the directory to save the output folders in, it defaults to a subdirectory of self.folder named "photometry" and will be created if it does not already exist. all kwargs are passed through to the phot method """ logger.info("Photting folder: " + self.folder) self.ensure_objectLists() output_dir = path.join(self.folder, "photometry") if not path.isdir(output_dir): # only create directory if it does not already exist os.makedirs(output_dir) for objName, (coordfile, targetCoords) in obj_mapping.items(): for im in self.objects[objName]: try: logger.info("Photting image: " + im) phot(im, output_dir, coordfile, targetCoords, **kwargs) except Exception as ex: logger.warning(ex) # continue photting the rest return self
def phot(self, obj_mapping, **kwargs): ''' Phot the frames in the folder obj_mapping must be a dict mapping the normalized name of objects to a tuple containing the coordinate file and optionally a coords.Coords object containing the coordinates of the target. output_dir is the directory to save the output folders in, it defaults to a subdirectory of self.folder named "photometry" and will be created if it does not already exist. all kwargs are passed through to the phot method ''' logger.info("Photting folder: " + self.folder) self.ensure_objectLists() output_dir = path.join(self.folder, 'photometry') if not path.isdir(output_dir): #only create directory if it does not already exist os.makedirs(output_dir) for objName, (coordfile, targetCoords) in obj_mapping.items(): for im in self.objects[objName]: try: logger.info("Photting image: " + im) phot(im, output_dir, coordfile, targetCoords, **kwargs) except Exception as ex: logger.warning(ex) #continue photting the rest return self
def trackandphot(init_x,init_y, plottingThings): [xCenter,yCenter,averageRadius, _] = trackSmooth.trackSmooth(imagedata,init_y, init_x, \ smoothconst, plottingThings, preCropped=False, zoom=zoomfactor, plots=trackplots) flux, error, photFlags, _ = photometry.phot(imagedata, xCenter, yCenter, apertureradius, plottingThings, ccdGain=1.0, plots=trackplots,\ # annulusOuterRadiusFactor=4.0, annulusInnerRadiusFactor=1.5,\ annulusOuterRadiusFactor=2.5, annulusInnerRadiusFactor=1.1,\ sigmaclipping=True, returnsubtractedflux=True) return xCenter, yCenter, flux, error
def trackandphot(init_x, init_y, plottingThings): [xCenter,yCenter,averageRadius, _] = trackSmooth.trackSmooth(imagedata,init_y, init_x, \ smoothconst, plottingThings, preCropped=False, zoom=zoomfactor, plots=trackplots) flux, error, photFlags, _ = photometry.phot(imagedata, xCenter, yCenter, apertureradius, plottingThings, ccdGain=1.0, plots=trackplots,\ # annulusOuterRadiusFactor=4.0, annulusInnerRadiusFactor=1.5,\ annulusOuterRadiusFactor=2.5, annulusInnerRadiusFactor=1.1,\ sigmaclipping=True, returnsubtractedflux=True) return xCenter, yCenter, flux, error
subplotsDimensions = 140 photSubplotsOffset = 3 statusSubplotOffset = 6 plottingThings = [fig,subplotsDimensions,photSubplotsOffset] else: plottingThings = False [xCenter,yCenter,averageRadius, _] = trackSmooth.trackSmooth(imagedata,init_y, init_x, \ smoothconst, plottingThings, preCropped=False, zoom=zoomfactor, plots=trackplots) for ap, apertureradius in enumerate(apertureradii): flux, error, photFlags, _ = photometry.phot(imagedata, xCenter, yCenter, apertureradius, plottingThings, ccdGain=1.0, plots=trackplots,\ annulusOuterRadiusFactor=2.0, annulusInnerRadiusFactor=1.5,\ sigmaclipping=True, returnsubtractedflux=True) fluxes[i, j, ap] = flux errors[i, j, ap] = error xcentroids[i, j] = xCenter ycentroids[i, j] = yCenter if trackplots: plt.show() #testind = 0 #compind = 1 #lc = fluxes[:, testind, :]/fluxes[:, compind, :] #
subplotsDimensions = 140 photSubplotsOffset = 3 statusSubplotOffset = 6 plottingThings = [fig, subplotsDimensions, photSubplotsOffset] else: plottingThings = False [xCenter,yCenter,averageRadius, _] = trackSmooth.trackSmooth(imagedata,init_y, init_x, \ smoothconst, plottingThings, preCropped=False, zoom=zoomfactor, plots=trackplots) for ap, apertureradius in enumerate(apertureradii): flux, error, photFlags, _ = photometry.phot(imagedata, xCenter, yCenter, apertureradius, plottingThings, ccdGain=1.0, plots=trackplots,\ annulusOuterRadiusFactor=2.0, annulusInnerRadiusFactor=1.5,\ sigmaclipping=True, returnsubtractedflux=True) fluxes[i, j, ap] = flux errors[i, j, ap] = error xcentroids[i, j] = xCenter ycentroids[i, j] = yCenter if trackplots: plt.show() #testind = 0 #compind = 1 #lc = fluxes[:, testind, :]/fluxes[:, compind, :] #