Synthetic photometryΒΆ
[1]:
import species
import wget
import numpy as np
[2]:
species.SpeciesInit('./')
Initiating species v0.1.0... [DONE]
Creating species_config.ini... [DONE]
Creating species_database.hdf5... [DONE]
Creating data folder... [DONE]
[2]:
<species.core.setup.SpeciesInit at 0x130629a20>
[3]:
wget.download('http://irtfweb.ifa.hawaii.edu/~spex/IRTF_Spectral_Library/Data/plnt_Jupiter.txt',
out='data/plnt_Jupiter.txt')
wavelength, flux, error = np.loadtxt('data/plnt_Jupiter.txt', unpack=True)
[4]:
synphot = species.SyntheticPhotometry('JWST/NIRCam.F115W')
[5]:
jwst_flux = synphot.spectrum_to_flux(wavelength, flux)
jwst_mag = synphot.spectrum_to_magnitude(wavelength, flux)
Adding filter: JWST/NIRCam.F115W... [DONE]
Downloading Vega spectrum (270 kB)... [DONE]
Adding Vega spectrum... [DONE]
[6]:
print(f'Flux density [W m-2 micron-1] = {jwst_flux:.2e}')
print(f'Apparent magnitude [mag] = {jwst_mag[0]:.2f}')
Flux density [W m-2 micron-1] = 2.64e-09
Apparent magnitude [mag] = 0.49