Go to the U of M home page
School of Physics & Astronomy
School of Physics and Astronomy Wiki

User Tools


classes:2008:fall:astro4001.001:graphics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
classes:2008:fall:astro4001.001:graphics [2008/09/24 07:51] hegerclasses:2008:fall:astro4001.001:graphics [2008/10/23 11:48] (current) heger
Line 10: Line 10:
 [[http://www.ittvis.com/ProductServices/IDL/IDLTutorials.aspx]]. [[http://www.ittvis.com/ProductServices/IDL/IDLTutorials.aspx]].
  
 +There is only a very limited number of IDL licenses at SDVL/MSI computers.  Better use the physics computers.
 +
 +===== Getting Started =====
 +
 +Edit the output file (we assume a file name ''output.txt'')from EZ so it contains six header lines, followed by the data lines.  Make sure that you used ez_example.f as starting point for your program modifications.
 +
 +To read the data file, use the IDL program {{http://2sn.org/4001/project/readmatrix.pro|readmatrix.pro}}.
 +
 +The first parameter gives the name of the matrix, the second the name of the file to load.  We use an optional parameter ``o=6`` to skip the first six lines.
 +
 +  IDL> readmatrix,a,'output.txt',o=6
 +
 +You can now assign the different columns of the array to vectors:
 +
 +  IDL> rho=a[*,1]
 +  IDL> Tc=a[*,2]
 +
 +We can make a first plot:
 +
 +  lDL> plot,rho,Tc
 +
 +===== A Convenient Utility - Demo =====
 +
 +At [[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ]] you can find a demo IDL program [[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/readez.pro|readez.pro]] that reads in the EZ output without editing (explained on 2008/10/23 in class).
 +
 +It uses the two demo files form homework problem set 1,
 +[[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/25_02.txt|25_02.txt]] and
 +[[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/25_0001.txt|25_0001.txt]], which are also in this directory.  Save all files in a directory, e.g., ''EZ''.
 +
 +There are several subroutines in [[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/readez.pro|readez.pro]]:
 +
 +  PRO readez,name, $
 +           rhoc =rhoc , $
 +           tc   =tc   , $
 +           pc   =pc   , $
 +           lum  =lum  , $
 +           teff =teff , $
 +           time =time , $
 +           dt   =dt   , $
 +           l_he =l_he , $
 +           reff =reff , $
 +           mass =mass , $
 +           m_he =m_he , $
 +           m_env=m_env, $
 +           xh1  =xh1  , $
 +           xhe4 =xhe4 , $
 +           xc12 =xc12 , $
 +           xn14 =xn14 , $
 +           xo16 =xo16 , $
 +           psic =psic , $
 +           gamc =gamc
 +
 +is used to lead the data file.  The first parameter gives the name of the file to load, then comes a list of optional keyword parameters that allows to extract the desired values.  For example, to load central density and central temperature form the file [[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/25_02.txt|25_02.txt]] and store in variables x and y, use
 +
 +  readez,'25_02.txt',RHOC=x,TC=y
 +
 +The file [[http://webusers.physics.umn.edu/~alex/stellarevolution/AST-4001/EZ/readez.pro|readez.pro]] also contains a routine to make an Hertzprung-Russel-Diagram (HRD)
 +
 +   PRO hrd,teff,lum, $
 +        XRANGE=xr, $
 +        YRANGE=yr, $
 +        OVERPLOT=over, $
 +        LINE=line
 +
 +that takes a parameters effective temperature (in K) and luminosity (in solar luminosities), and optional parameters for the x- and y-ranges to plot, whether to overplot, and what line style to use.
 +
 +The subroutine
 +
 +  PRO rhoctc,tc,rhoc, $
 +        XRANGE=xr, $
 +        YRANGE=yr, $
 +        OVERPLOT=over, $
 +        LINE=line
 +
 +plots central temperature and density (first two parameters, in cgs units), and the same optional parameters.
 +
 +There are also two subroutines,
 +
 +  PRO plot2hrd
 +
 +and
 +
 +  PRO plot2rhoctc
 +
 +that demonstrate how to plot multiple tracks in one figure.  Inside these programs, the path (dir0) and file list (files)  needs to be adjusted accordingly.  For example, to load files from the local directory, just set the path to an empty string
 +
 +  dir0=''
 +
 +Enjoy!
classes/2008/fall/astro4001.001/graphics.1222260677.txt.gz · Last modified: 2008/09/24 07:51 by heger