OPTICAM-instrument / opticam_pipe

Software for OPTICam instrument at SPM, Mexico
GNU Affero General Public License v3.0
2 stars 1 forks source link

Potential mistake in power law SED modeling #2

Open Junicornnn opened 2 years ago

Junicornnn commented 2 years ago

Lines 226 and 227 of the opticam_etc.py file: if self.index != None: sp = SourceSpectrum(PowerLawFlux1D, amplitude=1, x_0=self.mean_range*u.AA, alpha=self.index-1)

Alpha is the spectral index of the model spectral distribution and self.index is the input for the wanted spectral index. Here we set alpha=self.index-1. The index should not be reduced by 1 as that will make the modeled SED different than the one desired.

NCastro-Segura commented 2 years ago

I think, there is a typo and what it means is to do self.index*-1, with the multiplication. Even though the definition of the function says it is (x/x_0)^-alpha when you need a negative alpha you have to explicitly write it. @Alymantara ?

See the example in here https://pysynphot.readthedocs.io/en/latest/spectrum.html

Alymantara commented 2 years ago

I believe there was some issue that when inputting the "desired" power-law index, when plotting it it wasn't fully correct. I made this "hack" such that it worked as intended. I will look into it.