Example #1
0
File: dla.py Project: ninoc/pyigm
    def from_datfile(cls, dat_file, tree=None, **kwargs):
        """ Read from dat_file (historical JXP format)

        Parameters
        ----------
        dat_file : str
          dat file
        tree : str, optional
          Path to data files
        kwargs :
          Passed to __init__

        Returns
        -------
        _datdict : dict
          Fills this attribute
        """
        if tree is None:
            tree = ''
        # Read datfile
        datdict = igmau.read_dat_file(tree+dat_file)
        # Parse
        coord, zabs, name, NHI, sigNHI, clm_fil = igmau.parse_datdict(datdict)
        kwargs['NHI'] = NHI
        kwargs['sig_NHI'] = sigNHI

        # Generate with type
        vlim = None
        slf = cls(coord, zabs, vlim, **kwargs)

        # Fill files
        slf.tree = tree
        slf.dat_file = slf.tree+dat_file

        # Parse datdict
        slf._datdict = datdict

        # QSO keys
        slf.qso = slf._datdict['QSO name']
        slf.zem = float(slf._datdict['QSO zem'])
        # Name
        slf.name = '{:s}_z{:0.3f}'.format(slf.qso,zabs)

        # Abund
        slf.flg_ZH = float(slf._datdict['flg_mtl'])
        slf.ZH = float(slf._datdict['[M/H]'])
        slf.sig_ZH = float(slf._datdict['sig([M/H])'])

        return slf
Example #2
0
    def from_datfile(cls, dat_file, tree=None, **kwargs):
        """ Read from dat_file (historical JXP format)

        Parameters
        ----------
        dat_file : str
          dat file
        tree : str, optional
          Path to data files
        kwargs :
          Passed to __init__

        Returns
        -------
        _datdict : dict
          Fills this attribute
        """
        if tree is None:
            tree = ''
        # Read datfile
        datdict = igmau.read_dat_file(tree + dat_file)
        # Parse
        coord, zabs, name, NHI, sigNHI, clm_fil = igmau.parse_datdict(datdict)
        kwargs['NHI'] = NHI
        kwargs['sig_NHI'] = sigNHI

        # Generate with type
        vlim = None
        slf = cls(coord, zabs, vlim, **kwargs)

        # Fill files
        slf.tree = tree
        slf.dat_file = slf.tree + dat_file

        # Parse datdict
        slf._datdict = datdict

        # QSO keys
        slf.qso = slf._datdict['QSO name']
        slf.zem = float(slf._datdict['QSO zem'])
        # Name
        slf.name = '{:s}_z{:0.3f}'.format(slf.qso, zabs)

        # Abund
        slf.flg_ZH = float(slf._datdict['flg_mtl'])
        slf.ZH = float(slf._datdict['[M/H]'])
        slf.sig_ZH = float(slf._datdict['sig([M/H])'])

        return slf
Example #3
0
    def from_datfile(cls, dat_file, tree=None, **kwargs):
        """ Read from dat_file (historical JXP format)

        Parameters
        ----------
        dat_file : str
          dat file
        tree : str, optional
          Path to data files
        kwargs :
          Passed to __init__

        Returns
        -------
        _datdict : dict
          Fills this attribute
        """
        if tree is None:
            tree = ''
        # Read datfile
        datdict = igmau.read_dat_file(tree+dat_file)
        # Parse
        coord, zabs, name, NHI, sigNHI, clm_fil = igmau.parse_datdict(datdict)
        kwargs['NHI'] = NHI
        kwargs['sig_NHI'] = sigNHI
        # Generate with type
        vlim = None
        slf = cls(coord, zabs, vlim, **kwargs)

        # Fill files
        slf.tree = tree
        slf.dat_file = slf.tree+dat_file

        # Parse datdict
        #   Includes Sub systems
        slf._datdict = datdict
        slf.parse_dat_file()

        return slf
Example #4
0
    def from_datfile(cls, dat_file, tree=None, **kwargs):
        """ Read from dat_file (historical JXP format)

        Parameters
        ----------
        dat_file : str
          dat file
        tree : str, optional
          Path to data files
        kwargs :
          Passed to __init__

        Returns
        -------
        _datdict : dict
          Fills this attribute
        """
        if tree is None:
            tree = ''
        # Read datfile
        datdict = igmau.read_dat_file(tree + dat_file)
        # Parse
        coord, zabs, name, NHI, sigNHI, clm_fil = igmau.parse_datdict(datdict)
        kwargs['NHI'] = NHI
        kwargs['sig_NHI'] = sigNHI
        # Generate with type
        vlim = None
        slf = cls(coord, zabs, vlim, **kwargs)

        # Fill files
        slf.tree = tree
        slf.dat_file = slf.tree + dat_file

        # Parse datdict
        #   Includes Sub systems
        slf._datdict = datdict
        slf.parse_dat_file()

        return slf