mfouesneau / pyphot

suite to deal with passband photometry
https://mfouesneau.github.io/pyphot/
MIT License
57 stars 18 forks source link

f.get_flux(lamb, spectra) #54

Closed isteniomorais closed 6 months ago

isteniomorais commented 7 months ago

Good afternoon! I have some doubts about the f.get_flux command. Does this command perform a filter interpolation on the object's spectrum data, or just calculate the integrated flux through the filter f?

And another doubt. I would like to include Saburu's filters, Hyper Suprime-Cam: Filters, in Pyphot's filter library. Is there a way to do this without using the line "tophat = Filter(wave, transmit, name='tophat', dtype='photon', unit='Angstrom')"?

mfouesneau commented 7 months ago

To allow integration, the spectra and the passband must be defined using the same wavelength values. If you look at the code, you will see that the passband is interpolated onto the spectrum definition.

You can add any filter you want using the example you mentioned. How else would you include it to also handle proper units?

isteniomorais commented 7 months ago

Perfect. Another thing, to do the integration, do I need to "cut" the spectrum in the same range as the passband, or does get_flux also do this? For example, I have a spectrum of an object, from 3000 to 11000 A, and the SDSS_g filter range is from 5830 to 7230 A. Do I need to separate the spectrum in the same filter range, or does get_flux already do that?

And yes, the Subaru_HSC's filters would be to handle suitable units as well. So I would like to include it in the library permanently, but I don't know how to do that.

mfouesneau commented 7 months ago

You do not have to deal with the spectra range manually. Pyphot does the mathematical integral here as defined in the documentation.

pyphot.astropy.sandbox.UnitAscii_Library(source)[source] is probably what you want to look at to create your library.

isteniomorais commented 6 months ago

mfousneau Does Pyphot work with redshift? If I want to correct the redshift of a model's data, could I do it directly in Pyphot?

mfouesneau commented 6 months ago

Please look at the scope of the code. Redshift is handled on the user side.