StarData¶
- class measure_extinction.stardata.StarData(datfile, path='', photonly=False, use_corfac=True, deredden=False)[source]¶
Bases:
object
Photometric and spectroscopic data for a star
- Attributes:
- filestring
DAT filename
- pathstring
DAT filename path
- sptypestring
spectral type of star
- model_paramsdict
has the stellar atmosphere model parameters empty dict if observed data
- datadict of key:BandData or SpecData
key gives the type of data (e.g., BAND, IUE, IRS)
- photonly: boolean
Only read in the photometry (no spectroscopy)
- corfacdict of key:correction factors
key gives the type (e.g., IRS, IRS_slope)
- use_corfacboolean
whether or not to use the correction factors, default = True
- LXD_manboolean
whether or not the LXD scaling factor has been set manually, default = False
- Parameters:
- datfile: string
filename of the DAT file
- path: string, optional
DAT file path
- photonly: boolean
Only read in the photometry (no spectroscopy)
- use_corfac: boolean
Modify the spectra based on precomputed correction factors Currently only affects Spitzer/IRS data and SpeX data
- dereddenboolean [default=False]
Deredden the data based on dereddening parameters given in the DAT file. Generally used to deredden standards.
Methods Summary
deredden
()Remove the effects of extinction from all the data.
get_flat_data_arrays
(req_datasources)Get the data in a simple format
plot
(ax[, pcolor, norm_wave_range, mlam4, ...])Plot all the data for a star (bands and spectra)
read
([deredden])Populate the object from a DAT file + spectral files
Methods Documentation
- deredden()[source]¶
Remove the effects of extinction from all the data. Prime use to deredden a standard star for a small amount of extinction. Information on the extinction curve to use is given in the DAT_file. Uses FM90 parameters for the UV portion of the extinction curve and CCM89 extinction values for the optical/NIR based on R(V). A(V) values used for dust column.
- get_flat_data_arrays(req_datasources)[source]¶
Get the data in a simple format
- Parameters:
- req_datasourceslist of str
list of data sources (e.g., [‘IUE’, ‘BAND’])
- Returns:
- (waves, fluxes, uncs)tuple of numpy.ndarrays
arrays are sorted from short to long wavelengths waves is wavelengths in microns fluxes is fluxes in erg/cm2/s/A uncs is uncertainties on flux in erg/cm2/s/A
- plot(ax, pcolor=None, norm_wave_range=None, mlam4=False, wavenum=False, fluxunit=Unit('erg / (Angstrom s cm2)'), exclude=[], yoffset=None, yoffset_type='multiply', annotate_key=None, annotate_wave_range=None, annotate_alignment='left', annotate_text=None, annotate_rotation=0.0, annotate_yoffset=0.0, annotate_color='k', legend_key=None, legend_label=None, fontsize=None)[source]¶
Plot all the data for a star (bands and spectra)
- Parameters:
- axmatplotlib plot object
- pcolormatplotlib color [default=None]
color to use for all the data
- norm_wave_rangelist of 2 floats [default=None]
min/max wavelength range to use to normalize data
- mlam4boolean [default=False]
plot the data multiplied by lambda^4 to remove the Rayleigh-Jeans slope
- wavenumboolean [default=False]
plot x axis as 1/wavelength as is standard for UV extinction curves
- fluxunitastropy unit
flux units for plot, default is ergs/(cm^2 s A)
- excludelist of strings [default=[]]
List of data type(s) to exclude from the plot (e.g., “IRS”, “IRAC1”,…)
- yoffsetfloat [default=None]
multiplicative or additive offset for the data
- yoffset_typestr [default=”multiply”]
yoffset type: “multiply” or “add”
- annotate_keystring [default=None]
type of data for which to annotate text (e.g., SpeX_LXD)
- annotate_wave_rangelist of 2 floats [default=None]
min/max wavelength range for the annotation of the text
- annotate_alignmentstring [default=”left”]
horizontal alignment of the annotated text (“left”, “center”, “right”)
- annotate_textstring [default=None]
text to annotate
- annotate_rotationfloat [default=0.0]
rotation angle of the annotated text
- annotate_yoffsetfloat [default=0.0]
y-offset for the annotated text
- annotate_colorstring [default=”k”]
color of the annotated text
- legend_keystring [default=None]
legend the spectrum using the given data key
- legend_labelstring [default=None]
label to use for legend
- fontsizeint [default=None]
fontsize for plot