§
    HR-eË  ã                   óê   — d dl mc mZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ ddlmZmZ ddddœd	„Zded
dœd„Zd„ Z ej        de	e¦  «          ej        de	e¦  «          ej        de	e¦  «         dS )é    N)Úreadwrite_registry)Ú	Cosmology)ÚQTableé   )Ú
from_tableÚto_tableF)Úmove_to_metaÚ	cosmologyc                ó¸   — d|d<   t          j        t          ¦  «        5  t          j        | fi |¤Ž}ddd¦  «         n# 1 swxY w Y   t          ||||¬¦  «        S )aü  Read a `~astropy.cosmology.Cosmology` from an ECSV file.

    Parameters
    ----------
    filename : path-like or file-like
        From where to read the Cosmology.
    index : int, str, or None, optional
        Needed to select the row in tables with multiple rows. ``index`` can be
        an integer for the row number or, if the table is indexed by a column,
        the value of that column. If the table is not indexed and ``index``
        is a string, the "name" column is used as the indexing column.

    move_to_meta : bool (optional, keyword-only)
        Whether to move keyword arguments that are not in the Cosmology class'
        signature to the Cosmology's metadata. This will only be applied if the
        Cosmology does NOT have a keyword-only argument (e.g. ``**kwargs``).
        Arguments moved to the metadata will be merged with existing metadata,
        preferring specified metadata in the case of a merge conflict
        (e.g. for ``Cosmology(meta={'key':10}, key=42)``, the ``Cosmology.meta``
        will be ``{'key': 10}``).

    cosmology : str, `~astropy.cosmology.Cosmology` class, or None (optional, keyword-only)
        The cosmology class (or string name thereof) to use when constructing
        the cosmology instance. The class also provides default parameter values,
        filling in any non-mandatory arguments missing in 'table'.

    **kwargs
        Passed to :attr:`astropy.table.QTable.read`

    Returns
    -------
    `~astropy.cosmology.Cosmology` subclass instance
    ú
ascii.ecsvÚformatN)Úindexr	   r
   )ÚuÚadd_enabled_unitsÚcur   Úreadr   )Úfilenamer   r	   r
   ÚkwargsÚtables         ú9lib/python3.11/site-packages/astropy/cosmology/io/ecsv.pyÚ	read_ecsvr      s®   € ðD $€Fˆ8ÑÝ	
Ô	RÑ	 Ô	 ð 0ð 0Ý”˜HÐ/Ð/¨Ð/Ð/ˆð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0õ ØU¨Àðñ ô ð s   Ÿ>¾AÁAT)Ú	overwriteÚclsÚcosmology_in_metac                óT   — t          | ||¬¦  «        }d|d<    |j        |fd|i|¤Ž dS )a  Serialize the cosmology into a ECSV.

    Parameters
    ----------
    cosmology : `~astropy.cosmology.Cosmology` subclass instance
    file : path-like or file-like
        Location to save the serialized cosmology.

    overwrite : bool
        Whether to overwrite the file, if it exists.
    cls : type (optional, keyword-only)
        Astropy :class:`~astropy.table.Table` (sub)class to use when writing.
        Default is :class:`~astropy.table.QTable`.
    cosmology_in_meta : bool
        Whether to put the cosmology class in the Table metadata (if `True`,
        default) or as the first column (if `False`).
    **kwargs
        Passed to ``cls.write``

    Raises
    ------
    TypeError
        If kwarg (optional) 'cls' is not a subclass of `astropy.table.Table`
    )r   r   r   r   r   N)r   Úwrite)r
   Úfiler   r   r   r   r   s          r   Ú
write_ecsvr   8   sH   € õ6 Y CÐ;LÐMÑMÔM€Eà#€Fˆ8ÑØ€E„KÐ4Ð4 	Ð4¨VÐ4Ð4Ð4Ð4Ð4ó    c                 ó4   — |duo|                      d¦  «        S )zPIdentify if object uses the Table format.

    Returns
    -------
    bool
    Nz.ecsv)Úendswith)ÚoriginÚfilepathÚfileobjÚargsr   s        r   Úecsv_identifyr&   Y   s"   € ð ˜4ÐÐ> H×$5Ò$5°gÑ$>Ô$>Ð>r   r   )N)Úastropy.cosmology.unitsr
   Úunitsr   Úastropy.unitsr   Úastropy.cosmology.connectr   Úastropy.cosmology.corer   Úastropy.tabler   r   r   r   r   r   r&   Úregister_readerÚregister_writerÚregister_identifier© r   r   ú<module>r1      s'  ðð %Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø  Ð  Ð  Ð  Ð  Ð  à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'ð)°EÀTð )ð )ð )ð )ð )ðZ #(¨VÀtð5ð 5ð 5ð 5ð 5ðB?ð ?ð ?ð #Ð Ô " <°¸IÑ FÔ FÐ FØ "Ð Ô " <°¸JÑ GÔ GÐ GØ &Ð Ô & |°YÀÑ NÔ NÐ NÐ NÐ Nr   