astropy / SPISEA

Stellar Population Synthesis Modeling
https://spisea.readthedocs.io/en/stable/index.html
64 stars 32 forks source link

Issues with Installation and Downloading Necessary Models #6

Closed laurennc closed 4 years ago

laurennc commented 5 years ago

Hello!

I’m looking to make a realistic HR diagram for an education activity I’m building for LSST Education and Public Outreach. This package looks like it does exactly what I need but I’m having issues downloading and installing the code and supporting data files.

The instructions specify that I should download the grid of evolution and atmosphere models but I’m not sure how to access the data with the paths given? Am I supposed to run setup.py? How does the Makefile factor into the installation? I'm a bit uncertain on what steps to take when.

I’m happy to work through some of these issues and help with their documentation for future users! Or if the main focus of the group right now is on code development, I would be interested in just getting some sample data pre-generated. I really only need a theoretical star cluster at very young age (10 Myr) to get a hot-star population and a cluster at a more advanced age to have red giant and white dwarf populations. The rest of the details are unimportant (like metallicity, cluster mass, binary fraction) so it feels like a simple task well suited to this package.

We’re happy to provide credit to both the team and the package explicitly in the activity that we develop in whatever way you prefer. I'm sorry if I missed a "Contact Us" email but this doesn't need to remain a git issue. I can also be reached at lcorlies@lsst.org.

Thanks for your help! Lauren Corlies

mwhosek commented 5 years ago

Hi Lauren,

Thank you for your interest in the PopStar package! Yes, we are missing a link on the GitHub page that allows users to download the stellar evolution/atmosphere models needed to run the code. The issue is that the files are quite large: ~8GB when zipped, ~13GB when unzipped. We are setting up an external webpage that folks can visit to download the files, and I will let you know as soon as it is ready.

While the code is fully functional, we are still very much in "alpha testing" mode for releasing/documenting the code for public use. Any questions/comments you have when working through the installation and operation of the code would be greatly appreciated. I don't think you will have to run setup.py or the Makefile for the installation...we haven't finished constructing those yet. Once you download the models, you should be able to get away with just adjusting your paths as described by the "INSTALL (from git)" section on the github page. Let us know if you run into problems.

