Installing and using dsimulator in a Docker container
This page describes the instructions to install and run dsimulator in a Docker container. The installation instructions and dsimulator utilization have been tested on macOS Big Sur v11.5.2.
Installation
Install the Docker Desktop from https://www.docker.com/products/docker-desktop . You can create a Docker account, but it is not a requirement.
Open Docker Desktop → Preferences… → General. Uncheck Use gRPC FUSE for file sharing. The Docker will take 100% of the CPU resources if this option is not disabled.
Open Docker Desktop → Preferences… → Experimental Features. Uncheck all features.
Install XQuartz for X11 forwarding from https://www.xquartz.org/
Open XQuartz → Preferences… → Security. Select Allow connections from network clients.
Install IRAF/Pyraf Docker container. These instructions assume that the container will be installed in
$HOME
. Please, modify them as needed for your installation directory.cd $HOME
cd iraf_docker
./build.sh
Install dsimulator in the
iraf_docker
directory:mkdir deimos
cd deimos
Download tarball containing dsimulator (deimos_rev0b.tar) from https://www.keck.hawaii.edu/realpublic/inst/deimos/dsim.html
mv ~/Downloades/deimos_rev0b.tar .
tar -xvf deimos_rev0b.tar
cd ..
Add the following two lines to
$HOME/iraf_docker/login.cl
set deimos = "/home/iraf/data/deimos/"
task deimos = deimos$deimos.cl
Edit the path to the
home$
directory on the$HOME/iraf_docker/login.cl
set home = "/home/iraf/data/"
There may be other options that you might want to set on the
$HOME/iraf_docker/login.cl
file, such as:set editor = vi
set stdimage = imt4096
set stdimcur = stdimage
set imtype = "fits"
(Optional) Edit the
pyraf2
script to mount your working data directory on a desired location within the Docker. This can be done by adding the following line topyraf2
:-v $YOUR_LOCAL_WORKING_DIRECTORY:$DOCKER_MOUNT_POINT \
If you skip the last step, you will only have access to directories under the iraf_docker installation directory.
Running Pyraf in the container
Launch Pyraf:
cd $HOME/iraf_docker
./pyraf2
The Pyraf prompt (
-->
) will appear in a few seconds.The directory
$HOME/iraf_docker
will be mounted on/home/iraf/data
.pwd
will show/home/iraf/data
.ls
will show all the files and directories within your working data directory.
Change to your working data directory. Note that the working data directory should be under
$HOME/iraf_docker
, otherwise it will not be seen by Pyraf.Load the
deimos
package, edit the dsimulator parameters and launch dsimulatordeimos
epar dsim
dsim
Notes on Pyraf
The saveParList()
and setParList()
methods in Pyraf can be used to save a parameter list in your working directory and and set it at a later time:
To save the current parameters:
iraf.deimos.dsimulator.saveParList("myparams.par")
To set the parameters in
myparams.par
:iraf.deimos.dsimulator.setParList("myparams.par")
To set the parameters in
myparams.par
and launch dsimulator:iraf.deimos.dsimulator(ParList="myparams.par")
For additional information about how to use Pyraf see: