MGEs¶
Classes for Multi Gaussian Expansions (MGEs).
API¶
Classes:
MGE
(**kwargs)Multi Gaussian Expansions
- class mges.MGE(**kwargs)¶
Multi Gaussian Expansions
Methods:
convert old mge file to ECSV file
get_intrinsic_masses_from_file
(directory_noml)read mge intrinsic masses from
mass_qgrid.dat
get_projected_masses_from_file
(directory_noml)read mge projected masses from
mass_aper.dat
read_file_old_format
(filename)read the MGE data from a text file
Validates the mge's q values
- convert_file_from_old_format(filename_old_format, filename_new_format)¶
convert old mge file to ECSV file
- Parameters:
- filename_old_formatstring
old filename
- filename_new_formatstring
new filename
- Returns:
- None
saves file with name
filename_new_format
- get_intrinsic_masses_from_file(directory_noml)¶
read mge intrinsic masses from
mass_qgrid.dat
- Parameters:
- directory_nomlstring
name of model directory exclusing the
ml/
extension- Returns:
- array
3D intrinsic_masses masses of the MGE in a polar grid with sizes (n_r, n_theta, n_phi) which is defined (in Fortran files) to be (6,6,10)
- get_projected_masses_from_file(directory_noml)¶
read mge projected masses from
mass_aper.dat
- Parameters:
- directory_nomlstring
name of model directory exclusing the
ml/
extension- Returns:
- array
array of aperture masses of the MGE
- read_file_old_format(filename)¶
read the MGE data from a text file
old format = text file, 4 columns (I, sigma, q, PA_twist), with one header line
- Parameters:
- filenamestring
name of file
- Returns:
- ndarray
MGE data in structrued numpy array
- validate_q_values()¶
Validates the mge’s q values
Any q ‘too close to 1’ will be set to q=NINES for numerical stability. If any changes are made, a warning message will be logged. Note that the ‘closeness’ to 1 might be machine dependent - for us ‘four nines’, 0.9999, worked…
- Returns:
- None. Any changes are applied to
self.data
.