def test_user_supplied_arc_spec(): wavecal = WavelengthCalibration(log_file_name=None) # Science arc_spec wavecal.add_arc_spec(arc_spec) # Find the peaks of the arc wavecal.find_arc_lines() # Configure the wavelength calibrator wavecal.initialise_calibrator() wavecal.set_hough_properties( num_slopes=200, xbins=40, ybins=40, min_wavelength=3500, max_wavelength=8500, ) wavecal.set_ransac_properties(filter_close=True) wavecal.add_user_atlas(elements=element, wavelengths=atlas) wavecal.do_hough_transform() # Solve for the pixel-to-wavelength solution wavecal.fit(max_tries=500, display=False) # Save a FITS file wavecal.save_fits( output="wavecal", filename=os.path.join( HERE, "test_output", "test_wavecal_user_supplied_arc_spec" ), overwrite=True, ) wavecal.remove_arc_lines()
7740.31, 7802.65, 7887.40, 7967.34, 8057.258, ] element = ["Xe"] * len(atlas) arc_spec = np.loadtxt( os.path.join(HERE, "test_data", "test_full_run_science_0_arc_spec.csv"), delimiter=",", skiprows=1, ) wavecal = WavelengthCalibration(log_file_name=None) wavecal.add_arc_spec(arc_spec) # Find the peaks of the arc wavecal.find_arc_lines() arc_lines = wavecal.spectrum1D.peaks np.random.seed(0) def test_wavecal(): lhs6328_spectrum1D = Spectrum1D(log_file_name=None) wavecal = WavelengthCalibration(log_file_name=None) # Science arc_spec