We are planning to publish a paper describing the code soon. Currently, a partial description can be found in section 4 of Hosek+19 ( http://adsabs.harvard.edu/abs/2019ApJ...870...44H), and the best "quick start" documentation for how to use the code can be found in PopStar/docs/Quick_Start_Make_Cluster.ipynb.

Thanks! Matt Hosek Postdoc, UCLA Galactic Center Group

On Mon, Mar 18, 2019 at 11:45 AM laurennc notifications@github.com wrote:

Hello!

I’m looking to make a realistic HR diagram for an education activity I’m building for LSST Education and Public Outreach. This package looks like it does exactly what I need but I’m having issues downloading and installing the code and supporting data files.

The instructions specify that I should download the grid of evolution and atmosphere models but I’m not sure how to access the data with the paths given? Am I supposed to run setup.py? How does the Makefile factor into the installation? I'm a bit uncertain on what steps to take when.

I’m happy to work through some of these issues and help with their documentation for future users! Or if the main focus of the group right now is on code development, I would be interested in just getting some sample data pre-generated. I really only need a theoretical star cluster at very young age (10 Myr) to get a hot-star population and a cluster at a more advanced age to have red giant and white dwarf populations. The rest of the details are unimportant (like metallicity, cluster mass, binary fraction) so it feels like a simple task well suited to this package.

We’re happy to provide credit to both the team and the package explicitly in the activity that we develop in whatever way you prefer. I'm sorry if I missed a "Contact Us" email but this doesn't need to remain a git issue. I can also be reached at lcorlies@lsst.org.

Thanks for your help! Lauren Corlies

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/astropy/PopStar/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJUsgpnl8eJbDzGrkn0DG6gq4GBUaiZks5vX97RgaJpZM4b6hFk .

laurennc commented 5 years ago

Hi Matt,

Thanks for the response! I had looked through the example notebook which is what got me excited about the package - it seems to do exactly what I'm looking for. But without the data file, I can't finish installing the package to run the notebook. So when the data file is ready to download, let me know and I'm happy to finish the installation process and document any issues I run into.

Thanks! Lauren Corlies LSST EPO

jluastro commented 5 years ago

Hi Lauren,

You should be able to download the models now here: http://w.astro.berkeley.edu/~jlu/popstar/

The file name is poster_models.tar.gz

Note that it is 7.7G. Matt does this include the entire CDBS? Or does Lauren need to download that as well?

Jessica

laurennc commented 5 years ago

Hello again,

Thanks so much for the model data files! I now have both the repo cloned and the data files but I feel like I may still be missing a step.

My computer runs in bash and I’ve installed python and most other required packages through anaconda. As such, I feel like I may not be setting the paths correctly in my .bashrc file because I still can’t get the package to work.

To my .basrhc file, I’ve added the following commands:

export CODE_DIR=/Users/lcorlies/repos/PopStar/popstar export POPSTAR_MODELS=/Users/lcorlies/repos/PopStar/popstar_models export PATH="$PATH:/Users/lcorlies/repos/PopStar/popstar"

I’ve used PATH instead of PYTHONPATH because that’s the path variable is what’s set in my .bash_profile by anaconda and seemed like the correct place to add the pointer to PopStar. I did also try using PYTHONPATH to see if that would help but Python still couldn't find the package. What I’m wondering is if I’ve picked the right PopStar subdirectory or should it land somewhere else?

Thanks for the clarification! Lauren

mwhosek commented 5 years ago

Hi Lauren,

I'm not sure python knows to look for external packages in the PATH variable, which might be the problem. In my experience, the PATH is used to point to the overall python environment (like anaconda) while external packages are specified by the PYTHONPATH environment variable. The PYTHONPATH is not set automatically by the anaconda installation and is something you need to add to your .bashrc file on your own.

While there are different ways you could set up your PYTHONPATH to get the code to work, I would recommend setting it to the top-level PopStar directory (/Users/lcorlies/repos/PopStar/). The individual codes should be located in the popstar subdirectory immediately under this (/Users/lcorlies/repos/PopStar/popstar). You should then be able to import the individual functions using import statements like those at the top of the Quick_Start_Make_Cluster document (e.g., from popstar import synthetic) in a python environment window.

Also, note that you also need to set the PYSYN_CDBS environment variable as well. This should point to the cdbs directory which should be found in the popstar_models directory:

export PYSYN_CDBS=//cdbs

The PYSYN_CDBS and POPSTAR_MODELS variables tells python where to go to find the underlying stellar evolution/atmosphere models. If those paths are broken then, then when you import you will get a bunch of warnings that say something like this:

UserWarning: PYSYN_CDBS is undefined; functionality will be SEVERELY crippled. And the import will fail. If the PYTHONPATH itself is broken, then you'll get a warning saying "No module named "popstar"" when you try to import the functions.

Hope this helps! Matt

On Fri, Mar 22, 2019 at 12:05 PM laurennc notifications@github.com wrote:

Hello again,

Thanks so much for the model data files! I now have both the repo cloned and the data files but I feel like I may still be missing a step.

My computer runs in bash and I’ve installed python and most other required packages through anaconda. As such, I feel like I may not be setting the paths correctly in my .bashrc file because I still can’t get the package to work.

To my .basrhc file, I’ve added the following commands:

export CODE_DIR=/Users/lcorlies/repos/PopStar/popstar export POPSTAR_MODELS=/Users/lcorlies/repos/PopStar/popstar_models export PATH="$PATH:/Users/lcorlies/repos/PopStar/popstar"

I’ve used PATH instead of PYTHONPATH because that’s the path variable is what’s set in my .bash_profile by anaconda and seemed like the correct place to add the pointer to PopStar. I did also try using PYTHONPATH to see if that would help but Python still couldn't find the package. What I’m wondering is if I’ve picked the right PopStar subdirectory or should it land somewhere else?

Thanks for the clarification! Lauren

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/astropy/PopStar/issues/6#issuecomment-475744322, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJUsswOMrtxlu9kiMzoVf4_BvuCI0Veks5vZSl8gaJpZM4b6hFk .

keflavich commented 5 years ago

I'm experiencing similar problems. I've downloaded both the data files provided at http://w.astro.berkeley.edu/~jlu/popstar/ and the STSCI synphot files, which I believe are also required, from ftp://archive.stsci.edu/pub/hst/pysynphot/synphot[123456].tar.gz. However, when I try to run the example, it appears the isochrone data files are the wrong format; they contain only 6 columns. This example traceback comes from running the first active cell in the example notebook:

Traceback (most recent call last):
  File "/Users/adam/proposals/hst/2019/popmodel.py", line 32, in <module>
    filters=filt_list)
  File "/Users/adam/repos/PopStar/popstar/synthetic.py", line 740, in __init__
    min_mass=min_mass, max_mass=max_mass)
  File "/Users/adam/repos/PopStar/popstar/synthetic.py", line 563, in __init__
    evol = evo_model.isochrone(age=10**logAge)  # solar metallicity
  File "/Users/adam/repos/PopStar/popstar/evolution.py", line 1139, in isochrone
    iso.rename_column('col7', 'phase')
  File "/Users/adam/repos/astropy/astropy/table/table.py", line 2154, in rename_column
    raise KeyError("Column {0} does not exist".format(name))
KeyError: 'Column col7 does not exist'

Could you verify that you're distributing the right tables?

Also, on some of the discussion in this Issue: setting PYTHONPATH is not necessary. I was able to install the module using the setup.py script and setting the relevant environmental variables, e.g.:

os.environ['POPSTAR_MODELS'] = '/Volumes/external/popstar'
os.environ['PYSYN_CDBS'] = os.path.join(os.getenv('POPSTAR_MODELS'), 'cdbs')
oxno2 commented 5 years ago

Hi, all, I tried to run the example file, but found a problem "No such file or directory: '/home/jl/u03/popstar/cdbs/grid/wdKoester/catalog.fits"

Where can I download the wdKoester files?

Thank you!

mwhosek commented 5 years ago

Hi all,

Thanks for your patience and feedback! We have updated the popstar_models.tar.gz and popstar_cdbs.tar.gz files to fix the problems you've been facing: they now contain the proper files, including the wdKoester models. The top-level README has also been updated with more detailed installation instructions as well as pointers to further documentation on different capabilities in PopStar. In addition, we've made some small modifications under the hood, so you will need to re-pull the master to get the updated code.

Please let us know if you run into further problems.

Thanks! Matt

On Sun, Apr 7, 2019 at 3:44 AM Ling, Chen-xiao-ji notifications@github.com wrote:

Hi, all, I tried to run the example file, but found a problem "No such file or directory: '/home/jl/u03/popstar/cdbs/grid/wdKoester/catalog.fits"

Where can I download the wdKoester files?

Thank you!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/astropy/PopStar/issues/6#issuecomment-480578870, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJUsov46gquAoK_P_EfsOV-Nhn0pBp8ks5vecv6gaJpZM4b6hFk .