Skip to content
/ nemo Public
forked from teuben/nemo

a Stellar Dynamics Toolbox (Not Everybody Must Observe)

License

Notifications You must be signed in to change notification settings

akscholar/nemo

This branch is 2 commits ahead of, 264 commits behind teuben/nemo:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

76aea70 · Oct 24, 2024
Jun 3, 2024
Jan 28, 2024
Oct 21, 2024
May 9, 2024
Dec 25, 2019
Oct 21, 2024
May 30, 2024
Nov 1, 2022
Jun 22, 2024
Oct 24, 2024
Feb 29, 2024
Jul 8, 2024
Nov 15, 2020
Dec 26, 2023
Nov 24, 2019
Mar 20, 2019
May 18, 2022
Nov 1, 2022
Dec 21, 2023
Dec 12, 1992
Dec 13, 2023
Jun 28, 2024
Feb 20, 2024
Mar 11, 2024
Sep 15, 2023
Feb 19, 2024
Nov 1, 2022
Oct 18, 2007
Dec 27, 2019
Oct 18, 2007
Jan 26, 2024
Jan 26, 2024
Feb 1, 2024
Jan 7, 2000
Jan 6, 2024
Nov 24, 2019
Apr 13, 2004
Jun 10, 2021
May 16, 2022
Jul 7, 2023
Apr 12, 2004
Apr 12, 2020
Jul 7, 2023
Apr 12, 2020
Oct 29, 2022
Aug 6, 2023

Repository files navigation

A Real Bar

NEMO is a toolbox for stellar dynamics, particle simulations, stellar orbits, image processing and tabular data manipulation. Documentation is maintained in the github pages, https://teuben.github.io/nemo , and a manual in https://astronemo.readthedocs.io

History

This is the 4th major release of NEMO, and although data are compatible with earlier releases, old source code may need to be tweaked a bit to compile and link in the newer releases. Some compatibility with ZENO is also advertised. A brief history of NEMO:

  • NEMO V1: IAS release (Barnes, Hut & Teuben, 1987)
  • NEMO V2: UMD release (Teuben, 1994)
  • NEMO V3: UMD release (Teuben, 2001) in CVS, w/ autoconf, manybody, starlab and partiview
  • NEMO V4: UMD/ESO release (2017) now maintained in github

A related package, ZENO, was spun off NEMO V1, and is maintained by Josh Barnes. Other packages that geneologically came after NEMO are StarLab, ACS and AMUSE (see also https://ascl.net for code references):

 NEMO:      ascl:1010.051
 ZENO:      ascl:1102.027 (normally installed in $NEMO/usr/zeno)
 STARLAB:   ascl:1010.076 (optionally installed in $NEMO/local/starlab)
 ACS:       https://artcompsci.org
 AMUSE:     ascl:1107.007

Optional Packages

Packages we optionally use (sometimes also installed in $NEMO/opt with source code in $NEMO/local):

 PGPLOT:    ascl:1103.002
 CFITSIO:   ascl:1010.001
 WCSLIB:    ascl:1108.003
 glnemo2:   ascl:1110.008
 gyrfalcON: ascl:1402.031 (included with NEMO)
 HDF4
 HDF5       https://www.hdfgroup.org
 netcdf4
 gsl
 plplot
 unsio
 uns_project
 wcstools

Tools you will need to have pre-installed: the C/C++/Fortran compilers, (t)csh, and git. For graphics it's probably useful to have pgplot, but the default ps driver works fine just to get started. We are looking for more portable full graphics, as an alternative to pgplot.

The files in $NEMO/src/scripts/linux describe the actual package names for different linux distros that should lead to success.

Installation

There are a few different ways to install NEMO. We cover an annotated example in this bash notebook And here is a simple example that works most of the time on most Linux (including WSL) distros:

     git clone https://github.com/teuben/nemo
     cd nemo
     ./configure --with-yapp=pgplot
     make build check bench5
     source nemo_start.sh

If you plan to modify code and submit pull requests, the github CLI is recommended, though you can of course also clone the upstream manually (see also CONTRIBUTING.md):

     gh repo fork https://github.com/teuben/nemo

After installation, rebuilding NEMO to ensure you have all updates can be done as follows:

     cd $NEMO
     git pull
     make rebuild

python

There is now a small python component to NEMO, in the nemopy module.

     cd $NEMO
     pip install -e .

but this will depend on the details of how your python environment exists (virtual, conda etc.). We leave this to the user.

Examples

If you want to quickly see something work, here are the commands to make a classic 1911 Plummer sphere of just 10 particles, print the positions, plot the positions and view the contents of its binary file:

     mkplummer p10.dat 10
     snapprint p10.dat
     snapplot p10.dat
     tsf p10.dat

and here is an example of creating the 4 major data objects on the fly in NEMO (table, snapshot, image, orbit), showing off the command line interface and use of Unix pipes, with a dash denoting the piped file:

     tabgen -  | tabplot -
     mkplummer - 100 | snapplot - 
     ccdgen out=- object=gauss spar=1,20 size=128 | ccdplot - 
     mkorbit - 0 1 0  0.4 0 0 potname=plummer | orbint - - nsteps=1000 dt=0.05 | orbplot - 

or graphically showing the pipes through arrows:

Loading
   graph LR;
   A[tabgen]-->B[tabplot]

   C[mkplummer]-->D[snapplot]

   E[ccdgen]-->F[ccdplot]
   
   G[mkorbit]-->H[orbint]
   H-->I[orbplot]

There are more examples of scripts and figures in https://teuben.github.io/nemo/examples/ and an example ipython notebook is shown here https://github.com/teuben/nemo/blob/master/nemo_start_example.ipynb for something completely different.

A reproducable example is given in this notebook. To run this from the command line and print the phase space coordinates of the first particle, use this:

  mkplummer - 10 seed=123| snapprint -  | head -1
  ### nemo Debug Info: x y z vx vy vz 
  -0.609486 -0.221687 -0.450963 -0.0766784 -0.209397 0.396561 

Documentation and Help

There are several additional entry points if you are starting out with NEMO:

Citation

Please use the following citation if you use NEMO in your work

 @INPROCEEDINGS{1995ASPC...77..398T,
        author = {{Teuben}, P.},
         title = "{The Stellar Dynamics Toolbox NEMO}",
     booktitle = {Astronomical Data Analysis Software and Systems IV},
          year = 1995,
        editor = {{Shaw}, R.~A. and {Payne}, H.~E. and {Hayes}, J.~J.~E.},
        series = {Astronomical Society of the Pacific Conference Series},
        volume = {77},
         month = jan,
         pages = {398},
        adsurl = {https://ui.adsabs.harvard.edu/abs/1995ASPC...77..398T},
       adsnote = {Provided by the SAO/NASA Astrophysics Data System}
 }

A Real Bar

taken from this example script

About

a Stellar Dynamics Toolbox (Not Everybody Must Observe)

Resources

License

Citation

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 51.4%
  • C++ 19.7%
  • Fortran 14.4%
  • Shell 3.0%
  • TeX 3.0%
  • Makefile 2.0%
  • Other 6.5%