CosmologyToFormat#

class astropy.cosmology.connect.CosmologyToFormat(instance, cls)[源代码]#

基类:UnifiedReadWrite

把这个宇宙学转换成另一种形式。

该功能提供到AstPy统一I/O层的宇宙学接口。这允许使用以下语法轻松转换为受支持的数据格式::

>>> from astropy.cosmology import Planck18
>>> Planck18.to_format("mapping")
{'cosmology': astropy.cosmology.core.FlatLambdaCDM,
 'name': 'Planck18',
 'H0': <Quantity 67.66 km / (Mpc s)>,
 'Om0': 0.30966,
 ...

获取有关可用表示法的帮助 Cosmology 使用 help() 方法:

>>> Cosmology.to_format.help()  # Get help and list supported formats
>>> Cosmology.to_format.help('<format>')  # Get detailed help on format
>>> Cosmology.to_format.list_formats()  # Print list of available formats
参数:
format : strPython :字符串

格式说明符。

*args

位置参数传递给数据编写器。如果提供,第一个参数是输出文件名。

**kwargs

传递给数据编写器的关键字参数。

方法总结

__call__(format, *args, **kwargs)

称自己为函数。

方法文件

__call__(format, *args, **kwargs)[源代码]#

称自己为函数。