pyrats/utils.py
def read_cooling(ds):
    """Read the cooling table from the cooling.out file."""

    folder = '.'
    iout = int(str(ds)[-5:])

    fname = '{F}/output_{I:05d}/cooling_{I:05d}.out'.format(F=folder,
                                                            I=iout)
    cool = dict()
    with FF(fname, 'r') as cf:
        n1, n2 = cf.read_ints()
        cool['n_nH'] = n1
        cool['n_T2'] = n2
        cool['nH'] = cf.read_reals(np.float64)
        cool['T2'] = cf.read_reals(np.float64)
        cool['cooling'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_com'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating_com'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['metal'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_com_prime'] = cf.read_reals(
            np.float64).reshape((n1, n2), order='F')
        cool['heating_com_prime'] = cf.read_reals(
            np.float64).reshape((n1, n2), order='F')
        cool['metal_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['mu'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['spec'] = cf.read_reals(np.float64).reshape((n1, n2, 6), order='F')

    return cool
Read the cooling table from the cooling.out file.
Read the cooling table from the cooling.out file.
Read the cooling table from the cooling . out file .
def read_cooling(ds):
    folder = '.'
    iout = int(str(ds)[-5:])
    fname = '{F}/output_{I:05d}/cooling_{I:05d}.out'.format(F=folder,
                                                            I=iout)
    cool = dict()
    with FF(fname, 'r') as cf:
        n1, n2 = cf.read_ints()
        cool['n_nH'] = n1
        cool['n_T2'] = n2
        cool['nH'] = cf.read_reals(np.float64)
        cool['T2'] = cf.read_reals(np.float64)
        cool['cooling'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_com'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating_com'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['metal'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['heating_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['cooling_com_prime'] = cf.read_reals(
            np.float64).reshape((n1, n2), order='F')
        cool['heating_com_prime'] = cf.read_reals(
            np.float64).reshape((n1, n2), order='F')
        cool['metal_prime'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['mu'] = cf.read_reals(np.float64).reshape((n1, n2), order='F')
        cool['spec'] = cf.read_reals(np.float64).reshape((n1, n2, 6), order='F')
    return cool
def read_cooling ( ds ) : folder = '.' iout = int ( str ( ds ) [ - 5 : ] ) fname = '{F}/output_{I:05d}/cooling_{I:05d}.out' . format ( F = folder , I = iout ) cool = dict ( ) with FF ( fname , 'r' ) as cf : n1 , n2 = cf . read_ints ( ) cool [ 'n_nH' ] = n1 cool [ 'n_T2' ] = n2 cool [ 'nH' ] = cf . read_reals ( np . float64 ) cool [ 'T2' ] = cf . read_reals ( np . float64 ) cool [ 'cooling' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'heating' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'cooling_com' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'heating_com' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'metal' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'cooling_prime' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'heating_prime' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'cooling_com_prime' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'heating_com_prime' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'metal_prime' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'mu' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 ) , order = 'F' ) cool [ 'spec' ] = cf . read_reals ( np . float64 ) . reshape ( ( n1 , n2 , 6 ) , order = 'F' ) return cool
Read the cooling table from the cooling.out file.
Read the cooling table from the cooling . out file .
"""Read the cooling table from the cooling.out file."""
ds