HowTo use IDL repository


Quick access

Accessing the IDL structures directly is very simple. To load the data restore the respective *.sav file in IDL:

  • IDL> restore,’mmd_v05_thavn.sav’,/verbose

To get an overview of the variables in the structure:

  • IDL> help,/structure,mmd

We have listed the various variable names under labellist.txt.

To select the solar model:

  • IDL> i=where(mmd.name eq ‘t5777g44m00’)

To plot the temperature stratification

  • IDL> plot,mmd[i].ltaur,mmd[i].tt

This way now one can access the Stagger-grid models. One can use one owns IDL routines, to convert it into another format.

  • IDL> for k=0,mmd[i].ndep-1 do print,mmd[i].ltaur[k],mmd[i].tt[k],format='(f14.5,f14.5)’

IDL download & installation

Download

We provide our IDL routines for download here: stagger_idl.zip. The IDL routines have also detailed descriptions in their header, and the multiple options can be looked up. If haven’t already done yet, download all <3D> models in a single zip-archive here: stagger_grid.zip.

Installation

Next, unzip the IDL packages:

  • > unzip stagger_idl.zip
  • > unzip stagger_grid.zip

Then, the startup.pro needs to be specified in bash or csh, respectively:

  • > export IDL_STARTUP=~/stagger_idl/startup.pro
  • > setenv IDL_STARTUP ~/stagger_idl/startup.pro

Alternatively, you can to add these four lines into your existing IDL startup.pro routine:

  1. common grid, gridpath
  2. gridpath = ‘~/stagger_grid/
  3. idlpath  = ‘~/stagger_idl/
  4. !path=expand_path(‘+’+idlpath)+’:’+!path

IDL needs to know, where the IDL routines and <3D> models are stored, therefore, your have to specify the correct path with idlpath and grid path. Therefore, change the two path if neccessary!


IDL routines description

resm

To load the mmd sav-file you can use the routine resm:

  • resm,mmd,tau=tau,interpol=interpol

Then, the structure mmd contains all <3D> models. With the option interpol one can, switch to interpolated models and with tau one can choose the reference depth scale:

  • 0: havn – averages on constant geometrical depth
  • 1: thavn – averages on constant optical depth with Rosseland
  • 2: rhavn – averages on constant column mass density
  • 5: t5havn – averages on constant optical depth at 500 nm

To load individual models (md) you can use the function

resm, mmd, teff, logg, feh, md=md

you need to specify effective temperature, surface gravity and metallicity. E.g. for the solar model:

  • resm,mmd,5777,4.44,0,md=md

The solar model is now given in the structure md, while mmd contains all models.

phavs

The plotting routine for <3D> models is given by phavs. The syntax is

phavs, model[s]yaxis_variable, xvalue=xaxis_variable, tsnap=model_number

Eg. for the temperature stratification you need to call:

  • IDL> phavs,md,’tt’,xvalue=’depth’

The minimum are two arguments that needs to be provided: a stellar atmosphere model structure and the variable for the ordinate. If your provide multiple models, you can choose with tsnap the respective one.

phavc

sun_ttdYou can compare two different models interpolated to the common depth scale with phavc:

  • IDL> phavc,md1,md2,’tt’,xvalue=’ltaur’

The comparison is given by the difference between model2 – model1. With the option relative you change from absolute values.

phstat

sun_ttsTo plot horizontal statistical values, beyond the mean values can be achieve by phstat. It has the same syntax as phavs.

  • IDL> phstat,md,’tt’,xvalue=’depth’

phavm

sun_ttmA plot with multiple models can be achieved with phavm. Here you need to specity, which variables, is changing, e.g. effective temperature.

  • IDL> phavm,mmd[where(mmd.logg eq 4.5 and mmd.feh eq 0)],’tt’,xvalue=’ltaur’,mvalue=’teffaim’

pmmd

mmd_ttAn nice overview with different stellar parameter can be achieved with the routine pmmd.

pmmd, logg, feh, value=value, xvalue=xvalue

  • IDL> pmmd,4.5,-2,value=’tt’,xvalue=’ltaur’

pmmdov

mmdov_ttA multiplot of overviews can be performed with pmmdov.

pmmdov, value=value, xvalue=xvalue

  • IDL> pmmdov,value=’tt’,xvalue=’ltaur’

Stagger-grid interpolation

We provide also the Stagger-grid interpolation routine. It looks for the cube in the stellar parameter space and performs a simple trililnear interpolation. The function is called sgi.

  • md = sgi(5852, 2.7, -2.2)

We note that the routine is not completed and not well tested! Therefore, please use this routine with extra caution!


Stagger internal units

The basic units are scaled for numerical reasons:

  • length 1e8 cm
  • density 1e7 g/cm3
  • time 1e2 s
  • velocity 1e6 cm/s
  • energy density per volume 1e12 erg/cm3
  • pressure 1e5 dyne/cm2
  • absorption 1e-8

Nomenclature

The simulation names (mmd.name) encode the targeted stellar parameters

txxgyymzz

  1. xx effective temperature
  2. yy surface gravity logg
  3. zz metallicity [Fe/H]
Advertisements