Flux and magnitude conversion — species 0.1.2 documentation

# Flux and magnitude conversion

    [1]:

    import species
    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]

    [1]:

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

    [2]:

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

    [3]:

    flux, error = synphot.magnitude_to_flux(15., 0.2)
    print(f'Flux density [W m-2 micron-1] = {flux:.2e} +/- {error:.2e}')

    Adding filter: JWST/NIRCam.F115W... [DONE]
    Downloading Vega spectrum (270 kB)... [DONE]
    Adding Vega spectrum... [DONE]
    Flux density [W m-2 micron-1] = 4.15e-15 +/- 7.69e-16

    [4]:

    app_mag, abs_mag = synphot.flux_to_magnitude(flux, 30.)
    print(f'Apparent magnitude [mag] = {app_mag:.2f}')
    print(f'Absolute magnitude [mag] = {abs_mag:.2f}')

    Apparent magnitude [mag] = 15.00
    Absolute magnitude [mag] = 12.61