Gollum Release 0.0.1

Gollum Release 0.0.1

gollum Release 0.0.1 gully Sep 01, 2021 GETTING STARTED 1 Installing the development version3 2 gollum Quickstart 5 3 Getting started 7 4 API 9 Python Module Index 13 Index 15 i ii gollum, Release 0.0.1 The goal of this repo is to provide a Python Application Programming Interface (API) to several different synthetic spectral models. gollum will be built on the astropy affiliated package specutils , and will be inspired by the API design of lightkurve . This project is loosely related to the parallel muler framework that is built on specutils and focuses on data. This project is all about models. The code itself and will have some overlap with functionality in Starfish , and this project could one day become a microservice to Starfish, rather than duplicate code. gollum makes it easy to chain routine operations in sequence: GETTING STARTED 1 gollum, Release 0.0.1 2 GETTING STARTED CHAPTER ONE INSTALLING THE DEVELOPMENT VERSION Note: Conda installation is not yet available. Pip installation is currently pending, and should eventually work pip install gollum Currently we recommend installing the developer version from source to help us with beta testing. To install gollum from source git clone https://github.com/BrownDwarf/gollum.git cd gollum conda env create-f environment.yml conda activate gollum python setup.py develop You can run the tests in the tests/ directory to double-check that everything installed correctly: py.test-vs 1.1 Requirements The project may work with a variety of Python 3 minor versions. We have tested it on Linux Operating Systems. 3 gollum, Release 0.0.1 4 Chapter 1. Installing the development version CHAPTER TWO GOLLUM QUICKSTART [1]: %config InlineBackend.figure_format='retina' [2]: from gollum.phoenix import PHOENIXSpectrum Simply provide the Teff and log g values you desire: [3]: spec = PHOENIXSpectrum(teff=5000, logg=4) Normalize the spectrum by the median: [4]: normalized_spectrum = spec.normalize() The spectrum has wavelength, with units: [5]: normalized_spectrum.wavelength [5]: [8038:01; 8038:02; 8038:03;:::; 12848:94; 12848:96; 12848:98] A˚ The flux vector is the same length as wavelength: [6]: normalized_spectrum.flux.dtype, normalized_spectrum.shape [6]: (dtype('float64'), (338649,)) [7]: ax = normalized_spectrum.plot() ax.set_ylim(0, 2) [7]: (0.0, 2.0) 5 gollum, Release 0.0.1 Right now we truncate the spectrum to the near-IR by default, you can change that with keyword arguments from the beginning: [8]: spec = PHOENIXSpectrum(teff=5000, logg=4, wl_lo=10_800, wl_hi=10_860) [9]: ax = spec.normalize().plot() ax.set_ylim(0) [9]: (0.0, 1.2) Neat! gollum is still under active development. Help us develop the tool by engaging with us on our GitHub Issues page. You can suggest a feature, or help us brainstorm how to build this project more. Thanks! 6 Chapter 2. gollum Quickstart CHAPTER THREE GETTING STARTED 3.1 Working with the PHOENIX models The PHOENIX models are under active development. Check back soon! [1]: from gollum.phoenix import PHOENIXSpectrum import numpy as np %config InlineBackend.figure_format='retina' [2]: spec = PHOENIXSpectrum(teff=2800, logg=5.0) [3]: spec.wavelength # "Angstroms" [3]: [8038:01; 8038:02; 8038:03;:::; 12848:94; 12848:96; 12848:98] A˚ [4]: spec.flux.unit # "egs / s / cm^2 / cm" erg [4]: s cm3 We can normalize the spectrum, which divides the spectrum by the median value, rendering the flux units dimensionless [5]: spectrum = spec.normalize() np.median(spectrum.flux) [5]: 1 [6]: ax = spectrum.plot() ax.set_xlim(8160, 8220) ax.set_ylim(0, 1.5) [6]: (0.0, 1.5) 7 gollum, Release 0.0.1 Neat! There are many great uses for the PHOENIX models. We will be adding support for other model grids in the future. 8 Chapter 3. Getting started CHAPTER FOUR API The API is under active development. Feedback is welcomed. 4.1 PHOENIX Spectrum A container for a single Phoenix grid-point spectrum of wavelength and flux F (휆). 4.1.1 PHOENIXSpectrum class gollum.phoenix.PHOENIXGrid(teff_range=None, logg_range=None, metallicity_range=None, path=None, wl_lo=8038, wl_hi=12849) A container for a grid of PHOENIX precomputed synthetic spectra of stars. Parameters • Teff_range (tuple) – The Teff limits of the grid model to read in. • logg (tuple) – The logg limits of the grid model to read in. • path (str) – The path to your local PHOENIX grid library. You must have the PHOENIX grid downloaded locally. Default: “~/libraries/raw/PHOENIX/” • wl_lo (float) – the bluest wavelength of the models to keep (Angstroms) • wl_hi (float) – the reddest wavelength of the models to keep (Angstroms) get_index(grid_point) Get the spectrum index associated with a given grid point property grid_points What are the grid points of the spectrum? show_dashboard(data=None, notebook_url='localhost:8888') Show an interactive dashboard for interacting with the PHOENIX grid Heavily inspired by the lightkurve .interact() method. Parameters • data (Spectrum1D-like) – A normalized data spectrum over which to plot the models • notebook_url (str) – Location of the Jupyter notebook page (default: “localhost:8888”) When showing Bokeh applications, the Bokeh server must be explicitly configured to al- low connections originating from different URLs. This parameter defaults to the standard notebook host and port. If you are running on a different location, you will need to supply 9 gollum, Release 0.0.1 this value for the application to display properly. If no protocol is supplied in the URL, e.g. if it is of the form “localhost:8888”, then “http” will be used. class gollum.phoenix.PHOENIXSpectrum(*args, teff=None, logg=None, metallicity=None, path=None, wl_lo=8038, wl_hi=12849, **kwargs) A container for PHOENIX spectra Parameters • Teff (int) – The Teff label of the PHOENIX model to read in. Must be on thePHOENIX grid. • logg (float) – The logg label of the PHOENIX model to read in. Must be on the PHOENIX grid. • path (str) – The path to your local PHOENIX grid library. You must have the PHOENIX grid downloaded locally. Default: “~/libraries/raw/PHOENIX/” • wl_lo (float) – the bluest wavelength of the models to keep (Angstroms) • wl_hi (float) – the reddest wavelength of the models to keep (Angstroms) 4.2 Sonora Spectrum A container for a single grid-point of the Sonora precomputed synthetic model spectrum of brown dwarfs and free- floating Gas Giant planets. The spectrum is a vector with coordinates wavelength andflux F (휆). 4.2.1 SonoraSpectrum class gollum.sonora.SonoraGrid(teff_range=None, logg_range=None, path=None, wl_lo=8038, wl_hi=12849) A container for a grid of Sonora precomputed synthetic spectra of brown dwarfs and free-floating Gas Giant planets. Parameters • Teff_range (tuple) – The Teff limits of the grid model to read in. • logg (tuple) – The logg limits of the Sonora model to read in. • path (str) – The path to your local Sonora grid library. You must have the Sonora grid downloaded locally. Default: “~/libraries/raw/Sonora/” • wl_lo (float) – the bluest wavelength of the models to keep (Angstroms) • wl_hi (float) – the reddest wavelength of the models to keep (Angstroms) get_index(grid_point) Get the spectrum index associated with a given grid point property grid_points What are the grid points of the spectrum? show_dashboard(data=None, notebook_url='localhost:8888', show_telluric=True) Show an interactive dashboard for interacting with the Sonora grid Heavily inspired by the lightkurve .in- teract() method. Parameters • data (Spectrum1D-like) – A normalized data spectrum over which to plot the models 10 Chapter 4. API gollum, Release 0.0.1 • notebook_url (str) – Location of the Jupyter notebook page (default: “localhost:8888”) When showing Bokeh applications, the Bokeh server must be explicitly configured to al- low connections originating from different URLs. This parameter defaults to the standard notebook host and port. If you are running on a different location, you will need to supply this value for the application to display properly. If no protocol is supplied in the URL, e.g. if it is of the form “localhost:8888”, then “http” will be used. class gollum.sonora.SonoraSpectrum(*args, teff=None, logg=None, path=None, wl_lo=8038, wl_hi=12849, **kwargs) A container for a single Sonora precomputed synthetic spectrum of a brown dwarfs or free-floating Gas Giant planet. Parameters • Teff (int) – The Teff label of the Sonora model to read in. Must be on the Sonora grid. • logg (float) – The logg label of the Sonora model to read in. Must be on the Sonora grid. • path (str) – The path to your local Sonora grid library. You must have the Sonora grid downloaded locally. Default: “~/libraries/raw/Sonora/” • wl_lo (float) – the bluest wavelength of the models to keep (Angstroms) • wl_hi (float) – the reddest wavelength of the models to keep (Angstroms) 4.3 Telluric Spectrum An experimental container for a single grid-point of a pre-computed telluric atmosphere model. The spectrum is a vector with coordinates wavelength and flux F (휆). 4.3.1 TelluricSpectrum class gollum.telluric.TelluricSpectrum(*args, path=None, wl_lo=8038, wl_hi=12849, **kwargs) A container for a single Telluric precomputed synthetic spectrum, currently from the skycalc website at eso.org. Parameters • path (str) – The path to a whitespace-delimited ASCII file generated by skycalc on eso.org. You can either provide the file locally or a weblink. ‘default’ uses a demo spectrum • wl_lo (float) – the bluest wavelength of the models to keep (Angstroms) • wl_hi (float) – the reddest wavelength of the models to keep (Angstroms) 4.3. Telluric Spectrum

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    19 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us