Synthetic photometry — species 0.1.2 documentation

# Synthetic photometry

    [1]:

    import urllib.request
    import numpy as np
    import species

    [2]:

    species.SpeciesInit()

    Initiating species v0.1.2... [DONE]
    Creating species_config.ini... [DONE]
    Database: /Users/tomasstolker/applications/species/docs/tutorials/species_database.hdf5
    Data folder: /Users/tomasstolker/applications/species/docs/tutorials/data
    Working folder: /Users/tomasstolker/applications/species/docs/tutorials
    Creating species_database.hdf5... [DONE]
    Creating data folder... [DONE]

    [2]:

    <species.core.setup.SpeciesInit at 0x12f882048>

    [3]:

    urllib.request.urlretrieve('http://irtfweb.ifa.hawaii.edu/~spex/IRTF_Spectral_Library/Data/plnt_Jupiter.txt',
                               'data/plnt_Jupiter.txt')

    [3]:

    ('data/plnt_Jupiter.txt', <http.client.HTTPMessage at 0x12f953f28>)

    [4]:

    wavelength, flux, error = np.loadtxt('data/plnt_Jupiter.txt', unpack=True)

    [5]:

    synphot = species.SyntheticPhotometry('JWST/NIRCam.F115W')

    [6]:

    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]

    [7]:

    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