def construct_CCD(filename): try: with fits.open(filename) as fits_object: hdulist = [elem for elem in fits_object if elem.__class__.__name__ == 'ImageHDU'] header_info = get_Header_Info(filename) return _construct_CCD(hdulist, header_info, os.path.splitext(filename)[0]) except Exception as e: print("Error constructing FITS.\nException: "+str(e)+"\n") traceback.print_exc(file=sys.stdout) return ["Error constructing the single extension FITS file (CCD level)."]
def get_boundary(filename): header_info = get_Header_Info(filename) json_string = generate_json(filename, header_info) return json_string