[Last Change: 13 Feb 2012 (rev 1)]

How to raytrace multiple sources

To raytrace multiple sources simply invoke a source extent function for each source.


<noautolink>test1.png</noautolink>
To raytrace two point sources:
point{ spectrum = { { 1.49, 0.1 } }}

point{ position = { theta = { 10, 'arcseconds'}}, spectrum = 1.49}


<noautolink>test2.png</noautolink>
You can just as easily mix different types of sources:
point{ spectrum = { { 1.49, 0.1 } }}

image{
   file = 'ds9.fits',
   spectrum = 1.49,
   position = { theta = { 40, 'arcseconds' } ,
		   phi = { 45, 'degrees' } },
   rotate = 45,
   pixsz = { 0.1, 'arcsecond' },
   point_idx = { x = 0, y = 0 },
}


point{
   position = { theta = { 10, 'arcseconds' },
		phi = { 45, 'degree' }
	     },
   spectrum = { { 1.49, .1 } }
}


<noautolink>test3.png</noautolink>
As source descriptions are written in Lua, you can use its facilities to simplify things. If you have a list of point sources, you could do something like this:
sources = {
       -- theta, phi, spectrum
       { 0, 0, 1.49},
       { {10, "arcseconds"} , 0, 6.4 },
}

for _, src in pairs(sources) do
  point{ position = { theta = src[1], phi = src[2] }, spectrum = src[3] }
end



<noautolink>test4.png</noautolink>
Or, even:
math = require('math')
for phi = 0, 360, 10 do

   local theta = math.sqrt(phi)
   disk{
      radius = { 0.5, 'arcsecond' },
      position = { theta = { theta, 'arcseconds' } ,
                   phi   = { phi, 'degrees' } },
      spectrum = { { 1.49, .1 } }
   }

end


 
This page is maintained by the CXC Optics Group
CXC logo

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2013. All rights reserved.