Starfish-develop / Starfish

Tools for Flexible Spectroscopic Inference
https://starfish.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
69 stars 22 forks source link

emu.load_flux() #159

Open Aseman7 opened 1 year ago

Aseman7 commented 1 year ago

Hello,

In the emulated flux density file (emu.load_flux([2850,5.246,0.07])), I have the normalized flux, while I need that in its original unit (for example, Jy or erg/cm2/s). How can I access to that?

Overall, can I use the following emulated spectrum (created by Starfish's emulator) as a PHOENIX atmospheric model for my star?

flux=emu.load_flux([2850,5.246,0.07]) wavelength = emu.wl plt.scatter(wavelength, flux)

Actually, I don't know how to derive an atmospheric model using PHOENIX or other libraries for a star. I would be very grateful if you could guide me.

gully commented 1 year ago

The absolute flux units are lost in the emulation process for the relatively unavoidable reason that the spectral grid has to be prewhitened. The procedure is described to some extent in Equations 20-23 of Czekala et al. 2015 and the surrounding text. Without dividing out the spectra first, the variance of the pixels across the grid would be enormous, and the PCA eigenspectra identification would not proceed as efficiently.

I made a workaround for this by storing the absolute values of the normalization in a separate "flux_scalars" attribute in my experimental starspot mixture model version of Starfish used in Gully-Santiago et al. 2017 and Gosnell et al. 2022. I don't think that feature is currently supported in the present version of Starfish, but in principle it could be (maintainers correct me if I'm wrong).