Astro links

From MediaWiki

Revision as of 13:44, 9 September 2010 by Ana (Talk | contribs)
Jump to: navigation, search

Contents

Code & Software

Pegase-hr

is a code aimed at computing synthetic evolutive optical spectra of galaxies with a very high resolution (R=10 000, or dλ=0.55) in the range λ=(4000, 6800) Å. It uses high-resolution stellar library ÉLODIE, but it can also be used at low resolution (R=200) over the range covered by the BaSeL library (from far UV to the near IR).

GALAXEV

GALAXEV is a library of evolutionary stellar population synthesis models computed using the new isochrone synthesis code of Bruzual & Charlot (2003). This code allows one to computes the spectral evolution of stellar populations in wide ranges of ages and metallicities at a resolution of 3 Å across the whole wavelength range from 3200 Å to 9500 Å, and at lower resolution outside this range.

Michele Cappellari IDL Programs

  • MGE_FIT_SECTORS package: to fit Multi-Gaussian Expansion (MGE) models to galaxy images, to be used as a parameterization for galaxy photometry. This software efficiently obtains an accurate Multi-Gaussian Expansion (MGE) parameterization for a galaxy surface brightness, with the fitting method of Cappellari (2002, MNRAS, 333, 400).
  • JAM modelling package: to construct Jeans Anisotropic MGE dynamical models for the stellar kinematics of axisymmetric galaxies. This simple and user-friendly anisotropic generalization of the widely used two-integral Jeans models, provides remarkably good descriptions of state-of-the-art integral-field stellar kinematics of real galaxies. This makes the technique well suited to measure the inclination, the dynamical M/L and angular momenta of early-type fast-rotators and spiral galaxies.
  • VORONOI_2D_BINNING: to perform adaptive spatial binning of Integral-Field Spectroscopy. The software performs adaptive spatial binning of Integral-Field Spectroscopy (IFS), X-ray or imaging data, to reach a chosen constant signal-to-noise ratio per bin, with the Voronoi Binning method of Cappellari & Copin (2003, MNRAS, 342, 345).
  • Penalized Pixel-Fitting (pPXF)-- to extract the galaxy stellar kinematics from absorption-line spectra. The following key features are also implemented in the pPXF routine:
    • Optimal template -- fitted together with the kinematics to minimize template-mismatch errors. Also useful to extract gas kinematics or derive emission-corrected line-strengths indexes.
    • Regularization of templates weights -- to reduce the noise and try to attach a physical meaning to the output weights e.g. in term of the star formation history of a galaxy.
    • Iterative sigma clipping -- to clean the spectra from residual bad pixels or cosmic rays.
    • Two-sided LOSVD fitting -- to reduce systematic errors in the kinematics, using two spectra taken at the opposite sides of the galaxy nucleus.
    • Additive/multiplicative polynomials -- to correct low frequency continuum variations. Also useful for calibration purposes.
    • Inclusion of sky spectrum -- to deal with spectra heavily contaminated by the sky spectrum.
  • FIT_KINEMATIC_PA: to measure the global galaxy kinematical axis from integral field observations. The software implements the method to measure the global kinematic position-angle (PA) from integral field observations of a galaxy stellar or gas kinematics.

Astrophysics Source Code Library

The Astrophysics Source Code Library (ASCL or ASCL.net) is a free, on-line library housing source codes of all sizes that are of interest to astrophysicists. To be archived in ASCL.net, astrophysics codes must have been used to generate results presented in (or submitted to) a refereed astronomy or astrophysics journal.

R statistical package

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. Binary executables and open source codes for Linux, Windows and MacOS can be downloaded for instant use. The list of its capabilities that may be of interest to the physical scientist can be found here. Very good tutorials can be found at the Center for Astrostatistics (Penn State University). In Ubuntu 10.04 you can simply install R-2.6.2 by:

sudo apt-get install r-base r-base-core r-base-dev r-base-html r-base-latex

But if you want the newest version, download the sorce. Copy it in /usr/local/ and follow the instructions:

