Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/teuben/nemo
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Nov 27, 2023
2 parents 07eb404 + 0c2e00a commit e101df4
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 60 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,34 @@ use of Unix pipes, with a dash denoting the piped file:
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

```mermaid
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:
Expand Down
17 changes: 14 additions & 3 deletions docs/source/clustertools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
ClusterTools (*)
----------------
ClusterTools
------------


This python package can also read NEMO (gyrfalcON) files. More on this later.
This python package can also read NEMO (gyrfalcON) files. Installation can be done
as follows:

.. code-block::
cd $NEMO/local
git clone https://github.com/webbjj/clustertools
pip install -e clustertools
For a few packages, we have a few existing examples in the ``$NEMO/usr`` tree
(e.g. amuse, martini, unsio and uns_projects)
4 changes: 2 additions & 2 deletions docs/source/codes.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _codes:

Related Codes (*)
=================
Related Codes
=============

Here we summarize some codes used in stellar dynamics that are similar to NEMO.
We only list codes that are (publically) available. SPH/hydro codes are currently
Expand Down
30 changes: 12 additions & 18 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ As an example consider:
.. code-block::
12% snapplot in=r001.dat xvar=r yvar="x*vy-y*vx" xrange=0:10 yrange=-2:2 \
"visib=-0.2<z&&z<0.2&&i%2==0"
"visib=-0.2<z&z<0.2&i%2==0"
plots the angular momentum of the particles along the z axis,
plots the angular momentum of the particles along the :math:`z` axis,
:math:`J_z = x.v_y - y.v_x` ,
against their radius, :math:`r`, but only for the even numbered particles,
(``i%2==0``) within
a distance of ``0.2`` of the X-Y plane (:math:`-0.2<z && z<0.2`).
a distance of ``0.2`` of the X-Y plane (:math:`-0.2<z \& z<0.2`).
Again note that some of the expressions are within quotes, to prevent
the shell of giving them a special meaning.

Expand All @@ -180,23 +180,23 @@ dynamically loaded into the program for
execution.
The expressions must contain legal C expressions and depending
on their nature must return a value in the context of the
program. {\it E.g.} {\tt xvar} and {\tt yvar} must return a
real value, whereas {\tt visib} must return a boolean (false/true or
program. {\it E.g.} ``xvar`` and ``yvar`` must return a
real value, whereas ``visib`` must return a boolean (false/true or
0/non-0) value. This should be explained in the manual page of the
corresponding programs.

In the context of snapshots, the expression can contain
basic body variables which
are understood to the *bodytrans(3NEMO)* routine.
The real
variables {\tt x, y, z, vx, vy, vz} are the cartesian phase-space
coordinates, {\tt t} the time,
{\tt m} the mass, {\tt phi} the potential,
{\tt ax,ay,az} the cartesian acceleration and {\tt aux}
variables ``x, y, z, vx, vy, vz`` are the cartesian phase-space
coordinates, ``t`` the time,
``m`` the mass, ``phi`` the potential,
``ax,ay,az`` the cartesian acceleration and ``aux``
some auxiliary information.
The integer variables are
{\tt i}, the index of the particle in the snapshot (0 being the
first one in the usual C tradition) and {\tt key}, another
``i``, the index of the particle in the snapshot (0 being the
first one in the usual C tradition) and ``key``, another
spare slot.


Expand All @@ -210,7 +210,7 @@ body variables listed above can be used in an expression.
When you need a complex expression that has be used over and
over again, it is handy to be able to store these expression under
an alias for later retrieval.
With the program {\tt bodytrans}
With the program ``bodytrans``
it is possible to save such compiled expressions object files under
a new name.

Expand Down Expand Up @@ -490,12 +490,6 @@ code snippet:
B% tcppipe A | tsf -
Images
------

.. todo:: examples/Images


Tables
------

Expand Down
5 changes: 3 additions & 2 deletions docs/source/filestr.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _filestr:

Filestructure (*)
=================
Filestructure
=============

.. note::
NEMO stores its persistent data in binary files, which under most circumstances
Expand Down Expand Up @@ -288,6 +288,7 @@ A very peculiar data file format encountered in NEMO is that of the
function descriptors. They present themselves to the user through
one or more keywords, and in reality point to a compiled
piece of code that will get loaded by NEMO (using *loadobj(3NEMO)*).
They normally live in ``$NEMOOBJ``.
We currently have 4 of these in NEMO:


Expand Down
4 changes: 2 additions & 2 deletions docs/source/graphics.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _graphics:

Graphics and Image Display (*)
==============================
Graphics and Image Display
==========================

.. note::
Most NEMO graphics programs select their graphics output with
Expand Down
13 changes: 8 additions & 5 deletions docs/source/iface.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _iface:

User Interface (*)
==================
User Interface
==============

.. note::
The NEMO command line user interface is a series of *keyword=value* pairs, where
Expand Down Expand Up @@ -333,15 +333,18 @@ of investment the programmability of higher level scripts can give you
a very powerful programming environment.


tkrun
~~~~~
tkrun, qtrun
~~~~~~~~~~~~

The ``tkrun`` program can take directives strategically placed in the
comment fields of a shell script, and provide a dynamical GUI frontend to
the command line parameters. Since the GUI is built up automatically,
the number of keyword should be limited to a dozen or so, as vertical
space is limited in most desktop managers.

The ``qtrun`` program is an updated version using python and the Qt library.


Interrupt to the REVIEW section
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -615,7 +618,7 @@ yapp_pgplot
~~~~~~~~~~~

The YAPP interface to the common PGPLOT library is the most used
interface, and allow one to select from a variety of graphics output
interface, and allows one to select from a variety of graphics output
devices without having to recompile the program.

A graphics device in PGPLOT
Expand Down
11 changes: 5 additions & 6 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ or
curl -LO https://teuben.github.io/nemo/install_nemo.sh
after which
after which installation can be done with something like

.. code-block:: bash
bash install_nemo.sh nemo=$HOME/opt/nemo yapp=pgplot bench5=1 python=1
bash install_nemo.sh nemo=$HOME/opt/nemo yapp=pgplot bench5=1 python=1
source $HOME/opt/nemo/nemo_start.sh
where the arguments to the
Expand All @@ -47,9 +47,9 @@ A more manual install, bypassing this script, can be:
source nemo_start.sh
On a Mac with their new
On a Mac with
`SIP protection <https://macpaw.com/how-to/disable-enable-system-integrity-protection>`_,
the ``--disable-shared`` flag may need to be added
enabled, the ``--disable-shared`` flag may need to be added.

