astromodels.utils package
Submodules
astromodels.utils.angular_distance module
- astromodels.utils.angular_distance.angular_distance(ra1, dec1, ra2, dec2)[source]
Returns the angular distance between two points, two sets of points, or a set of points and one point.
- Parameters:
ra1 – array or float, longitude of first point(s)
dec1 – array or float, latitude of first point(s)
ra2 – array or float, longitude of second point(s)
dec2 – array or float, latitude of second point(s)
- Returns:
angular distance(s) in degrees
- astromodels.utils.angular_distance.angular_distance_fast(ra1, dec1, ra2, dec2)[source]
Compute angular distance using the Haversine formula. Use this one when you know you will never ask for points at their antipodes. If this is not the case, use the angular_distance function which is slower, but works also for antipodes.
- Parameters:
lon1 –
lat1 –
lon2 –
lat2 –
- Returns:
- astromodels.utils.angular_distance.spherical_angle(ra0, dec0, ra1, dec1, ra2, dec2)[source]
Returns the spherical angle distance between two sets of great circles defined by (ra0, dec0), (ra1, dec1) and (ra0, dec0), (ra2, dec2)
- Parameters:
ra0 – array or float, longitude of intersection point(s)
dec0 – array or float, latitude of intersection point(s)
ra1 – array or float, longitude of first point(s)
dec1 – array or float, latitude of first point(s)
ra2 – array or float, longitude of second point(s)
dec2 – array or float, latitude of second point(s)
- Returns:
spherical angle in degrees
astromodels.utils.config_structure module
- class astromodels.utils.config_structure.AbsTables(value)[source]
Bases:
Enum
An enumeration.
- AG89 = 'AG89'
- ASPL = 'ASPL'
- WILM = 'WILM'
- class astromodels.utils.config_structure.AbsorptionModels(tbabs_table: astromodels.utils.config_structure.AbsTables = <AbsTables.WILM: 'WILM'>, phabs_table: astromodels.utils.config_structure.AbsTables = <AbsTables.AG89: 'AG89'>, ebl_table: astromodels.utils.config_structure.EBLTable = <EBLTable.dominguez: 'dominguez'>)[source]
Bases:
object
- class astromodels.utils.config_structure.Config(logging: astromodels.utils.config_structure.Logging = <factory>, absorption_models: astromodels.utils.config_structure.AbsorptionModels = <factory>, modeling: astromodels.utils.config_structure.Modeling = <factory>)[source]
Bases:
object
- absorption_models: AbsorptionModels
- class astromodels.utils.config_structure.EBLTable(value)[source]
Bases:
Enum
An enumeration.
- dominguez = 'dominguez'
- franceschini = 'franceschini'
- gilmore = 'gilmore'
- inuoe = 'inuoe'
- kneiske = 'kneiske'
- class astromodels.utils.config_structure.Logging(path: str = '~/.astromodels/log', developer: bool = 'off', usr: bool = 'on', console: bool = 'on', level: astromodels.utils.config_structure.LoggingLevel = <LoggingLevel.INFO: 20>, startup_warnings: bool = 'on', info_style: str = 'medium_spring_green', warn_style: str = 'medium_orchid', error_style: str = 'blink bold bright_red', debug_style: str = 'blue_violet', message_style: str = 'bold grey78')[source]
Bases:
object
- console: bool = 'on'
- debug_style: str = 'blue_violet'
- developer: bool = 'off'
- error_style: str = 'blink bold bright_red'
- info_style: str = 'medium_spring_green'
- level: LoggingLevel = 20
- message_style: str = 'bold grey78'
- path: str = '~/.astromodels/log'
- startup_warnings: bool = 'on'
- usr: bool = 'on'
- warn_style: str = 'medium_orchid'
astromodels.utils.configuration module
astromodels.utils.data_files module
astromodels.utils.disk_usage module
astromodels.utils.file_utils module
astromodels.utils.io module
astromodels.utils.logging module
- astromodels.utils.logging.activate_warnings()[source]
supress warning messages in console and file usr logs
- astromodels.utils.logging.get_path_of_log_file(log_file: str) Path [source]
returns the path of the log files
- astromodels.utils.logging.silence_console_log()[source]
temporarily silence the console and progress bars
astromodels.utils.long_path_formatter module
- astromodels.utils.long_path_formatter.long_path_formatter(line, max_width=50)[source]
If a path is longer than max_width, it substitute it with the first and last element, joined by “…”. For example ‘this.is.a.long.path.which.we.want.to.shorten’ becomes ‘this…shorten’
- Parameters:
line –
max_width –
- Returns:
astromodels.utils.pretty_list module
astromodels.utils.table module
- class astromodels.utils.table.NumericMatrix(data=None, masked=False, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, units=None, descriptions=None, **kwargs)[source]
Bases:
Table
astromodels.utils.valid_variable module
astromodels.utils.vincenty module
- astromodels.utils.vincenty.vincenty(lon0, lat0, a1, s)[source]
Returns the coordinates of a new point that is a given angular distance s away from a starting point (lon0, lat0) at bearing (angle from north) a1), to within a given precision
Note that this calculation is a simplified version of the full vincenty problem, which solves for the coordinates on the surface on an arbitrary ellipsoid. Here we only care about the surface of a sphere.
Note: All parameters are assumed to be given in DEGREES :param lon0: float, longitude of starting point :param lat0: float, latitude of starting point :param a1: float, bearing to second point, i.e. angle between due north and line connecting 2 points :param s: float, angular distance between the two points :return: coordinates of second point in degrees