cap-post
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Post processing of FITS data cubes from Capreole simulations
#+TITLE:     =cap-post=
#+AUTHOR:    William Henney
#+EMAIL:     w.henney@crya.unam.mx
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:5 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:

* Postprocess Capreole datasets

All these programs work with datacubes in FITS format. See [[http://github.com/deprecated/ah3-utils][=ah3-utils=]] for how to convert Capreole's native AH3 format to FITS. 

** Package layout
+ =doc/cap-post.org= :: Source for documentation in Org-mode format  
+ =doc/cap-post.html= :: Compiled HTML file of documentation
+ =src/*.{f90,sh}= :: Programs and convenience scripts

** Compilation
+ First install the [[#dependencies-target][dependencies]]
+ Enter the =src/= directory
+ [OPTIONAL] Copy =local.mk.sample= to =local.mk= and edit it to specify the desired compiler command (=F90C=), compiler options (=F90LAGS=), and libraries to link (=LFITS=). 
  + The default values are 
    #+BEGIN_EXAMPLE
    F90C=gfortran
    F90FLAGS=-O3
    LFITS=/usr/local/lib/libcfitsio.a
    #+END_EXAMPLE
+ Compile everything with 
  #+begin_src bash
  make all
  #+end_src
+ Most programs are designed to be run in the directory where the data is.  For convenience, you may want to set a shell variable to the directory where the programs are, e.g.: =psrc=/path/to/cap-post/src=.  So you can then type =sh $psrc/fitsemiss.sh ...= 

** Convenience scripts

The general default behavior of these scripts is to process all the save times of a given model in the current directory.  Usage is as follows:

#+begin_src bash
sh SCRIPT.sh DATEID RUNID EMTYPE [I1] [I2] [ISTEP] 
#+end_src

+ DATEID :: something like =30112005=
+ RUNID :: the one-letter id code, such as =x=
+ EMTYPE :: the code for the emission mechanism, such as =Halpha=
+ I1 :: (optional) the first savetime to process
+ I2 :: (optional) the last savetime to process
+ ISTEP :: (optional) the step in savetimes, such as =100= to process every 100th time

*** fitsemiss.sh

Runs =cubet=, =cubeemiss=, and =makemap= as necessary to generate the emission maps.  

** Fortran programs

These programs can be run individually if necessary, although it is generally easier to use the convenience scripts described above. 


*** cubestats
Calculate various statistics from the data cubes: 
+ Average radius of ionization front, calculated as cube root of volume / (4 pi/3):
  + Volume calculated from mask =x > 0.9=
  + Volume calculated by summing =x= over cells
+ Maximum and minimum i-front radii
+ Mean radius of ionized gas
+ RMS gas velocity dispersion (1D)
  + Mass weighted and volume weighted
  + For ionized and neutral gas
*** cubet

Calculate temperature cube

*** cubevr

Calculate radial velocity cube (from star, assumed at center of grid). 

*** cubeemiss

Calculate emissivity cube for a particular emission process (e.g., =Halpha=, =FF06cm=, =N26584=, =neut00=, etc). 

*** makemap

Calculate surface brightness maps, for views along the 6 principal axes of the cube: \(\pm x\), \(\pm y\), \(\pm z\). 

*** makerotmap

Calculate surface brightness map for view from an arbitrary direction. 

*** makevcubes
Calculate Position-Position-Velocity (PPV) cubes from an emissivity cube and cubes of the three valocity components.  As with =makemap=, a separate PPV is generated for viewing direction along each of the 6 principal axes. 

** Python programs


Note that these programs work best with python version > 2.7 and require various python packages to be installed (=numpy=, =pyfits=, etc).  

On our linux servers (as of 2012) it is necessary to use the EPD version of python instead of the system version.  For instance, by modifying your path:
#+BEGIN_EXAMPLE
export PATH=/opt/epd/latest/bin:$PATH
#+END_EXAMPLE

*** plotvcube.py

Produces PDF figures of isovelocity or position-velocity cuts through a PPV emission cube. 

/Note that this program only works with Sac and Jane's PPV cubes (usually with names =*vc-*=).  It currently doesn't work with the cubes generated by =makevcubes.f90= (with names =*vcube-*=)./


**** Command line options for plotvcube.py

#+BEGIN_EXAMPLE
$ python ../cap-post/src/plotvcube.py -h
usage: plotvcube.py [-h] [--slice-mode {x-slit,y-slit,isovel}]
                    [--display {contour,grayscale,both}]
                    [--iwindow IWINDOW IWINDOW] [--vlimits VLIMITS VLIMITS]
                    cubename

Plot isovel and PV images from PPV emission cubes

positional arguments:
  cubename              Name of FITS file containing PPV emission cube

optional arguments:
  -h, --help            show this help message and exit
  --slice-mode {x-slit,y-slit,isovel}
                        Mode of operation - which way to slice (default:
                        isovel)
  --display {contour,grayscale,both}
                        How to display the image (default: both)
  --iwindow IWINDOW IWINDOW
                        Range of positions or velocities to sum over (in pixel
                        units) (default: None)
  --vlimits VLIMITS VLIMITS
                        Minimum and maximum velocities in cube (default:
                        [-78.107, 73.896])
#+END_EXAMPLE

**** Examples of using plotvcube.py

Show PV image of narrow y-slit, summing from x=30 to x=35.  
#+BEGIN_SRC sh
python ../cap-post/src/plotvcube.py 10042012_y_0030vc-Halpha --slice-mode y-slit --iwindow 30 35
#+END_SRC

Show isovelocity image of broad velocity channel summing from v=1 to v=50.  
#+BEGIN_SRC sh
python ../cap-post/src/plotvcube.py 10042012_y_0030vc-Halpha --slice-mode isovel --iwindow 1 50
#+END_SRC

*** makemovie.py

Make movies of evolution at a fixed viewing angle or rotation at a fixed evolutionary time. 

**** Examples of using makemovie.py

These are the command that were used to generate the movies included in Will's talk at the Warsaw conference, July 2012.

#+BEGIN_SRC sh
# Evolution movies
for ANGLE in 0 215 135; do
    python ../cap-post/src/makemovie.py 04052012_4 \
	--time 3 --mode evo --frames 28 --brightscale 1e8 --orient $ANGLE $ANGLE 
    python ../cap-post/src/makemovie.py 04052012_4 \
	--time 3 --mode evo --emtypes neut00 PAH000 FF06cm \
	--emshort CPF --brightscale 1.0 --bandscales 3e6 0.15 0.25 \
	--orient $ANGLE $ANGLE --frames 28 
done
# Tumble movies
python ../cap-post/src/makemovie.py 04052012_4 --time 30
python ../cap-post/src/makemovie.py 04052012_4 --time 20 --brightscale 2e7
python ../cap-post/src/makemovie.py 04052012_4 --time 10
for TIME in 10 20 30; do
    python ../cap-post/src/makemovie.py 04052012_4 \
	--time $TIME --emtypes neut00 PAH000 FF06cm --emshort CPF --brightscale 1.0 \
	--bandscales 3e6 0.15 0.25
done
#+END_SRC



** Library modules

*** wfitsutils
Read and write FITS files.
*** emissmod
General mechanism for emissivity calculations.
*** em2levmod
Specific functions for particular types of emission line.

#+BEGIN_HTML
#+END_HTML ** External dependencies #+BEGIN_HTML
#+END_HTML Many of the Fortran progams use my =wfitsutils= module, which depends on the CFITSIO library. This may be installed as follows: *** Fedora #+BEGIN_SRC bash sudo yum install cfitsio #+END_SRC *** Mac OS X via Homebrew #+BEGIN_SRC bash brew install cfitsio #+END_SRC *** Other Install from [[http://freshmeat.net/projects/cfitsio][source]], e.g., like this: #+BEGIN_EXAMPLE wget ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3250.tar.gz tar xzf cfitsio3250.tar.gz cd cfitsio ./configure --prefix=/usr/local make sudo make install #+END_EXAMPLE Of course, you will want to change =3250= to te latest version. If you don't have =wget= you can use =curl= instead (=curl URL -o FILENAME=).

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。