Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .cursor/rules/spisea-synphot-conda.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: Use the spisea-synphot conda environment for all Python, pip, and tests
alwaysApply: true
---

# Conda environment: `spisea-synphot`

For this repository, use the **`spisea-synphot`** conda environment for every shell command that needs Python, `pip`, `pytest`, or project tooling.

- Prefer: `conda run -n spisea-synphot <command>` (e.g. `conda run -n spisea-synphot python -m pytest ...`) so the correct interpreter is used even in non-interactive shells.
- Alternatively: `source "$(conda info --base)/etc/profile.d/conda.sh" && conda activate spisea-synphot` then run commands as usual.
- Do not assume `python` or `pip` on `PATH` without activating that environment; do not use other envs (e.g. a generic `astro` env) for SPISEA work unless the user says otherwise.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ RUN apt-get update && apt-get upgrade -y && apt-get clean

RUN apt-get install -y curl python3 python3-dev python3-distutils python3-pip git wget

RUN pip3 install astropy pysynphot scipy numpy matplotlib
# synphot + stsynphot replace deprecated pysynphot; set PYSYN_CDBS to your CDBS tree (see below).
RUN pip3 install astropy synphot stsynphot scipy numpy matplotlib

RUN ln -s /usr/bin/python3 /usr/bin/python

RUN export PYTHONPATH=$PYTHONPATH:/SPISEA

RUN cd / && git clone https://github.com/astropy/SPISEA.git
RUN git clone https://github.com/MovingUniverseLab/spisea.git /SPISEA

ENV PYTHONPATH "${PYTHONPATH}:/SPISEA/"

Expand All @@ -32,6 +33,7 @@ WORKDIR /cdbs/models
RUN wget http://astro.berkeley.edu/~jlu/spisea/spisea_models.tar.gz && wget http://astro.berkeley.edu/~jlu/spisea/spisea_cdbs.tar.gz
RUN tar -xvf spisea_cdbs.tar.gz && tar -xvf spisea_models.tar.gz && rm spisea_cdbs.tar.gz && rm spisea_models.tar.gz

# stsynphot reads throughput/model grids from this path (same convention as legacy pysynphot).
ENV PYSYN_CDBS /cdbs/models/cdbs/
ENV SPISEA_MODELS /cdbs/models

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Here is a brief list of things that SPISEA can do:
* make a star cluster at any age with an unusual IMF and unresolved multiplicity
* make a spectrum of a star cluster in integrated light