.. code-block:: bash
Expand Down Expand Up @@ -136,8 +136,7 @@ With so many useful python packages around, and so many different methods
(anaconda, conda, venv etc.), we will not recommend a method, as this will
likely depend on your own situation. The installation examples below
should give you enough information how to adapt it for your python
installation. It goes without saying (it 2021 here) we only support
python3.
installation.

However, if you install python from within NEMO, there will be a
``$NEMO/anaconda3`` directory, that gets automatically activated once
Expand Down
4 changes: 2 additions & 2 deletions docs/source/refs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
References
==========

Here are some references.
We also keep a list of
`codes with papers in NEMO <https://teuben.github.io/nemo/man_html/bibcode.html>`_.
`codes with papers <https://teuben.github.io/nemo/man_html/bibcode.html>`_
in NEMO. These are maintained based on ``@ads`` tags in the manual pages.


*A Hierarchical O(N log N) Force-Calculation* -
Expand Down
6 changes: 2 additions & 4 deletions docs/source/starlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ distribution. If installed within NEMO, this should be in
$NEMO/local/starlab/EXAMPLES.


For details on a specific tool, type
For details on a specific program, type

.. code-block::
tool-name --help
program --help
- Create a linked list of 100 equal-mass nodes of unit total mass
Expand Down
9 changes: 5 additions & 4 deletions docs/source/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ write permission in the ``$NEMO`` directory tree:
mknemo -u tsf
mknemo -h
man mknemo
and an updated version should now be available (check the value of the ``VERSION=``
value in the output of ``--help``).
man mknemo
tsf --help
and an updated version should now be available. Check the value of the ``VERSION=``
value in the output of ``--help`` of the recompiled program.

Writing NEMO program programs is covered in :ref:`progr`, or see
also :ref:`install`.
Expand Down
31 changes: 21 additions & 10 deletions man/man1/pvtrace.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.TH PVTRACE 1NEMO "9 June 2009"
.SH NAME

