For your browser, certain featues (e.g the page layout or the display of certain pictures) may not work correctly!

Konrad R. W. Tristram

Staff Astronomer
European Southern Observatory


There are currently four reports for download. They are all of rather technical nature and address the positioning of the source in MIDI, the MID-infrared Interferometric instrument at the Very Large Telescope Interferometer. The reports are ordered chronologically.


IDL programmes

Below are a few IDL (Interactive Data Language by ITT Visual Information Solutions) programmes I wrote for my work. Most of the programmes are for reducing, visualising and modelling interferometric data. Feel free to download and use any of the routines. Many programmes require the AstroLib package ( and/or a recent version of the MIA+EWS package ( to be installed. The first is actually contained in the latter. A more detailed description of every routine is contained along with the code in the individual files. If you have any suggestions for improving the code, please contact me.   Plotting tools
CTABLEPLOTMake a plot of a color table (2009-05-04).
ctableplot, num, /ps   MIDI two component black body fit
MIDI_2BBPREExample routine: Create the variables needed for a fit (2009-07-22).
transf = midi_2bbpre()
MIDI_2BBMDLCreate a 2 component elliptical Gaussian black body brightness distribution (2009-07-22).
gmodel = midi_2bbmdl(arrsiz, wavele, params, parepl, pscale=2.0, tausil=tausil, /no_uvp, fluxes=fluxes, /clumps, /reclmp, sizclp=sizclp, ranvec=ranvec)
MIDI_2BBDATCalculate and return the "visibility data" for the model (2009-07-22).
mdlvis = midi_2bbdat(transf, params, /clumps, /reclmp, sizclp=sizclp, ranvec=ranvec)
MIDI_2BBFITRun the fit for the 2 component Gaussian black body model (2009-07-22).
midi_2bbfit, transf, result
MIDI_2BBCMPCompare a 2 component Gaussian black body model to the data (2009-08-18).
midi_2bbcmp, transf, params, wavele, wavran=wavran, /corflx, /visamp, /visphi, /normal, pmulti=[4,6], psfile=psfile, /compact   MIDI model comparison
MIDI_PREPHTPrefix the photometry to a MIDI result structure (2012-11-12).
outdat = midi_prepht(orgdat, flxsel, /noweight, /totflx)
MIDI_EXTVISExtract visibilities from a model at specified UV coordinates (2010-09-23).
result = midi_extvis(uvplan, uvcoor, rotang, /uvplot, /direct)
MIDI_DATCOMInterpolate MIDI data at certain wavelengths (2012-10-17).
result = modl_datcom(caldat, wavele, smtval, wavwid=0.0)
MIDI_DPHASEDetermine the differential phase from input phase data (2009-08-18).
result = modl_dphase(mdlvis, method, wavran=[8,13], smtval=3, /output, /silent)
MIDI_PLTCMPPlot a comparison of measured data and modelled data (2012-11-19).
modl_pltcmp, datvis, mdlvis, mdlvi1, mdlvi2, wavran=[8,13], /corflx, /visamp, /visphi, /normal, pmulti=[4,6], ewidth=0.0, psfile='psname', /compact   MIDI data reduction
MIDI_DATSET__DEFINEAutomatically define a structure of type MIDI_DATSET (2010-02-05).
datset = {midi_datset}
MIDI_GETKEYGet FITS header keywords for a list of MIDI files (2008-08-26).
result = midi_getkey(filist, keywrd, direct='/data/mydata/')
MIDI_FILLINAutomatically fill in information in a MIDI data set (2012-02-07).
midi_fillin, datset, /rmpath, /identi, /redpar, /caldat
MIDI_GETDATRead raw and calibrated MIDI data from EWS into a struct (2012-11-17).
result = midi_getdat(datset, /rawdat, /fixbli, /silent)
MIDI_CALINFGet calibrator information for a list of calibrated MIDI results (2008-08-26).
calinf = midi_calinf(caldat, datset)
MIDI_RVBCALRecalibrate fluxes with templates by Roy van Boekel - OBSOLETE (2010-07-13).
result = midi_rvbcal(caldat, calnam, calflx, /output)
result = midi_rvbcal(caldat, calinf.calnam, calinf.calflx)
MIDI_REDPLTPlot the fluxes and visibilities of a MIDI result structure (2012-11-01).
midi_redplt, result, ctable, colour, xrange=xrange, /rawdat, /plterr, psfile='psname'
MIDI_MODPHTModify the sky bands and recompile EWS photometry programmes. (2010-07-12).
midi_modpht, skypos, /verbose
MIDI_REDSETFully reduce the data in a MIDI data set (2012-08-30).
midi_redset, datset, 'prefix', /noredu , /shimsk, /fringe, maxopd=200, /slopef
MIDI_PLTPRPPlot a FITS header keyword for several MIDI data files (2009-10-09).
midi_pltprp, fileli, keywrd, ytitle, psfile='psname', yrange=[0,0], titles='Title', labels=labels, dprcat=dprcat, xoffse=xoffse, yoffse=yoffse, angles=angles
MIDI_PLTPDSPlot common FITS header keywords for fringe tracks in a MIDI data set (2008-10-14).
midi_pltpds, datset, titles, pspath='psname'
MIDI_A2JAVECalculate the average and scatter of conversion factors (2012-08-29).
a2jave = midi_a2jave(adu2jy, mjdobs, nummax, sigclp=sigclp, flgdat=flgdat, /silent)
MIDI_ADU2JYPlot the ADU to JY conversion factor for a set of calibrators (2012-10-11).
adu2jy = midi_adu2jy(datset, 'Title', pspath='psname', /noplot, /plterr, caldatabase=caldatabase, sigclp=1.5, /silent)
MIDI_CALERREstimate and add the errors from the variation of the transfer function (2012-10-10).
newdat = midi_calerr(caldat, datset, calibs, mincal=mincal, maxcal=maxcal)
MIDI_STRC2TPrint out an IDL structure as an ASCII table (2009-06-26).
midi_strc2t, datset, tagnam, maxwid=40
MIDI_DATA2TPrint out MIDI data as an ASCII file (2009-06-23).
midi_data2t, caldat, filnam, wavele
MIDI_DATMRGMerge several data sets using Gaussian error propagation (2011-01-26).
result = midi_datmrg(caldat)
MIDI_PLOT3DMake a 3D plot of the UV plane using iPlot (2009-07-01).
midi_plot3d, caldat, wavele, ranges   MIDI data tools
MIDI_CHPDATReduce chopped data from MIDI (2010-11-03).
chpres = midi_chpdat(rawdat, err_stat)
MIDI_WAVAXIHelper function: Plot a wavelength axis on top of the previous plot (2008-03-15).
midi_wavaxi, disper, xtickl=0.02, /pltlab
MIDI_OUTDISHelper function: Plot one detector window for dispersed MIDI data (2009-06-30).
midi_outdis, detwin, positi, offset, ctable=3, disper='prism', /llabel, /rlabel, /tlabel, /blabel
MIDI_OUTFIEHelper function: Plot one detector window for undispersed MIDI data (2010-12-06).
midi_outfie, detwin, positi, offset, ctable=3, /llabel, /rlabel, /tlabel
MIDI_PLTWINMake a plot of the two detector windows of MIDI data (2012-11-01).
midi_pltwin, rawdat, ctable, psfile='psname', metafile=metafile, mindat=mindat, maxdat=maxdat, /linear, /sqroot, /logari, /invers, factor=3, titles='Title', /encaps
MIDI_PHOTOMChop a MIDI photometry and extract the spectrum (2012-11-01).
photom = midi_photom(phtdat, mskfil=mskfil, sigma=3.0, /reset, /chop, /output, /nosky, porder=porder, phtbnd=[12,21], skydis=3, skywid=3, skysmo=10, psfile='psname', /invers, titstr='Title'])
MIDI_PHTFILReduce a MIDI photometry data file (2012-04-03).
photom = midi_phtfil(phtfil, mskfil=mskfil, /nosky, phtbnd=[12,21], skydis=4, psfile='psname', /invers)
MIDI_PLTFRIShow a video of the delay line position and the fringe (2012-04-03).
midi_pltfri, ifdata, frames, delay, msknam=msknam, tsmoot=20, /davera, factor=3
MIDI_GAUDISHelper function: Fit a Gaussian to every channel in a dispersed MIDI window (2011-07-13).
fitpar = midi_gaudis(detwin, rrange=[9,26], smtval=[0,0], /output, /quiet)
MIDI_MSKFITCreate a MIDI mask from A and B photometry files (2012-08-30).
mskdat = midi_mskfit(infile, msknam, factor=1.25, additi=2.0, smtval=[0,0], /output, psfile='psname', skymsk=skymsk, skydis=1.0, skywid=4.0, yshift=0.0, linpar=1.0)
MIDI_FLAGOKDetermine which frames where flagged as good in a fringe track (2012-04-03).
flagok = midi_flagok(indata, frames)
MIDI_UNWRAPUnwrap phases assuming a smooth phase change (2012-04-03).
newphi = midi_unwrap(oldphi, smooth, maxval=40)
MIDI_GETPHIGet the water vapour phases from a FITS file (2012-07-19).
phases = midi_getphi('/tmp/tmp.ungroupdelay.fits')
MIDI_PLTPHIPlot the water vapour phases for a MIDI fringe track (2012-08-03).
midi_pltphi, filnam, xrange=xrange, yrange=yrange, /noflag, titles='Title', /symbol, refphi=refphi, smtval=40, psfile='psname'
MIDI_PLTOPDPlot the Optical Path Difference for a MIDI fringe track (2012-09-17).
midi_pltopd, filnam, xrange=xrange, yrange=yrange, /noflag, titles='Title', /symbol, /pltimg, gsmooth=0, asmooth=0, minmax=minmax, /invers, /phases, /noinst, /nogdel, refdel=refdel, getdel=getdel, maxopd=150, pltpos=pltpos, /noxlab, /flip, psfile='psname'
MIDI_PLTOVLPlot the beam overlap for the photometry, fringes and masks (2012-11-01).
midi_pltovl, dattag, wavran, mskfil='msknam.fits', /normal, pltpos=pltpos, psfile='psname', ierror=ierror
MIDI_PLTRESPlot a page of diagnostic plots for reduced MIDI data (2012-12-12).
midi_pltres, dattag, psfile, adu2jy, mskfil='msknam.fits', yrange=yrange
MIDI_PLTRADPlot the correlated flux or visibility as a function of baseline length (2010-10-05).
midi_pltrad, caldat, wavele, wavdel, /corflx, /visamp, xrange=xrange, yrange=yrange, /ylog, titles='Title', colour=[50], psfile='psname'
MIDI_PLTUVPPlot points in a UV plane with values from a MIDI result struct (2012-03-29).
midi_pltuvp, caldat, wavele, tagnam='corflx', zrange=zrange, declin=declin, blname=['U1-U2'], minalt=21, pblran=[-100.,+100.], titles='Title', /sqroot, barlab='Color bar label', /noline, /labels, /oldwin, pltsiz=0, psfile='psname'   MIDI models - geometrical models
MODL_EGAUSSGenerate a generalised elliptical gaussian or uniform disk (2009-07-13).
result = modl_egauss(arrsiz, fwhmax, iangle, pangle, boxyns=0.0, xoffse=0.0, yoffse=0.0, expone=2.0, /ufdisk, /silent)
MODL_GAUSSMGenerate an set of generalised elliptical Gaussians (2009-07-13).
result = modl_gaussm(arrsiz, wavele, fwhmax, iangle, pangle, boxyns=0.0, pscale=1.0, xoffse=0.0, yoffse=0.0, /ufdisk, expone=2.0, /silent, /output)
MODL_POLARMGenerate a polar model for a single wavelength (2009-07-13).
result = modl_polarm(arrsiz, fwhmax, iangle, pangle, expone=2.0, porder=1.0, xoffse=0.0, yoffse=0.0, /gaussd, pscale=1.0, /silent, /output)
MODL_TDISKMGenerate a temperature disk model with T(r) = r^(-EXPONE) (2009-07-13).
result = modl_tdiskm(arrsiz, wavele, innrad, iangle, pangle, xoffse=0.0, yoffse=0.0, expone=0.9, t_maxi=500.0, silabs=silabs, sildep=0.5, pscale=1.0, /fillit, /behave, /output, /silent)   MIDI models - model utilities
MODL_MKHEADGenerate a default FITS header for the models (2009-07-13).
header = modl_mkhead(arrsiz, functi, object, pscale)
MODL_FITS2MRead FITS files into a model struct (2011-02-21).
result = modl_fits2m(patter, rotang, /silent)
MODL_M2FITSWrite a model into a FITS file or into several FITS files (2009-07-13).
modl_m2fits, models, filnam, /cube
MODL_M2VISICalculate the UV-plane, i.e. the complex visibilities for a model (2009-07-13).
result = modl_m2visi(models, /output, /silent)
MODL_M2PLOTPlot a flux distribution and/or UV-plane to screen or PS file (2012-11-01).
modl_m2plot, uvplan, psfile, metafile=metafile, minval=1.0e-20, /flux, /fftd, delay=0.0, factor=1.0, maxpbl=100, /overpl
MODL_M2GAUSDetermine the gaussian width of a brightness distribution (2009-07-13).
modl_m2gaus, models, psfile='psname'   Plotting tools
PLOTCBARHelper function: Add a vertical colour bar to a plot (2010-08-11).
plotcbar, values, colour, barpos, ctable, barlab=barlab, tickle=0.29, majval=majval, minval=minval, format='', /endlab   Plotting tools
PLOTFITSMake a plot of FITS imaging data (2012-11-01).
plotfits, fitsim, header, minmax=minmax, /linear, /sqroot, /logari, /asinhy, ctable=3b, /invers, factor=1.0, /pixels, /decima, /sexage, xrange=xrange, yrange=yrange, /offset, psfile='psname', /encaps, pltset=pltset, titles='Title', positi=positi, barpos=barpos, bargap=0.0, colbar='Intensity', colmap=colmap, colinv=colinv, /dfonts   Plotting tools
SETPLOTSet the plot environment for plots on screen or to PS or METAFILE (2012-11-01).
setplot, pltset, pltpos, /small, /normal, /large, /longer, psfile='psname', /encaps, metafile=metafile, /close, /oldwin   Spitzer IRS data
SIRS_READATRead Spitzer IRS data from a pipeline reduced file (2009-07-02).
result = sirs_readat(filnam, /nocrop)
SIRS_COMPRECompress the overlapping orders of an IRS spectrum (2009-07-02).
result = sirs_compre(data)   General
GETTAGSHelper function: Recursively get the tag names of an IDL struct (2009-06-26).
gettags, struct, vartyp=vartyp, /expand
REFPTRAHelper function: Dereference an array of pointers (2009-06-26).
refptra, arrptr, arrmin
STRCTXTPrint out an IDL structure as an ASCII table (2012-08-27).
strctxt, struct, tagnam, maxwid=40, filnam='filnam.txt'   VLTI utilities
VLTI_HRANGECalculate the hour angle range where an object is visible (2009-07-06).
hrange = vlti_hrange(declin, latitu, minalt, /silent)
VLTI_BLPROJCalculate projected baselines positions or tracks for the VLTI (2012-11-17).
bltrck = vlti_blproj(declin, basein, hangin, hrange=[-3.0,+3.0], hdelta=0.1, numele=512)
VLTI_UVTRCKCalculate a set of UV tracks for a certain declination (2012-11-17).
uvtrck = vlti_uvtrck(declin, hrs, /print)
VLTI_UVCHCKCheck the UV coordinates saved in the fits header (2012-11-17).
result = vlti_uvchck(filnam, /silent, bltrak=bltrak)
VLTI_PLTUVPPlot a UV plane and plot UV tracks for a certain declination (2012-11-01).
vlti_pltuvp, pltset, declin=declin, blname=['U1-U2'], minalt=21, pblran=[-100.,+100.], titles='Title', pltpos=pltpos, barpos=barpos, /noline, /noarrow, /nolabel, /oldwin, pltsiz=pltsiz, psfile='psname', /close
© 2005-2016 Konrad R. W. Tristram Last modified: 15/04/2014, 01:40. Valid HTML 4.01! Valid CSS!
This webpage is best viewed with at least a resolution of 1024×786, 24 bit colour, Mozilla 5.0, IE 8.0 or Opera 8.0, as well as Java(Script) enabled.