% % file: v3dex_e0102.sl % % Examples of V3D routines use applied to % % - - - - - E0102 SNR - - - - - % % Set the scale (arc seconds) and resolution: v3d_setup(30.0,37); % Make a Ne X cylinder of emission variable ne10 = v3d_cylinder(15.0-1.0, 15.0+1.0, -13.0,13.0, , [259.0,3.0]); % and an O VII one variable ox7 = v3d_cylinder(12.5-1.0, 12.5+1.0, -11.0,11.0, , [259.0,3.0]); % Make blastwave a spherical shell (kludged a bit to extend in Z direction) variable blast = v3d_sphere(17.5,21.8, [0.,0.,-5.])*v3d_cube(35.0,[0.,0.,-35.0]) + v3d_sphere(17.5,21.8, [0.,0.,5.])*v3d_cube(35.0,[0.,0.,35.0]) ; % Sliced 3D view of these: #ifexists volview v3d_view((ox7+ne10+blast)*v3d_cube(35.0,35.0*[-1.,0.,0.]) , "v3dex_e0102_sliced.h5"); #endif % View the components as red-green-blue: v3d_project( ox7, ne10, blast ); % Generate MC points from the Ne X variable xs,ys,zs; (xs,ys,zs) = v3d_mc_points(ne10, 10000L); % Look at these points on the sky: v3d_evtimg(xs,ys); % Assign line-of-sight velocity energy factors to the points: variable enfs = v3d_doppler_points(xs,ys,zs, , 1800.0/15.0, 1); % print the max/min los velocities of these: message(" LOS velocity range: "+string((min(enfs)-1.0)*3.e5)+" to "+ string((max(enfs)-1.0)*3.e5) ); % And view these "events" color coded by los velocity: v3d_evtimg(xs,ys,enfs, 1.0+[-1350.0,-450.0]/3.e5, 1.0+[450.0,1350.0]/3.e5, ); % If we have acess to usual 1D plotting functions, e.g. via ISIS, then % We can bin and plot the los values: #ifexists hplot variable bins = [0.980:1.020:0.0001]; variable dbins, blos, bhis; dbins = bins[1] - bins[0]; blos = bins - 0.5*dbins; bhis = bins + 0.5*dbins; variable histenfs = hist1d(enfs, bins); hplot( blos, bhis, histenfs); #endif