Orblib¶
Classes related to orbit libraries.
API¶
Classes:
LegacyOrbitLibrary
([config, mod_dir, parset])Orbit libraries calculated from legacy Fortan programs
OrbitLibrary
([config])An abstract class for orbit libraries.
- class orblib.LegacyOrbitLibrary(config=None, mod_dir=None, parset=None)¶
Orbit libraries calculated from legacy Fortan programs
Methods:
combine_orblibs
(orblib1, orblib2)Combine two LOSVD histograms into one.
write input files for Fortran orbit library programs
mirror the tube orbits
Get
ml
of original orblib with shared parametersExecute the bash script to calculate orbit ICs
Execute the bash script to calculate orbit libraries
Execute the bash script to calculate orbit libraries in parallel
main method to calculate orbit libraries
Read the orbit library
read_orbit_base
(fileroot)Read orbit library from file datfil/{fileroot}.dat.bz2'
Write the bash script to calculate orbit ICs
Write the bash script to calculate orbit libraries
Write the bash script to calculate orbit libraries
- combine_orblibs(orblib1, orblib2)¶
Combine two LOSVD histograms into one.
- Parameters:
- orblib1
dyn.kinematics.Histogram
- orblib2
dyn.kinematics.Histogram
- Returns:
dyn.kinematics.Histogram
the combined orbit libraries
- create_fortran_input_orblib(path)¶
write input files for Fortran orbit library programs
- Parameters:
- pathstring
path of the model’s
infil
directory- Returns:
- Cretaes the following files in the
infil
directory:
parameters_pot.in
parameters_lum.in
orblib.in
orblibbox.in
triaxmass.in
triaxmassbin.in
- duplicate_flip_and_interlace_orblib(orblib)¶
mirror the tube orbits
Take an orbit library, create a duplicate library with the velocity signs flipped, then interlace the two i.e. so that resulting library alternates between flipped/unflipped. This creates an orbit library consistent with the Fortran output, enforcing the ordering created by the for loops in lines 157-178 of triaxnnls_CRcut.f90
- Parameters:
- orblib
dyn.kinematics.Histogram
- Returns:
dyn.kinematics.Histogram
the duplicated, flipped and interlaced orblib
- get_ml_of_original_orblib()¶
Get
ml
of original orblib with shared parametersThe original
ml
is required to rescale orbit libraries for rescaled potentials. This method reads it from the first entry of 9th from bottom line of the fileinfil/parameters_pot.in
- Returns:
- float
the original
ml
- get_orbit_ics()¶
Execute the bash script to calculate orbit ICs
- get_orbit_library()¶
Execute the bash script to calculate orbit libraries
- get_orbit_library_par()¶
Execute the bash script to calculate orbit libraries in parallel
- get_orblib()¶
main method to calculate orbit libraries
Writes and executes bash scripts to (i) calculate orbit initial conditions, (ii) calculate orbit libraries, (iii) calculate aperture and 3D grid masses for the MGE. If orbit libraries for this model already exist, then this method does nothing.
- Returns:
- Creates the following output files in
output/models/*/datfil/
:
begin.dat (ics for tube orbits)
beginbox.dat (ics for box orbits)
orblib.dat.bz2 (zipped tube orbit library)
orblib.dat_orbclass.out (orbit classification for tube orbs)
orblibbox.dat.bz2 (zipped box orbit library)
orblibbox.dat_orbclass.out (orbit classification for box orbs)
mass_aper.dat (MGE masses in apertures)
mass_qgrid.dat (MGE masses in 3D grid)
mass_radmass.dat (MGE masses in radial bins)
+8 log and status files
- read_losvd_histograms()¶
Read the orbit library
Read box orbits and tube orbits, mirrors the latter, and combines. Rescales the velocity axis according to the
ml
value. Sets LOSVDs and 3D grid/aperture masses of the combined orbit library.
- Returns:
- Sets the attributes:
self.losvd_histograms
: a list, whose i’th entry is adyn.kinematics.Histogram
object holding the orbit lib LOSVDs binned for the i’th kinematic set
self.intrinsic_masses
: 3D grid/intrinsic masses of orbit lib
self.projected_masses
: aperture/proj. masses of orbit lib
self.n_orbs
: number of orbits in the orbit library
- read_orbit_base(fileroot)¶
Read orbit library from file datfil/{fileroot}.dat.bz2’
- Parameters:
- filerootstring
this will probably be either ‘orblib’ or ‘orblibbox’
- Returns:
- Histogram
the orbit library stored in a Histogram object
- write_executable_for_ics()¶
Write the bash script to calculate orbit ICs
- write_executable_for_integrate_orbits()¶
Write the bash script to calculate orbit libraries
- write_executable_for_integrate_orbits_par()¶
Write the bash script to calculate orbit libraries
- class orblib.OrbitLibrary(config=None)¶
An abstract class for orbit libraries.
- Parameters:
- systema
dyn.physical_system.System
object- settingsa
dyn.config_reader.settings
object
Inheritance Diagram¶
