astra.contrib.wd.utils

Module Contents

Functions

line_features(spectrum, wavelength_regions=([3860, 3900], [3950, 4000], [4085, 4120], [4320, 4360], [4840, 4880], [6540, 6580], [3880, 3905], [3955, 3975], [3990, 4056], [4110, 4140], [4370, 4410], [4450, 4485], [4705, 4725], [4900, 4950], [5000, 5030], [5860, 5890], [6670, 6700], [7050, 7090], [7265, 7300], [4600, 4750], [5000, 5160], [3925, 3940], [3960, 3975]), polyfit_regions=([3850, 3870], [4220, 4245], [5250, 5400], [6100, 6470], [7100, 9000]), polyfit_order=5) Engineer features based on line ratios for distinguishing different kinds of white dwarfs.
classify_white_dwarf(model_path, spectrum, **kwargs) Classify a white dwarf given a pre-trained model and a spectrum.
astra.contrib.wd.utils.line_features(spectrum, wavelength_regions=([3860, 3900], [3950, 4000], [4085, 4120], [4320, 4360], [4840, 4880], [6540, 6580], [3880, 3905], [3955, 3975], [3990, 4056], [4110, 4140], [4370, 4410], [4450, 4485], [4705, 4725], [4900, 4950], [5000, 5030], [5860, 5890], [6670, 6700], [7050, 7090], [7265, 7300], [4600, 4750], [5000, 5160], [3925, 3940], [3960, 3975]), polyfit_regions=([3850, 3870], [4220, 4245], [5250, 5400], [6100, 6470], [7100, 9000]), polyfit_order=5)

Engineer features based on line ratios for distinguishing different kinds of white dwarfs.

Parameters:
  • spectrum – A specutils.Spectrum1D spectrum of a white dwarf.
  • wavelength_regions – [optional] A tuple of two-length lists containing the start and end wavelengths to measure a line ratio from.
  • polyfit_regions – [optional] A tuple of two-length lists containing the start and end wavelengths to use when fitting the baseline flux.
  • polyfit_order – [optional] The polynomial order to use to fit to the baseline (continuum) flux.
Returns:

An array of line ratios for the given wavelength regions.

astra.contrib.wd.utils.classify_white_dwarf(model_path, spectrum, **kwargs)

Classify a white dwarf given a pre-trained model and a spectrum.

Parameters:
  • model_path – The local path to a pickled Random Forest Classifier.
  • spectrum – A specutils.Spectrum1D spectrum of a white dwarf.
Returns:

The most likely white dwarf class.