See [documentation](https://spisea.readthedocs.io/en/latest/) for
See [documentation](https://github.com/MovingUniverseLab/spisea/tree/main/docs) for
details on installing and running SPISEA. We also provide jupyter notebooks with a
[quick-start tutorial](https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb)
and [additional examples](https://github.com/astropy/SPISEA/tree/main/docs/paper_examples)
[quick-start tutorial](https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb)
and [additional examples](https://github.com/MovingUniverseLab/spisea/tree/main/docs/paper_examples)
demonstrating how to use SPISEA.

If you use SPISEA in your research, please cite [Hosek et al. (2020)](https://ui.adsabs.harvard.edu/abs/2020arXiv200606691H/abstract).
Expand All @@ -32,7 +32,7 @@ If you use SPISEA in your research, please cite [Hosek et al. (2020)](https://ui
SPISEA is actively supported and is growing in functionality, and
subsequently has had several updates since its
initial release. See the
[main documentation page](https://spisea.readthedocs.io/en/latest/)
[main documentation page](https://github.com/MovingUniverseLab/spisea/blob/main/docs/index.rst)
for the change log describing the updates in each release.

## Contributions
Expand All @@ -42,7 +42,7 @@ own fork of the repository, make their changes, and then submit a pull
request to the "dev" branch.

All contributions will be acknowledged on the
[contributors page](https://spisea.readthedocs.io/en/dev/contributors.html#contributors) (with permission).
[contributors page](https://github.com/MovingUniverseLab/spisea/blob/main/docs/contributors.rst) (with permission).
Contributors with features used in code releases will be co-authors in future SPISEA software papers.

## License
Expand Down
8 changes: 4 additions & 4 deletions docs/Quick_Start_Make_Cluster.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Quick_Start_Make_Cluster_w_BDs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a quick start guide to making a synthetic cluster using the SPISEA package, with the recent addition of brown dwarf capabilities. The cluster is constructed using a user-specified isochrone and initial mass function (IMF). Detailed documentation is provided in the ReadtheDocs page (https://spisea.readthedocs.io/en/latest/index.html).\n",
"This is a quick start guide to making a synthetic cluster using the SPISEA package, with the recent addition of brown dwarf capabilities. The cluster is constructed using a user-specified isochrone and initial mass function (IMF). Detailed documentation is available at https://github.com/MovingUniverseLab/spisea/tree/main/docs.\n",
"\n",
"Before starting this tutorial, it is assumed that SPISEA has been installed and the user's python path has been altered to include the SPISEA top-level directory"
]
Expand Down
8 changes: 4 additions & 4 deletions docs/add_atmo_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================================
Adding Atmosphere Models
========================================
Stellar atmosphere grids are implemented in SPISEA using STSci's `pysynphot <https://pysynphot.readthedocs.io/en/latest/index.html>`_ and CDBS infrastructure.
Stellar atmosphere grids are implemented in SPISEA using STSci's `stsynphot <https://stsynphot.readthedocs.io/>`_ / `synphot <https://synphot.readthedocs.io/>`_ stack and CDBS infrastructure.
Adding a new atmosphere grid involves saving the models in a new
sub-directory under your ``PYSYN_CDBS`` directory and creating a new
function in ``atmospheres.py`` to access those files.
Expand Down Expand Up @@ -33,9 +33,9 @@ a template for how to make a new one. Some general notes:
reflected in the 'INDEX' column of catalog.fits.

* For the atmospheres, use units of angstroms for the wavelength and
"FLAM" for flux ([erg/s/cm^2/A]; see `pysynphot docs
<https://pysynphot.readthedocs.io/en/latest/units.html>`_)
"FLAM" for flux ([erg/s/cm^2/A]; see `synphot docs
<https://synphot.readthedocs.io/en/latest/synphot/units.html>`_)

More detailed documentation on this is coming soon. In the meantime, let us know on the Github `issue tracker
<https://github.com/astropy/SPISEA/issues>`_ if you'd like to
<https://github.com/MovingUniverseLab/spisea/issues>`_ if you'd like to
implement a new atmospheric model grid.
6 changes: 3 additions & 3 deletions docs/add_evo_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ below, you can implement your own evolution models into the SPISEA
framework.

If you have questions or run into problems, please raise an issue on
our Github `issue tracker <https://github.com/astropy/SPISEA/issues>`_. If you are willing to
our Github `issue tracker <https://github.com/MovingUniverseLab/spisea/issues>`_. If you are willing to
have the new models you add be added to the SPISEA package and made
available to the community, please fork or branch off of the
development repository and then submit merge requests to add your
Expand Down Expand Up @@ -104,7 +104,7 @@ new models (e.g., new metallicities, etc).

If the user needs to change the available age range for an existing
model grid, please let us know via the Github `issue tracker
<https://github.com/astropy/SPISEA/issues>`_.
<https://github.com/MovingUniverseLab/spisea/issues>`_.


Creating a New Model Grid
Expand All @@ -114,5 +114,5 @@ To create an entirely new model set, the user needs to define a new
the appropriate directory structure in the
``$SPISEA_MODELS/evolution`` directory. Detailed documentation on
this is coming soon. In the meantime, let us know on the Github `issue tracker
<https://github.com/astropy/SPISEA/issues>`_ if you'd like to
<https://github.com/MovingUniverseLab/spisea/issues>`_ if you'd like to
implement a new model set.
2 changes: 1 addition & 1 deletion docs/add_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ If the user wants to add new photometric filters to SPISEA, there are 4 main ste
ensure the filter can be loaded properly.

Additional documentation on this is coming soon. In the meantime, let us know on the Github `issue tracker
<https://github.com/astropy/SPISEA/issues>`_ if you'd like to
<https://github.com/MovingUniverseLab/spisea/issues>`_ if you'd like to
implement new photometric filters.
10 changes: 5 additions & 5 deletions docs/atmo_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ To call an atmosphere for a particular star, user must define the
metallicity ([Z]), temperature (in K), and gravity (in cgs)::

spectrum = atmo(metallicity=0, temperature=5800, gravity=4)
wave = spectrum.wave # Wavelength in Angstroms
flux = spectrum.flux # Flux in ergs s^-1 cm^-2 Angstrom^-1
(pysynphot Flam units)
from astropy import units
wave = spectrum.waveset.to(units.AA).value # Wavelength in Angstroms
flux = spectrum(spectrum.waveset) # Flux (synphot Quantity; typically FLAM)

The atmosphere function is an input for the :ref:`isochrone_objects`,
and will automatically be used to define the
spectrum of each star in the isochrone model.

PopStar uses the pysynphot framework to extract the model atmosphere,
and the the output spectrum is a `pysynphot.Icat object <https://pysynphot.readthedocs.io/en/latest/ref_api.html#pysynphot.catalog.Icat>`_.
PopStar uses the stsynphot/synphot stack to extract the model atmosphere,
and the output spectrum is a synphot ``SourceSpectrum`` built from the CDBS grid via ``stsynphot.grid_to_spec``.

Below is a table of atmosphere model grids currently supported by
SPISEA. Note that the resolution column reports the original
Expand Down
10 changes: 5 additions & 5 deletions docs/extinction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ The extinction law can be defined using the classes in ``spisea/reddening.py``.
from spisea import reddening
red_law = reddening.<redlaw_name>()

SPISEA uses the pysynphot framework to define the extinction law.
The output is a `pysynphot.reddening.CustomRedLaw
<https://pysynphot.readthedocs.io/en/latest/ref_api.html#module-pysynphot.extinction>`_
oject.
SPISEA uses tabulated :math:`A_\lambda/A_{Ks}` curves. Reddening law classes inherit from
``reddening.RedLawBase``, which subclasses synphot's ``ExtinctionCurve`` at :math:`A_{Ks}=1` mag
(see ``synphot.reddening.etau_madau``). For arbitrary :math:`A_{Ks}` and wavelength sampling,
use ``red_law.extinction_at`` (or ``reddening.RedLawBase.ExtinctionAtAKs``).
The reddening law is reported in terms of A_lambda / A_Ks, and thus is normalized to A_Ks = 1.

The red_law object is passed into the :ref:`isochrone_objects` in order to
define the extinction for the stars. See the `Quick Start <https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
define the extinction for the stars. See the `Quick Start <https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
for an example.

Available extinction laws:
Expand Down
10 changes: 5 additions & 5 deletions docs/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ Example: ``'hipparcos,Hp'``

**Hubble Space Telescope**

HST filters are defined by their `pysynphot OBSMODE strings
<https://pysynphot.readthedocs.io/en/latest/appendixb.html#pysynphot-appendixb>`_. These
HST filters are defined by their `stsynphot / legacy OBSMODE strings
<https://stsynphot.readthedocs.io/en/latest/stsynphot/obsmode.html>`_. These
are defined in the ``cdbs/mtab/`` and ``cdbs/comp/`` directories.

Example: ``'wfc3,ir,f125w'``
Expand Down Expand Up @@ -240,9 +240,9 @@ Example: ``'ps1, g'``

**Roman Space Telescope**

Roman Space Telescope WFI filters are defined by their `pysynphot
OBSMODE strings
<https://pysynphot.readthedocs.io/en/latest/appendixb.html#non-hst-filter-systems>`_.
Roman Space Telescope WFI filters are defined by their stsynphot-style
`OBSMODE strings
<https://stsynphot.readthedocs.io/en/latest/stsynphot/obsmode.html>`_.
These are defined in the ``cdbs/mtab/`` and ``cdbs/comp/``
directories. Note that the 2021-07-16 version of these directories
must be downloaded from from the `STScI reference atlases
Expand Down
13 changes: 7 additions & 6 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ If you are downloading the code from scratch, please follow the
instructions below. If you had already downloaded version 1 of the
code and are switching to version 2, please see :ref:`version`.

SPISEA is hosted on `GitHub <https://github.com/astropy/SPISEA>`_.
SPISEA is hosted on `GitHub <https://github.com/MovingUniverseLab/spisea>`_.
To begin, clone the git repository in your desired code directory::

git clone https://github.com/astropy/SPISEA.git
git clone https://github.com/MovingUniverseLab/spisea.git

The ``main`` branch contains the current release,
while the ``dev`` branch is for code development.
Expand All @@ -28,7 +28,8 @@ Other dependencies:

* python (>=3.7, < 3.12)
* astropy
* pysynphot
* synphot
* stsynphot
* scipy
* numpy (>= 1.17, < 2.0)
* matplotlib
Expand Down Expand Up @@ -176,7 +177,7 @@ However, these can be safely ignored since SPISEA doesn't use those functionalit

To further test your SPISEA install, try running the `Quick Start
notebook
<https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_.
<https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_.
It is also located in ``SPISEA/docs``.

To test the full range of
Expand Down Expand Up @@ -223,8 +224,8 @@ Installation

To create the container image, clone this repository and build the container::

git clone https://github.com/astropy/SPISEA.git
cd SPISEA
git clone https://github.com/MovingUniverseLab/spisea.git
cd spisea
docker build -t spisea .

Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/ifmr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Compact objects are included in the output tables produced by
* BH: phase = 103

See `Quick Start Example
<https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
<https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
for more examples of how to interact with the :ref:`cluster_objects`
output.

Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here is a brief list of things that SPISEA can do:

* make a spectrum of a star cluster in integrated light

SPISEA can be downloaded from `Github <https://github.com/astropy/SPISEA>`_. Please cite `Hosek et al. (2020) <https://ui.adsabs.harvard.edu/abs/2020arXiv200606691H/abstract>`_ if you use SPISEA in
SPISEA can be downloaded from `Github <https://github.com/MovingUniverseLab/spisea>`_. Please cite `Hosek et al. (2020) <https://ui.adsabs.harvard.edu/abs/2020arXiv200606691H/abstract>`_ if you use SPISEA in
your research.

Getting Started
Expand Down Expand Up @@ -164,9 +164,9 @@ Change Log
operating system used

2.1.10 (2023-06-01)
* Added support for Roman Space Telescope filters (via pysynphot)
* Added support for Roman Space Telescope filters (via stsynphot)

* Note: this requires the pysynphot ``cdbs/mtab`` and
* Note: this requires the ``cdbs/mtab`` and
``cdbs/comp/`` directories to be at least the 2021-07-16 version or later. See :ref:`getting_started` for how to download these files

2.1.9 (2023-01-10)
Expand Down
2 changes: 1 addition & 1 deletion docs/make_cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ has already been created::


See `Quick Start Example
<https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
<https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
for a detailed example for how to make different
cluster sub-classes and interact with the resulting output.
Here is a table from Hosek et al. 2020 that describes
Expand Down
2 changes: 1 addition & 1 deletion docs/make_isochrone.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ An example of making an IsochronePhot object::
iso_dir=iso_dir)

See `Quick Start Example
<https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
<https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
for a detailed example showing how to interact with the isochrone
object output. Here is a table from Hosek et al. 2020 that describes
the values in the isochrone output table:
Expand Down
2 changes: 1 addition & 1 deletion docs/more_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Further Examples
Additional Jupyter notebooks with tutorials to produce the plots shown
in the SPISEA paper (`Hosek et al. (2020)
<https://ui.adsabs.harvard.edu/abs/2020arXiv200606691H/abstract>`_) can be found `here
<https://github.com/astropy/SPISEA/tree/main/docs/paper_examples>`_.
<https://github.com/MovingUniverseLab/spisea/tree/main/docs/paper_examples>`_.

Figure 2: HR-Diagrams with Different Evolution Models; CMDs with different Extinction Laws
--------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/multiplicity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ represents the combined photometry of all stars within a given system.
For most selected evolution models, the multiples are evolved as single stars.
To evolve binaries (does not support higher order multiples), you should use one of the ``MultiplicityResolved`` classes
and the ``COSMIC`` evolution model.
See the example jupyter notebook `Cluster_w_COSMIC.ipynb <https://github.com/astropy/SPISEA/blob/main/docs/Cluster_w_COSMIC.ipynb>`_ for an example.
See the example jupyter notebook `Cluster_w_COSMIC.ipynb <https://github.com/MovingUniverseLab/spisea/blob/main/docs/Cluster_w_COSMIC.ipynb>`_ for an example.
Note that currently COSMIC due to being external evolution is significantly slower than the other evolution options.


Expand Down
2 changes: 1 addition & 1 deletion docs/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Quick Start Guide
===================

We provide a `jupyter notebook
<https://github.com/astropy/SPISEA/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
<https://github.com/MovingUniverseLab/spisea/blob/main/docs/Quick_Start_Make_Cluster.ipynb>`_
as a Quick-Start Guide to demonstrate the steps required to simulate a cluster and interact
with the resulting output. This guide shows you how to:

Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ matplotlib
numpy <= 1.24.4
numpydoc
astropy
pysynphot
synphot>=1.5
stsynphot>=1.4
scipy
pandas
setuptools<=81.0
Expand Down
Loading