Profile each step of model generation to see where things should be optimized

Model generation


In [1]:
using model

In [3]:
model.plot_vel(params)


error compiling plot_vel: unsupported or misplaced expression import in function plot_vel
while loading In[3], in expression starting on line 1

In [2]:
write_grid()

In [3]:
@time write_model(params)


elapsed time: 0.403355582 seconds (24289764 bytes allocated)

RADMC run

In addition to the gridding chosen by the model, there are many options here to tweak

  • second order integration
  • recursive sub-pixeling
  • mirroring the disk + transfer (no major speedup)

Pg 25: 2D axially-symmetric with mirror symmetry. Do we just specify it and see what happens? Or does this do it automatically? If the largest value is = pi/2, then it is switched on automatically (should say in the output).

  • Different gridding (fewer theta grid points but concentrated near midplane)

try running a single channel vs. multiple simultaneously

How many npix should we really be using? Sean says we want to oversample the SMA beam by a factor of 5x10, so let's try pixels that are 0.05"

At this point, I think any tweaking is really going to be either in the number of pixels or number of grid cells.


In [13]:
12/0.05


Out[13]:
240.0

In [4]:
using constants
incl = 33. #33. # deg. 0 deg = face on, 90 = edge on.
vel = 0.0 # km/s
PA = 90 - 73. # 73 deg. Position angle, runs counter clockwise, due to looking at sky.
npix = 240 # number of pixels, can alternatively specify x and y separately
lam0 = cc/230.538e9 * 1e6 # [microns]


Out[4]:
1300.4036557964414

In [5]:
#loads the camera_wavelength_micron.inp file
@time run(`radmc3d image incl $incl posang $PA vkms $vel npix $npix loadlambda`)


  
 ================================================================
      WELCOME TO RADMC-3D: A 3-D CONTINUUM AND LINE RT SOLVER    
                                                                 
        This is the 3-D reincarnation of the 2-D RADMC code      
                (c) 2010/2011 Cornelis Dullemond                 
                                                                 
 ************* NOTE: THIS IS STILL A BETA VERSION ***************
 ****** Some modes/capabilities are not yet ready/mature ********
                                                                 
       Please feel free to ask questions. Also please report     
        bugs and/or suspicious behavior without hestitation.     
      The reliability of this code depends on your vigilance!    
                                                                 
   To keep up-to-date with bug-alarms and bugfixes, register to  
      the RADMC-3D mailing list by sending an email to me:       
        dullemon@mpia.de or dullemond@uni-heidelberg.de          
                                                                 
              Please visit the RADMC-3D home page at             
  http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/ 
 ================================================================
  
 Reading global frequencies/wavelengths...
 Reading grid file and prepare grid tree...
    Adjusting theta(ny+1) to exactly pi/2...
 Reading star data...
 Grid information (current status):
   We have 4096 branches, of which 4096 are actual grid cells.
   ---> 100.000% mem use for branches, and 100.000% mem use for actual cells.
   No grid refinement is active. The AMR tree is not allocated (this saves memory).
 ALWAYS SELF-CHECK FOR NOW...
 Using mirror symmetry in equatorial plane, because max(theta)==pi/2.
 Starting procedure for rendering image...
       No dust included...
   --> Including lines
       No gas continuum included...
 Using Gaussian line profile
 Reading line data...
 NOTE: In lines.inp for molecule 1 no collision partners specified, therefore no non-LTE possible.
 Reading line data of molecule co ...
 Level Diagram for ispec=           1 :
 3136.50954                                           | 
 2984.27068                                          || 
 2835.76272                                         || 
 2690.99132                                        || 
 2549.96193                                       || 
 2412.68017                                      || 
 2279.15110                                     || 
 2149.37986                                    || 
 2023.37151                                   || 
 1901.13077                                  || 
 1782.66240                                 || 
 1667.97094                                || 
 1557.06073                               || 
 1449.93593                              || 
 1346.60078                             || 
 1247.05922                            || 
 1151.31499                           || 
 1059.37185                          || 
  971.23314                         || 
  886.90241                        || 
  806.38279                       || 
  729.67745                      || 
  656.78922                     || 
  587.72084                    || 
  522.47517                   || 
  461.05446                  || 
  403.46114                 || 
  349.69757                || 
  299.76559               || 
  253.66715              || 
  211.40410             || 
  172.97807            || 
  138.39033           || 
  107.64241          || 
   80.73546         || 
   57.67033        || 
   38.44816       || 
   23.06951      || 
   11.53492     || 
    3.84503    || 
    0.00000    | 
 Reading molecular/atomic number densities...
 Reading gas species number densities...
 Reading gas temperature...
 Reading or computing partition functions...
 Computing partition function internally for molecule            1
 Reading velocity field...
 No microturbulence input file found. Assuming zero microturbulence...
 Line transfer method: LTE (populations precalculated)
 Will store level populations of molecule  1 into global array for the following levels:
           2           3
 Computing level populations, and storing them in global array...
 Rendering image(s)...
 Ray-tracing images: all 23 wavelength at once...
 Writing image to file...
 Diagnostics of flux-conservation (sub-pixeling):
     Nr of main pixels (nx*ny)   =        57600
     Nr of (sub)pixels raytraced =        68416
     Nr of (sub)pixels used      =        65712
     Increase of raytracing cost =    1.1877777777777778     
 Done...