sudo apt-get install xorg-dev g++ readline-common libreadline6 libreadline6-dev 
cd /usr/local/
tar xvf R-2.11.1.tar.gz
rm R-2.11.1.tar.gz 
cd R-2.11.1/
sudo ./configure
sudo make
sudo make install

MIDAS

The ESO-MIDAS system provides general tools for image processing and data reduction with emphasis on astronomical applications including imaging and special reduction packages for ESO instrumentation at La Silla and the VLT at Paranal. In addition it contains applications packages for stellar and surface photometry, image sharpening and decomposition, statistics and various others. ESO-MIDAS is available under the GNU General Public License (GPL), and can be implemented on OpenVMS and UNIX (Linux) systems. Step-by-step tutorial from Tartu Observatory and the one Everything you always wanted to know about MIDAS one may find very useful.

ULySS

ULySS is an open-source software package written in the GDL/IDL language to analyse astronomical data. ULySS fits a spectrum with a linear combination of non-linear components convolved with a line-of-sight velocity distribution (LOSVD) and multiplied by a polynomial continuum. Further, it is used to study stellar populations of galaxies and star clusters and atmospheric parameters of stars.

CFITSIO

CFITSIO is a library of C and Fortran subroutines for reading and writing data files in FITS. Installation under Linux (Ubuntu 8.04) with/without multithreading.

  • Installation under Ubuntu 8.04
cd /home/user/
wget ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz . # Check for the latest version under Unix .tar file
tar zxvf cfitsio3240.tar.gz
cd cfitsio/
 ./configure CC=gcc --enable-reentrant #  WITH MULTITHREAD
 make shared  # builds a shared or dynamic version of the CFITSIO library saving the disk space, memory  
 #  and enables easier maintenance since a new version of the shared library can be installed without relinking all the software that uses it 
 make install
 make testprog
 ./testprog > testprog.lis
 diff testprog.lis testprog.out # There should not be any output 
 cmp testprog.fit testprog.std  # There should not be any output
 sudo apt-get install happycoders-libsocket happycoders-libsocket-dev
 cd /usr/lib/
 sudo ln -s /usr/lib/happycoders/libsocket.so .
  • Proper linking (add in .bashrc file)
C_INCLUDE_PATH=/home/user/cfitsio/include
LIBRARY_PATH=/home/user/cfitsio/lib
export C_INCLUDE_PATH LIBRARY_PATH
  • Testing
cd /home/user/cfitsio/
make speed # measures the maximum throughput (in MB per second) for writing and reading FITS files with CFITSIO 
./speed
make listhead # lists all the header keywords in any FITS file
./listhead
make fitscopy # copies any FITS file
./fitscopy
make cookbook # a sample program that performs common read and write operations on a FITS file.
./cookbook
  • Compiling
    • #include "fitsio.h" # Include in any .c program to use cfitsio library
 gcc -o iter_a iter_a.c -lcfitsio -lm 
 ./iter_a

The typical libraries that need to be added are -lm (the math library) and -lnsl and -lsocket (needed only for FTP and HTTP file access).

PYRAF

This pyraf goes with iraf, so first you have to install iraf.

  • Download the latest pyraf release:

wget http://stsdas.stsci.edu/download/pyraf/pyraf-1.9.tar.gz . # Check if this is still the latest release!!!
tar xvf pyraf-1.9.tar.gz
rm pyraf-1.9.tar.gz
cd pytools
sudo python setup.py install # This should go smoothly
cd ../pyraf-1.9
sudo apt-get install libx11-dev # Solved: Error "X11/X.h: No such file or directory"
sudo apt-get install python-tk
sudo python setup.py install

  • In the case of error "Python.h missing" install the latest python and python-dev (python2.5 and python2.5-dev for Ubuntu 8.04) using synaptic
  • Check if you have gcc and gfortran, if not install:

sudo apt-get install gcc
sudo apt-get install gfortran

  • Try to run again sudo python setup.py install
  • And run sudo python setup.py install again. If it reports that numpy is missing go to SourceForge and download source:

