Utility functions.
gauss(x, sigma) | |
r_parser(k) | |
L_parser(k) | |
weighted_gauss(c, parser, sigma) | Make a Normalized-Gaussian weighted sum of a range of spectras obtained with a series of simulations sweeping on a folder-collection names obtained parameters (e.g. |
str2pol(s) | Convert a string into a complex three vector indicating the polarization |
normalize(v) | Normalizes a 3D complex vector |
n_dist(v1, v2) | The distance between two nromalized complex vectors |
pol2str(v) | Convert a vector into a string |
compexV2str | |
str2complexV(s) | Convert a string to a complex vector |
resolve_mat_file(material) | Return an absolute file name pointing to a material file |
resolve_profile(fname) | Resolve the absolute file name of the requested profile file. |
compress_files([folder, recurse]) | Zips all the support file output by ddscat into one archive |
MixMaterials(m1, m2, p1) | Approximate the index for alloys by a weighted average of the two components |
Utility functions.
Approximate the index for alloys by a weighted average of the two components
Zips all the support file output by ddscat into one archive
Collects all .avg, .sca, .fml files into their own zip file. These can be accessed conveniently with a ZipCollection result object
The option recurse=True does the same on all subdirectories.
Convert a vector into a string
The helicity convention used for named polarizations is determined by the values of the polarization constants in core.
Return an absolute file name pointing to a material file
If the path is already absolute then return that. If it’s relative return that with ~ expanded If it’s only a filename, assume that file is found in the materials library
Resolve the absolute file name of the requested profile file.
Parameters: | fname – The name of the file to find |
---|---|
Returns: | Absolute path to the file. None if not found. |
The search scheme is to first look for the file in the CWD, followed by the folder ~/.ScatPy/ and finally the subdiretory profiles/ relative to where the utils.py module resides.
Convert a string into a complex three vector indicating the polarization
Attempts to identify polarizations by name: ‘cl’, ‘cr’, ‘lh’, ‘lv’
The helicity convention used for named polarizations is determined by the values of the polarization constants in core.
Make a Normalized-Gaussian weighted sum of a range of spectras obtained with a series of simulations sweeping on a folder-collection names obtained parameters (e.g. r or L) from the parser functions
It is written on the data structure obtained from the results.FolderCollection