aggscatpy package
Submodules
aggscatpy.agginfo module
- aggscatpy.agginfo.calculate_dust_mass(self)
Calculate the dust mass (or the distribution-averaged value when the size distribution is present).
- Parameters
- qindfloat
power-law index of the size distribution
- sizeminstr (optional)
a string for specifying the minimum dust particle
- sizemaxstr (optional)
a string for specifying the maximum dust particle
- Returns
- massfloat
dust mass in units of gram
- aggscatpy.agginfo.check_particle_composition(comp)
Check if the input particle composition is correctly formatted
- Parameters
- compstr
- aggscatpy.agginfo.check_particle_size(partype, amon, size)
Check if the input particle size is correctly formatted
- Parameters
- partypestr
- amonstr (optional)
- sizestr
- aggscatpy.agginfo.check_particle_type(partype)
Check if the input particle type is correctly formatted
- Parameters
- partypestr
- aggscatpy.agginfo.get_radius_and_porosity(partype, amon, np)
Get the characteristic radius and porosity of an aggregate
Examples
>>> ac,por=get_radius_and_porosity('FA19','100nm','4096') >>> print('%-21s'%"characteristic radius",'= %5.3f um'%ac) >>> print('%-21s'%"porosity",'= %5.2f %%'%por) characteristic radius = 10.04 um porosity = 99.60 %
>>> ac,por=get_radius_and_porosity('CAHP','400nm','64') >>> print('%-21s'%"characteristic radius",'= %5.3f um'%ac) >>> print('%-21s'%"porosity",'= %5.2f %%'%por) characteristic radius = 3.12 um porosity = 86.47 %
- aggscatpy.agginfo.get_sizelist(partype, amon=None)
Get a list of available
sizearguments.- Parameters
- partypestr
- Returns
- nlistlist of size arguments
Examples
>>> print(get_sizelist('FA19')) Available amon and size for FA19 amon='100nm' | '8','16','32','64','128','256','512','1024','2048','4096' amon='150nm' | '8','16','32','64','128','256','512' amon='200nm' | '8','16','32','64','128','256','512' amon='300nm' | '8','16','32','64','128','256' amon='400nm' | '8','16','32','64','128'
>>> print(get_sizelist('FA19',amon='100nm')) ['8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096']
>>> print(get_sizelist('CAHP',amon='400nm')) ['8', '16', '32', '64']
>>> print(get_sizelist('grs')) ['0_2000', '0_2520', '0_3175', '0_4000', '0_5040', '0_6350', '0_8000', '1_0079', '1_2699', '1_6000']
- aggscatpy.agginfo.grs_voleq(sizename)
Get a value of the volume-equivalent radius of GRS particles.
- Parameters
- sizenamestr
a string to specify the size of GRS particles
- Returns
- avfloat
the grain radius in units of microns
aggscatpy.aggscatpy module
- class aggscatpy.aggscatpy.distaverage(partype, sizemin, sizemax, comp, amon=None, powind=3.5, chopang=0.0, smatBH=False)
Bases:
objectA class to perform size distribution averaging
- Parameters
- partypestr
Dust particle type:
'FA11','FA13','FA15','FA19','CAHP','CAMP','CALP','grs'- sizeminstr
Minimum dust particle in the size distribution
- sizemaxstr
Maximum dust particle in the size distribution
- compstr
Dust composition. Available input values:
'org','amc'- amonstr (optional)
Monomer radius (necessary if you call aggregate files). Available input values:
'100nm', ('150nm'),'200nm', ('300nm'),'400nm'Note: 150nm and 300nm are only available for fractal aggregates.- powindfloat (optional)
Power-law index of size distribution
- chopangfloat (optional)
Chop angle for the forward scattering peak (degrees)
- smatBHbool (optional)
Switch the definition of the scattering matrix elements into Bohren & Huffman (default: smatBH=False).
- Attributes
- modelstr
dust model name
- distbool
True when the size distribution is on (always True in this mode)
- aggopbool
True when the input particle type is aggregates
- nlamint
Number of wavelength grids
- nangint
Number of scattering angle grids
- lmdfloat[nlam]
Wavelength (microns)
- scatangfloat[nang]
Scattering angles (degrees)
- kabs,ksca,asymfloat[nlam]
Absorption and scattering opacities (cm^2/g) and the asymmetry parameter.
- cabs,cscafloat[nlam]
Absorption and scattering cross sections (micron^2)
- albedofloat[nlam]
Single scattering albedo (=ksca/(kabs+ksca))
- pmaxfloat[nlam]
Maximum degree of linear polariation
- smat11,smat12,smat22,smat33,smat34,smat44: float[nlmd,nang]
Scattering matrix elements (default: RADMC-3D definition)
- phase: float[nlmd,nang]
Scattering phase function
- rhomatfloat
Material density (g/cc)
- chopangfloat
The chop angle for the forward scattering peak (degrees)
- massfloat
Distribution-averaged dust mass (g)
- avmin, avmaxfloat
Volume-equivalent radii of the minimum and maximum dust particles in the size distribution
- powfloat
Power-law index of size distribution: n(a)da propto a^{-pow}da
- amonfloat (only when
partype!='grs') Monomer radius (microns) Number of monomers of the minimum aggregate in the size distribution
- npmin, npmaxfloat (only when
partype!='grs') Number of monomers of the minimum and maximum aggregates in the size distribution
- acmin, acmaxfloat (only when
partype!='grs') Characteristic radius of the minimum and maximum aggregates in the size distribution
- pormin,pormaxfloat (only when
partype!='grs') Porosity of the minimum and maximum aggregates in the size distribution
- class aggscatpy.aggscatpy.dustmodel(partype=None, size=None, comp=None, amon=None, dist=True, chop='nochop', smatBH=False, filename=None, quiet=False)
Bases:
objectA class to read dustkapscatmat_XXX.inp and store the information therein
- Parameters
- partypestr
Dust particle type:
'FA11','FA13','FA15','FA19','CAHP','CAMP','CALP','grs'- sizestr
- Dust particle sizeFor aggregates: the number of monomers.Example:
size='4096'if you want an aggregate consisting of 4096 monomers.For irregular grains: the volume-equivalent radius in units of microns(the dicimal dot should be replaced by the underscore).Example:size='1_6000'if you want an irregular grain with the volume-eq. radius of 1.6 microns.You can also useagginfo.get_sizelistto obtain a list of available size values. - compstr
Dust composition. Available input values:
'org','amc'- amonstr (optional)
Monomer radius (necessary if you call aggregate files). Available input values:
'100nm', ('150nm'),'200nm', ('300nm'),'400nm'Note: 150nm and 300nm are only available for fractal aggregates.- distbool (optional)
With size distribution (default: dist=True).
- chopstr (optional)
Forward scattering chop (default: chop=’nochop’). Available input values:
'nochop','chop5','chop10'- smatBHbool (optional)
Output the scattering matrix elements in the Bohren & Huffman definition (default: smatBH=False).
- filenamestr (optical)
A relative path to dustkapscatmat_XXX.inp in case if you want to reload a file generated by this tool.
- quietbool (optical)
If False, a warning will be displayed when a dust model with incomplete wavelength grids is read.
- Attributes
- modelstr
dust model name
- pathstr
A relative path to the file
- distbool
True when the size distribution is on
- aggopbool
True when the input particle type is aggregates
- nlamint
Number of wavelength grids
- nangint
Number of scattering angle grids
- lmdfloat[nlam]
Wavelength (microns)
- scatangfloat[nang]
Scattering angles (degrees)
- kabs,ksca,asymfloat[nlam]
Absorption and scattering opacities (cm^2/g) and the asymmetry parameter.
- cabs,cscafloat[nlam]
Absorption and scattering cross sections (micron^2)
- albedofloat[nlam]
Single scattering albedo (=ksca/(kabs+ksca))
- pmaxfloat[nlam]
Maximum degree of linear polariation
- smat11,smat12,smat22,smat33,smat34,smat44: float[nlmd,nang]
Scattering matrix elements (RADMC-3D’s definition when smatBH=False)
- phase: float[nlmd,nang]
Scattering phase function
- rhomatfloat
Material density (g/cc)
- chopangfloat
The chop angle for the forward scattering peak (degrees)
- massfloat
Mass of a dust particle (Or distribution averaged mass if size distribution is present) (g).
- avmin, avmaxfloat (only when
dist=True) Volume-equivalent radii of the minimum and maximum particles in the size distribution
- avfloat (only when
dist=False) Volume-equivalent radius (micron)
- powfloat (only when
dist=True) Power-law index of size distribution: n(a)da propto a^{-pow}da
- amonfloat (only when
partype!='grs') Monomer radius (microns) Number of monomers of the minimum aggregate in the size distribution
- npmin, npmaxfloat (only when
partype!='grs'anddist=True) Number of monomers of the minimum and maximum aggregates in the size distribution (if dist=True)
- acmin, acmaxfloat (only when
partype!='grs'anddist=True) Characteristic radius of the minimum and maximum aggregates in the size distribution
- pormin,pormaxfloat (only when
partype!='grs'anddist=True) Porosity of the minimum and maximum aggregates in the size distribution
- npfloat (only when
partype!='grs'anddist=False) Number of monomers
- acfloat (only when
partype!='grs'anddist=False) Characteristic radius (micron)
- porfloat (only when
partype!='grs'anddist=False) Porosity of the aggregate
- aggscatpy.aggscatpy.dustspec(self, specoutput=None)
Print info about dust properties
- Parameters
- specoutputstr (optional)
To which the results are redirected
- aggscatpy.aggscatpy.dustspec_header(self, specoutput=None, outfmt=None, opacity=None)
Header information about dust properties
- Parameters
- specoutputstr (optional)
To which the results are redirected
- outfmtstr
Output file format
- aggscatpy.aggscatpy.output_all_gallery_plot(partype, amon=None, dist=True)
Output plots for Appendix B (gallery of the optical properties)
- Parameters
- partypestr
Dust particle type:
'FA11','FA13','FA15','FA19','CAHP','CAMP','CALP','grs'- amonstr (optional)
Monomer radius (necessary if you call aggregate files). Available input values:
'100nm', ('150nm'),'200nm', ('300nm'),'400nm'Note: 150nm and 300nm are only available for fractal aggregates.- distbool (optional)
With size distribution (default: dist=True).
- class aggscatpy.aggscatpy.plots
Bases:
objectA class to set some axes.
Methods
set_lmd_vs_opc:
set axis for a plot for the opacity againt wavelength.
set_lmd_vs_albedo:
set axis for a plot for the albedo, pmax, asymmetry parameter against wavelength.
set_ang_vs_phase:
set axis for a plot for the phase function against scattering angle.
set_lmd_vs_opc:
set axis for a plot for the degree of polarization against scattering angle.
- set_ang_vs_phase()
set axis for a plot for the phase function against scattering angle.
- set_ang_vs_pol()
set axis for a plot for the degree of polarization against scattering angle.
- set_lmd_vs_albedo()
set axis for a plot for the albedo, pmax, asymmetry parameter against wavelength.
- set_lmd_vs_cross()
set axis for a plot for the cross section vs wavelength.
- set_lmd_vs_opc()
set axis for a plot for the opacity vs wavelength.
- aggscatpy.aggscatpy.showmodel(self, opacity=True, savefig=False, fn=None)
Show summary plots of the optical property
- Parameters
- opacitybool (optional)
A switch to decide whether to plot the opacity or the cross-section
- savefigbool (optional)
If True, then the plots is saved.
- fnstr (optional)
Filename for the ouput file
- aggscatpy.aggscatpy.write_data(self, fn=None, output='all', opacity=True, wlist=None)
Write optical properties of dust particles in various formats
- Parameters
- outputstr (optional)
Determines what kind of optical properties will be outputted (‘all’, ‘dustkappa’, ‘smat’).
- wlistlist of float (optional)
Determines which wavelength data will be outputted.
- fnstr (optional)
Filename for the ouput file
- opacitybool (optional)
If True (default), absorption and scattering opacities (cm^2/g) will be written, while when False, absorption and scattering cross sections will be written.
aggscatpy.rendering module
- aggscatpy.rendering.particle_rendering(partype, size, ireal, amon=None, xcamera=3.5, rotx=0.0, roty=0.0, rotz=0.0, particle_color='rgb<0.15,0.15,0.15>', background=False, bg_color='White', reference=True, ref_length=None, ref_dist=1.7, ref_posang=240.0, ref_color=None, ref_fontsize=1.0, fn=None, path=None)
Perform rendering of a particle shape via POVRAY
- Parameters
- partypestr
Particle type
- sizestr
Dust particle size
- amonstr
Monomer radius (necessary if you call aggregate files).
- irealstr
Realization number
- xcamerafloat (optional)
Distance from the origin to the camera along the x-axis in units of the characteristic radius (for aggregates) or the volume-equivalent radius (for irregular grains).
- rotx, roty, rotzfloat (optional)
Angle of rotation about the x, y, z axes, respectively (in degrees).
- particle_colorstr (optional)
Particle color
- backgroundbool (optional)
A background color is set when True
- bgcolorstr (optional)
Background color
- referencebool (optinal)
A reference bar is shown when True
- ref_lengthfloat (optional)
A physical length of reference bar in units of microns
- ref_distfloat (optional)
A distance from the origin to the center of the reference bar in the image plane in units of the characteristic radius (for aggregates) or the volume-equivalent radius (for irregular grains).
- ref_posangfloat (optional)
A position angle of the reference bar center measured from the z axis in units of degrees
- ref_colorstr (optional)
A color of the reference bar and text
- ref_fontsizefloat (optional)
A fontsize relative to the default font size
- fnstr (optional)
A filename used for a generated png image
- pathstr (optional)
A path to which a generated image will be saved.
- aggscatpy.rendering.view_particle(partype, size, ireal=None, amon=None)
Displaly the pre-rendering particle images
- Parameters
- partypestr
Particle type
- sizestr
Dust particle size
- irealstr (optional)
Realization number. If not specified, all realizations are displayed.
- amonstr
Monomer radius (necessary if you call aggregate files).