.SH "NAME"
pvtrace \- PV diagram envelope tracing
.SH SYNOPSIS

.SH "SYNOPSIS"
\fBpvtrace\fP in=image [parameter=value]
.SH DESCRIPTION

.SH "DESCRIPTION"
\fBpvtrace\fP tries to recover the rotation curve from a single
position-velocity (PV) diagram, by tracing the outer edges of
the signal that, after correction for a velocity dispersion
Expand Down Expand Up @@ -45,7 +48,8 @@ the ISM, instrumental resolution and beam smearing.
.PP
WAMET = WArped Modified Envelope-Tracing method

.SH PARAMETERS
.SH "PARAMETERS"
.so man1/parameters
.TP 20
\fBin=\fP
Input image file - must be an PV \fIimage(5NEMO)\fP with position
Expand Down Expand Up @@ -105,7 +109,8 @@ Output file in case input file was a cube and output is now a map, not a table.
\fBmode=\fP
Which of the output modes (see OUTPUT below) will be used for the output map.
[Default: 2]
.SH OUTPUT

.SH "OUTPUT"
Output of the program will be an ASCII table, with various derived velocities
as function of position along the P axis in the PV-diagram. The following
columns are returned (see also \fBmode=\fP above):
Expand All @@ -121,13 +126,15 @@ columns are returned (see also \fBmode=\fP above):
7 half gaussian fit
8 half gaussian fit, with for MET correction
.fi
.SH CAVEATS

.SH "CAVEATS"
Position axis must be carefully created such that the galaxy center is at P=0,
whereas for velocity it can be corrected with VSYS=. This is easy for theoretical
data, but cumbersome for real data.
.PP
The MET mode is still not very robust, clipping helps.
.SH SEE ALSO

.SH "SEE ALSO"
rotcur(1NEMO), runvelfitss07(1NEMO), ccdvel(1NEMO), snapgrid(1NEMO), ccdmom(1NEMO), ccdsub(1NEMO)
.PP
.nf
Expand All @@ -137,15 +144,19 @@ Sofue et al 1997 PASJ 49, 17
Sofue et al 523, 136
Sofue et al (1997AJ....114.2428S)
Gentile et al. (2004MNRAS.351..903G) - MET/WAMET method
Aso & Sai - Spectral Line Analysis/Modeling (SLAM) - https://arxiv.org/abs/2311.07988
.fi
.SH FILES

.SH "FILES"
.nf
.ta +2i
src/image/rotcur sources
.fi
.SH AUTHOR

.SH "AUTHOR"
Peter Teuben
.SH UPDATE HISTORY

.SH "HISTORY"
.nf
.ta +1.0i +4.0i
5-May-01 V1.0 Created PJT
Expand Down
7 changes: 5 additions & 2 deletions man/man5/yapp.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH YAPP 5NEMO "24 December 2019"
.TH YAPP 5NEMO "23 November 2023"

.SH "NAME"
yapp \- Yet Another Plotting Package
Expand Down Expand Up @@ -120,6 +120,9 @@ PGPLOT_FOREGROUND n/a 1 is the foreground color ("white" for /xs)
PGPLOT_GIF_WIDTH 850 pixels for /gif (interchange for /vgif)
PGPLOT_GIF_HEIGHT 680 pixels for /gif (i.e. 85 dpi)

PGPLOT_PNG_WIDTH 680 pixels for /png
PGPLOT_PNG_HEIGHT 680 pixels for /png

PGPLOT_PPM_WIDTH 850 pixels for /ppm (interchange for /vppm)
PGPLOT_PPM_HEIGHT 680 pixels for /ppm (i.e. 85 dpi)

Expand Down Expand Up @@ -178,7 +181,7 @@ NEMO/src/kernel/yapp various yapp_* implementations
Peter Teuben

.SH "SEE ALSO"
catps(1NEMO), catpgps(1NEMO), yapp(3NEMO)
catps(1NEMO), catpgps(1NEMO), yapp(1NEMO), yapp(3NEMO)

.SH "UPDATE HISTORY"
.nf
Expand Down

0 comments on commit e101df4

Please sign in to comment.