def analyse(self, calib=True): self.usedimages, self.stars = find_stars( targets=self.targets, paths=self.paths, fileList=self.files, mincompstars=self.mincompstars, imageFracReject=self.imgreject, starreject=self.starreject, hicounts=self.hicounts, lowcounts=self.lowcounts) find_comparisons(self.targets, self.indir, self.usedimages, thresholdCounts=self.thresholdcounts) # Check that it is a filter that can actually be calibrated - in the future I am considering calibrating w against V to give a 'rough V' calibration, but not for now. self.calibrated = False if calib and self.filtercode in [ 'B', 'V', 'up', 'gp', 'rp', 'ip', 'zs' ]: try: find_comparisons_calibrated(targets=self.targets, filterCode=self.filtercode, paths=self.paths, nopanstarrs=self.nopanstarrs, nosdss=self.nosdss, closerejectd=self.closerejectd) self.calibrated = True except AstrosourceException as e: sys.stdout.write(f'ЁЯЫС {e}') elif calib: sys.stdout.write( f'тЪая╕П filter {self.filtercode} not supported for calibration' )
def analyse(self, calib=True): self.usedimages, self.stars = find_stars(self.targets, self.paths, self.files, imageFracReject=self.imgreject) find_comparisons(self.targets, self.indir, self.usedimages) # Check that it is a filter that can actually be calibrated - in the future I am considering calibrating w against V to give a 'rough V' calibration, but not for now. self.calibrated = False if calib and self.filtercode in ['B', 'V', 'up', 'gp', 'rp', 'ip', 'zs']: try: find_comparisons_calibrated(self.filtercode, self.paths) self.calibrated = True except AstrosourceException as e: sys.stdout.write(f'ЁЯЫС {e}') elif calib: sys.stdout.write(f'тЪая╕П filter {self.filtercode} not supported for calibration')
def main(full, stars, comparison, calc, calib, phot, plot, detrend, eebls, indir, ra, dec, target_file, format, clean): try: parentPath = Path(indir) if clean: cleanup(parentPath) logger.info('All temporary files removed') return if not (ra and dec) and not target_file: logger.error("Either RA and Dec or a targetfile must be specified") return paths = folder_setup(parentPath) filelist, filtercode = gather_files(paths, filetype=format) if ra and dec: targets = array([(ra, dec, 0, 0)]) elif target_file: target_file = parentPath / target_file targets = get_targets(target_file) # sys.tracebacklimit = 0 if full or stars: usedimages = find_stars(targets, paths, filelist) if full or comparison and not calib: find_comparisons(parentPath) if full or comparison and calib: # Check that it is a filter that can actually be calibrated - in the future I am considering calibrating w against V to give a 'rough V' calibration, but not for now. if filtercode == 'B' or filterCode == 'V' or filtercode == 'up' or filtercode == 'gp' or filtercode == 'rp' or filtercode == 'ip' or filtercode == 'zs': find_comparisons_calibrated(filtercode, paths) else: find_comparisons(parentPath) if full or calc: calculate_curves(targets, parentPath=parentPath) if full or phot: photometric_calculations(targets, paths=paths) if full or plot and not detrend and not calib: make_plots(filterCode=filtercode, paths=paths) if detrend: detrend_data(paths, filterCode=filtercode) if eebls: plot_bls(paths=paths) if calib: plot_with_period(paths, filterCode=filtercode) logger.info("Completed analysis") except AstrosourceException as e: logger.critical(e)
def test_find_comparisons_calibrated_v(): compFile = find_comparisons_calibrated('V', paths=TEST_PATHS) assert compFile.shape == (11, 5)
def test_find_comparisons_calibrated_v(setup): compFile = find_comparisons_calibrated(filterCode='V', paths=TEST_PATHS, targets=setup.targets) assert asarray(compFile).shape == (3, )
def test_find_comparisons_calibrated_b(setup): compFile = find_comparisons_calibrated(filterCode='B', paths=TEST_PATHS, targets=setup.targets) assert compFile.shape == (11,5)