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.

create_fortran_input_orblib(path)

write input files for Fortran orbit library programs

duplicate_flip_and_interlace_orblib(orblib)

mirror the tube orbits

get_ml_of_original_orblib()

Get ml of original orblib with shared parameters

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

read_losvd_histograms()

Read the orbit library

read_orbit_base(fileroot)

Read orbit library from file datfil/{fileroot}.dat.bz2'

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

combine_orblibs(orblib1, orblib2)

Combine two LOSVD histograms into one.

Parameters:
orblib1dyn.kinematics.Histogram
orblib2dyn.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:
orblibdyn.kinematics.Histogram
Returns:
dyn.kinematics.Histogram

the duplicated, flipped and interlaced orblib

get_ml_of_original_orblib()

Get ml of original orblib with shared parameters

The 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 file infil/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 a dyn.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

Inheritance diagram of orblib