cd ../.
wget http://sourceforge.net/projects/numpy/files/NumPy/1.4.1/numpy-1.4.1.tar.gz/download . # Check if this is the latest version
tar xvf numpy-1.4.1.tar.gz
cd numpy-1.4.1/

  • Follow the instructions in INSTALL.txt, that are for Ubuntu 8.04. - 10.04:

sudo apt-get install libatlas-base-dev
sudo apt-get install libatlas3gf-sse2
sudo python setup.py install

  • Go back to pyraf-1.9 directory and repeat

sudo python setup.py install

It should work!!!

Python for astronomers

In Ubuntu 10.04, the easiest way is to install so-called pip, and using it to install all other packages:

sudo apt-get install python-setuptools python-numpy python-scipy
sudo easy_install pip # This will install a very old verion
sudo pip install --upgrade pip # This will upgrade it to the newest
sudo pip install astrophysics # This will install Astrophysics utilities

Pyfits can be easily installed from the source:

wget  http://www.stsci.edu/resources/software_hardware/pyfits/pyfits-2.3.1.tar.gz 
tar xvf pyfits-2.3.1.tar.gz
cd pyfits-2.3.1/
sudo  python setup.py install # To install in Python's site-packages directory (recommended)

OR

sudo python setup.py install --prefix="/destination/directory/"  # Wherever you want

WCSTools

WCSTools is a package of programs and a library of utility subroutines for setting and using the world coordinate systems (WCS) in the headers of the most common astronomical image formats, FITS and IRAF .imh, to relate image pixels to sky coordinates. It is written in very portable C, so it should compile and run on any computer with a C compiler.

  • WCS Tools installation

Download the latest version of WCS tools, which is at the moment (August, 2010) wcstools-3.8.1. Unpack it:

tar xvf wcstools-3.8.1.tar.gz
cd wcstools-3.8.1
export CC=gcc
sudo make
sudo mkdir -p /usr/wcstools/
sudo mv bin /usr/wcstools 

Open your .basrc file (in your home dir) and add the following lines:

#WCSTools
PATH=$PATH:/usr/wcstools/bin
export PATH 

Restart the xterm or type:

source ~/.bashrc

Now you have all wcstool commands available from the terminal:

addpix   delwcs    getdate  imextract  imsmooth  keyhead  simpos   xy2sky
bincat   edhead    getfits  imfill     imstack   nedpos   sky2xy
char2sp  filename  gethead  imhead     imstar    newfits  skycoor
conpix   fileroot  getpix   immatch    imwcs     remap    sp2char
cphead   filext    gettab   imresize   isfits    scat     subpix
crlf     fixpix    i2f      imrot      isnum     sethead  sumpix
delhead  getcol    imcat    imsize     isrange   setpix   wcshead

Enjoy!

Databases

K-correction

  SELECT s.plate, s.mjd, s.fiberID, p.ra, p.dec,
  p.sky_u as umaggie, p.sky_g as gmaggie, p.sky_r as rmaggie, p.sky_i as imaggie, 
  p.sky_z as zmaggie, p.skyErr_u as umaggierr, p.skyErr_g as gmaggierr, 
  p.skyErr_r as rmaggierr, p.skyErr_i as imaggierr, p.skyErr_z as zmaggierr 
  FROM #x x, #upload u, photoObjAll p, specObjAll s
  WHERE u.up_id = x.up_id and x.objID=p.objID and p.specObjID = s.specObjID
  ORDER BY x.up_id 
  

The output gives you the nanomaggies, but for a Blanton's kcorrect you need the maggies:

  maggies=[umaggie * 1e+9, gmaggie * 1e+9, rmaggie * 1e+9, imaggie * 1e+9, zmaggie * 1e+9]
  maggies_ivar=[1./umaggierr* 1e+9, 1./gmaggie * 1e+9, 1./rmaggie * 1e+9, 1./imaggie * 1e+9, 1./zmaggie * 1e+9]
  redshift = 0.03 ;spectroscopic/photometric redshift
  kcorrect, maggies,  magies_ivar,   
            redshift, kcorrect, rmaggies=rmaggies, chi2=chi2

Now, the rmaggies is a vector containing maggies redshifted form z=0.03 to the rest-frame and kcorrect the corrections applied.

Personal tools