def data(dataset, settings, target, night, mode): """ Load dataset data from the web if necessary, and return data folder #TODO: remove data afterwards? Parameters ---------- dataset : tuple(str, str) instrument, target Returns ------- directory : str data directory """ instrument, target = dataset folder = dirname(__file__) if instrument == "UVES": folder = datasets.UVES(folder) elif instrument == "XSHOOTER": folder = datasets.XSHOOTER(folder) elif instrument == "JWST_NIRISS": folder = datasets.JWST_NIRISS(folder) elif instrument == "NIRSPEC": folder = datasets.KECK_NIRSPEC(folder) else: raise ValueError("Dataset not recognised") yield folder odir = _odir(folder, settings, instrument, target, night, mode) rmtree(odir, ignore_errors=True)
"flat", "orders", "norm_flat", "wavecal", "curvature", "science", "continuum", "finalize", ) # some basic settings # Expected Folder Structure: base_dir/datasets/HD132205/*.fits.gz # Feel free to change this to your own preference, values in curly brackets will be replaced with the actual values {} # load dataset (and save the location) base_dir = datasets.UVES() input_dir = "raw/" output_dir = "reduced/{instrument}/{target}/{night}/{mode}" config = pyreduce.configuration.get_configuration_for_instrument(instrument, plot=True) pyreduce.reduce.main( instrument, target, night, mode, steps, base_dir=base_dir, input_dir=input_dir, output_dir=output_dir,
# "flat", # "orders", # "norm_flat", # "wavecal", "curvature", # "science", # "continuum", # "finalize", ) # some basic settings # Expected Folder Structure: base_dir/datasets/HD132205/*.fits.gz # Feel free to change this to your own preference, values in curly brackets will be replaced with the actual values {} # load dataset (and save the location) base_dir = datasets.UVES("/DATA/PyReduce") input_dir = "raw/" output_dir = "reduced/{night}/{mode}" config = pyreduce.configuration.get_configuration_for_instrument(instrument, plot=1) pyreduce.reduce.main( instrument, target, night, mode, steps, base_dir=base_dir, input_dir=input_dir, output_dir=output_dir,