def PIPELINE(): get_check = input("-> Get data or analyze existing data? (get/analyze): ") if get_check == 'get': get.GET() elif get_check == 'analyze': location = input("-> Enter path to data directory: ") sat = check_saturation.check_saturate(location) if sat == 0: ref_image(location) align_astroalign.align2(location) else: check = input( "-> Saturated images found, continue image alignment? (y/n): ") if check == 'y': move = input( "-> Move saturated images to SDI archives before continuing? (y/n): " ) if move == 'y': check_saturation.move_arch(sat) ref_image(location) align_astroalign.align2(location) else: ref_image(location) align_astroalign.align2(location) method = input( "-> Choose combination method-- numpy (default) or swarp: ") if method == "swarp": combine_swarp.swarp(location) elif method == "numpy" or method == "": combine_numpy.combine_median(location) else: print("-> Error: unknown method entered") path = location[:-5] sub_method = input( "\n-> Choose subtraction method-- ais (default) or hotpants: ") if sub_method == '' or sub_method == 'ais': subtract_ais.isis_sub(path) elif sub_method == 'hotpants': subtract_hotpants.hotpants(path) else: print("\n-> Error: Unknown method") ask = input("-> Run sextractor on residual images? (y/n): ") if ask == 'y': extract.SEXTRACTOR(path) elif ask != 'y' and ask != 'n': print("-> Error: unknown input")
subtract_ais.isis_sub(path) elif sub_method == 'hotpants': subtract_hotpants.hotpants(path) else: print("\n-> Error: Unknown method") ask = input("-> Run sextractor on residual images? (y/n): ") if ask == 'y': extract.SEXTRACTOR(path) elif ask != 'y' and ask != 'n': print("-> Error: unknown input") if __name__ == '__main__': get_check = input("-> Get data or analyze existing data? (get/analyze): ") if get_check == 'get': get.GET() elif get_check == 'analyze': location = input("-> Enter path to data directory: ") sat = check_saturation.check_saturate(location) if sat == 0: ref_image(location) align_astroalign.align2(location) else: check = input( "-> Saturated images found, continue image alignment? (y/n): ") if check == 'y': move = input( "-> Move saturated images to SDI archives before continuing? (y/n): " ) if move == 'y': check_saturation.move_arch(sat)
def RUN(): ''' Master run function. Allows user to call any of the main **OASIS** methods. See documentation for details. ''' print('\n\t ------------------------------------------------------') print('\t OASIS v.1.0 ') print('\n\t Difference Imaging Software for Optical SETI Purposes ') print('\t Developed for the SDI Program @ UCSB ') print('\t http://www.deepspace.ucsb.edu ') print('\n\t Contact [email protected] for bug reports ') print('\t ------------------------------------------------------') print("\n-> Methods:") print("\n\tinitialize get mask align") print("\tpsf combine subtract mr") print("\textract pipeline simulate test") method = str(input('\n-> Enter method: ')) if method == 'get': import get get.GET() elif method == 'mask': path = input("-> Enter path to exposure time directory: ") import mask mask.MASK(path) elif method == 'align': path = input("-> Enter path to exposure time directory: ") import align align.ALIGN(path) elif method == 'psf': path = input("-> Enter path to exposure time directory: ") import psf psf.PSF(path) elif method == 'combine': path = input("-> Enter path to exposure time directory: ") import combine combine.COMBINE(path) elif method == 'subtract': path = input("-> Enter path to exposure time directory: ") import subtract subtract.SUBTRACT(path) elif method == 'mr': path = input("-> Enter path to exposure time directory: ") import MR MR.MR(path) elif method == 'extract': import extract path = input("-> Enter path to exposure time directory: ") extract_method = input("\n-> Extract method (both/indiv/MR): ") extract.EXTRACT(path, method=extract_method) elif method == 'pipeline': import pipeline path = input("-> Enter path to exposure time directory: ") pipeline.PIPELINE(path) elif method == 'initialize': import initialize initialize.INITIALIZE() elif method == 'test': import test test.TEST() elif method == 'simulate': import simulation simulation.SIM() else: print("-> Error: Method not recognized")