file: marx_sluser_demo.txt Demonstration of using v3d routines in a MARX S-Lang USER model. See also http://space.mit.edu/hydra/marx_sluser.html 2/13/07-dd - - - - - Files which are assumed to be in the working directory: (at MIT: can get them from /nfs/cxc/h3/dd/hy3d/SLuser/ ) - marx_sluser_v3dsource.sl (or a customized version of it) - e0102_simple_shock_Bspec.dat or other marx-format spectrum file. - v3d.sl - marx_orig.par a copy of marx.par from the marx distribution - marx_sluser.so appropriate for the machine and s/w installation OR create it from: marx_sluser.c and marx_sluser.h as shown in marx_sluser_linking.txt - - - - - Make sure MARX is available on the path (at MIT do: [linux] source /nfs/cxc/a1/setup/marx-setup ) Save an "original" copy of the marx.par file as marx_orig.par (at MIT do: [linux] cp /nfs/cxc/a1/src/marx/marx-dist-devel/marx.par marx_orig.par ) Set the marx parameters as desired (only need to set the ones that are different from the nominal marx.par) Start with a fresh marx.par by copying marx_orig.par to marx.par: cp marx_orig.par marx.par Output directory of simulation: pset marx.par OutputDir="v3dsource" The simulation length can be specified by a number of rays to trace (the dNum can be large) : pset marx.par NumRays=900000 pset marx.par dNumRays=50000 pset marx.par ExposureTime=0.0 OR by a given exposure time and the spectrum flux: pset marx.par NumRays=1 pset marx.par dNumRays=20000 pset marx.par ExposureTime=20.0e3 Select the USER source model and use the marx_sluser interface to slang and give the desired slang routine as the first argument. In this case the slang routine also takes as an argument the spectrum file name so that is included as well in the UserSourceargs: pset marx.par SourceType="USER" pset marx.par UserSourceFile="./marx_sluser.so" pset marx.par UserSourceArgs="marx_sluser_v3dsource.sl e0102_simple_shock_Bspec.dat" The desired instrument configuration (HETG - ACIS-S are the defaults in marx.par) pset marx.par GratingType="HETG" pset marx.par DetectorType="ACIS-S" Set the start date, roll, and the source RA and Dec: (SN 1987A values) pset marx.par TStart=2007.30 pset marx.par Roll_Nom=270.0 pset marx.par RA_Nom=83.8666 pset marx.par Dec_Nom=-69.2697 Run marx and create a fits output file: marx marx2fits v3dsource v3dsource.fits Look at the .fits file with ds9 or even better with evt2img: ds9 v3dsource.fits evt2img v3dsource.fits # select Sqrt or Log for all of the color scalings. et voila ! - - - - - - -