elapsed time: 34.763234169 seconds (4167716 bytes allocated)

In [6]:
@time run(`radmc3d image incl $incl posang $PA vkms $vel npix 240 lambda $lam0`)


  
 ================================================================
      WELCOME TO RADMC-3D: A 3-D CONTINUUM AND LINE RT SOLVER    
                                                                 
        This is the 3-D reincarnation of the 2-D RADMC code      
                (c) 2010/2011 Cornelis Dullemond                 
                                                                 
 ************* NOTE: THIS IS STILL A BETA VERSION ***************
 ****** Some modes/capabilities are not yet ready/mature ********
                                                                 
       Please feel free to ask questions. Also please report     
        bugs and/or suspicious behavior without hestitation.     
      The reliability of this code depends on your vigilance!    
                                                                 
   To keep up-to-date with bug-alarms and bugfixes, register to  
      the RADMC-3D mailing list by sending an email to me:       
        dullemon@mpia.de or dullemond@uni-heidelberg.de          
                                                                 
              Please visit the RADMC-3D home page at             
  http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/ 
 ================================================================
  
 Reading global frequencies/wavelengths...
 Reading grid file and prepare grid tree...
    Adjusting theta(ny+1) to exactly pi/2...
 Reading star data...
 Grid information (current status):
   We have 512 branches, of which 512 are actual grid cells.
   ---> 100.000% mem use for branches, and 100.000% mem use for actual cells.
   No grid refinement is active. The AMR tree is not allocated (this saves memory).
 ALWAYS SELF-CHECK FOR NOW...
 Using mirror symmetry in equatorial plane, because max(theta)==pi/2.
 Starting procedure for rendering image...
       No dust included...
   --> Including lines
       No gas continuum included...
 Using Gaussian line profile
 Reading line data...
 NOTE: In lines.inp for molecule 1 no collision partners specified, therefore no non-LTE possible.
 Reading line data of molecule co ...
 Level Diagram for ispec=           1 :
 3136.50954                                           | 
 2984.27068                                          || 
 2835.76272                                         || 
 2690.99132                                        || 
 2549.96193                                       || 
 2412.68017                                      || 
 2279.15110                                     || 
 2149.37986                                    || 
 2023.37151                                   || 
 1901.13077                                  || 
 1782.66240                                 || 
 1667.97094                                || 
 1557.06073                               || 
 1449.93593                              || 
 1346.60078                             || 
 1247.05922                            || 
 1151.31499                           || 
 1059.37185                          || 
  971.23314                         || 
  886.90241                        || 
  806.38279                       || 
  729.67745                      || 
  656.78922                     || 
  587.72084                    || 
  522.47517                   || 
  461.05446                  || 
  403.46114                 || 
  349.69757                || 
  299.76559               || 
  253.66715              || 
  211.40410             || 
  172.97807            || 
  138.39033           || 
  107.64241          || 
   80.73546         || 
   57.67033        || 
   38.44816       || 
   23.06951      || 
   11.53492     || 
    3.84503    || 
    0.00000    | 
 Reading molecular/atomic number densities...
 Reading gas species number densities...
 Reading gas temperature...
 Reading or computing partition functions...
 Computing partition function internally for molecule            1
 Reading velocity field...
 No microturbulence input file found. Assuming zero microturbulence...
 Line transfer method: LTE (populations precalculated)
 Will store level populations of molecule  1 into global array for the following levels:
           2           3
 Computing level populations, and storing them in global array...
 Rendering image(s)...
 Ray-tracing image for lambda =    1300.4036557964414       micron...
 Writing image to file...
 Diagnostics of flux-conservation (sub-pixeling):
     Nr of main pixels (nx*ny)   =        57600
     Nr of (sub)pixels raytraced =        61040
     Nr of (sub)pixels used      =        60180
     Increase of raytracing cost =    1.0597222222222222     
 Done...
elapsed time: 1.391924293 seconds (93344 bytes allocated)

Image reading

Reading image from file into a datacub


In [ ]:
using read_image

In [ ]:

FFT

FFT'ing a single channel


In [ ]: