Skip to content
/ GRASS Public

Simulate time-variable granulation signatures in stellar spectra

License

Notifications You must be signed in to change notification settings

palumbom/GRASS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRASS - GRanulation And Spectrum Simulator

Stable Dev Build Status arXiv arXiv

GRASS is a Julia package designed to produce time series of stellar spectra with realistic line-shape changes from solar granulation.

GRASS v1.0.x is described in detail in Palumbo et al. (2022); the results of this paper can be reproduced using the showyourwork workflow from this repo.

GRASS v2.0.x is presented in Palumbo et al. (2024a); the figures and quantitative results presented therein are reproducable with this repo.

Installation

GRASS is written entirely in Julia and requires Julia v1.9 or greater. Installation instructions for Julia are available from julialang.org.

GRASS itself only requires a few steps to install. Simply clone the repo to your desired directory...

git clone git@github.com:palumbom/GRASS.git
cd GRASS 
julia

... and then add it with Julia's built-in package manager, Pkg:

using Pkg
Pkg.add(path=".") # assuming you are in /PATH/TO/GRASS
using GRASS

If you wish to develop or otherwise contribute to GRASS, instead add the package in develop mode:

using Pkg
Pkg.develop(path=".") # assuming you are in /PATH/TO/GRASS
using GRASS

Upon first invocation of GRASS, Julia will automatically install the package dependencies and download the required input data. The input data can be re-installed by invoking

Pkg.build("GRASS")

Alternatively, these data can be directly downloaded from Zenodo.

Basic Example

Generating synthetic spectra with GRASS only takes a few lines of Julia:

using GRASS
using PyPlot

# parameters for lines in the spectra
lines = [5434.5]     # array of line centers in angstroms
depths = [0.75]      # continuum-normalized depth of lines
resolution = 7e5     # spectral resolution of the output spectra
spec = SpecParams(lines=lines, depths=depths, resolution=resolution)

# specify number of epochs (default 15-second spacing)
disk = DiskParams(Nt=25)

# synthesize the spectra
wavelengths, flux = synthesize_spectra(spec, disk)

# plot the result
plt.plot(wavelengths, flux)
plt.xlabel("Air Wavelength [Å]")
plt.ylabel("Normalized Flux")
plt.show()

spectrum

Additional details and examples can be found in the documentation.

Citation

DOI arXiv arXiv

If you use GRASS in your research, please cite the relevant software release and paper(s). The cffconvert tool can be used to generate a bibtex entry from the included CITATION.cff (or just use the "cite this repository" button on the GitHub sidebar).

Author & Contact

GitHub followers

This repo is maintained by Michael Palumbo. You may may contact him via his email - mpalumbo@flatironinstitute.org

About

Simulate time-variable granulation signatures in stellar spectra

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •