Ejemplo n.º 1
0
 def add_forest(self, inp, z):
     '''Add a Lya/Lyb forest line
     '''
     from xastropy.igm.abs_sys.abssys_utils import GenericAbsSystem
     forest = GenericAbsSystem(zabs=z)
     # NHI
     NHI_dict = {'6': 12., '7': 13., '8': 14., '9': 15.}
     forest.NHI = NHI_dict[inp]
     # Lines
     for name in ['HI 1215', 'HI 1025', 'HI 972']:
         aline = AbsLine(name, linelist=self.llist[self.llist['List']])
         # Attributes
         aline.attrib['N'] = forest.NHI
         aline.attrib['b'] = 20. * u.km / u.s
         aline.attrib['z'] = forest.zabs
         # Append
         forest.lines.append(aline)
     # Append to forest lines
     self.all_forest.append(forest)
Ejemplo n.º 2
0
 def add_forest(self,inp,z):
     '''Add a Lya/Lyb forest line
     '''
     from xastropy.igm.abs_sys.abssys_utils import GenericAbsSystem
     forest = GenericAbsSystem((0.*u.deg,0.*u.deg), z, [-300.,300.]*u.km/u.s)
     # NHI
     NHI_dict = {'6':12.,'7':13.,'8':14.,'9':15.}
     forest.NHI=NHI_dict[inp]
     # Lines
     for name in ['HI 1215','HI 1025', 'HI 972']:
         aline = AbsLine(name,
             linelist=self.llist[self.llist['List']])
         # Attributes
         aline.attrib['N'] = 10**forest.NHI * u.cm**-2
         aline.attrib['b'] = 20.*u.km/u.s
         aline.attrib['z'] = forest.zabs
         # Append
         forest.lines.append(aline)
     # Append to forest lines
     self.all_forest.append(forest)
Ejemplo n.º 3
0
    def add_forest(self, inp, z):
        """Add a Lya/Lyb forest line
        """
        from xastropy.igm.abs_sys.abssys_utils import GenericAbsSystem

        forest = GenericAbsSystem((0.0 * u.deg, 0.0 * u.deg), z, [-300.0, 300.0] * u.km / u.s)
        # NHI
        NHI_dict = {"6": 12.0, "7": 13.0, "8": 14.0, "9": 15.0}
        forest.NHI = NHI_dict[inp]
        # Lines
        for name in ["HI 1215", "HI 1025", "HI 972"]:
            aline = AbsLine(name, linelist=self.llist[self.llist["List"]])
            # Attributes
            aline.attrib["N"] = 10 ** forest.NHI * u.cm ** -2
            aline.attrib["b"] = 20.0 * u.km / u.s
            aline.attrib["z"] = forest.zabs
            # Append
            forest.lines.append(aline)
        # Append to forest lines
        self.all_forest.append(forest)
Ejemplo n.º 4
0
def test_generic():
    # Start
    gensurvey = GenericAbsSurvey()

    # Systems
    gensys1 = GenericAbsSystem(NHI=16., zabs=1.244)
    gensys1.coord = SkyCoord(ra=123.1143 * u.deg, dec=-12.4321 * u.deg)
    gensys1.name = 'Sys1'
    #
    gensys2 = GenericAbsSystem(NHI=17., zabs=1.744)
    gensys2.coord = SkyCoord(ra=223.1143 * u.deg, dec=42.4321 * u.deg)
    gensys2.name = 'Sys2'

    # Combine
    gensurvey.nsys = 2
    gensurvey._abs_sys.append(gensys1)
    gensurvey._abs_sys.append(gensys2)

    # Attribute
    aNHI = gensurvey.NHI
    np.testing.assert_allclose(aNHI, np.array([16., 17.]))
Ejemplo n.º 5
0
def test_generic():
    # Start
    gensurvey = GenericAbsSurvey()

    # Systems
    gensys1 = GenericAbsSystem(NHI=16., zabs=1.244)
    gensys1.coord = SkyCoord(ra=123.1143*u.deg, dec=-12.4321*u.deg)
    gensys1.name = 'Sys1'
    #
    gensys2 = GenericAbsSystem(NHI=17., zabs=1.744)
    gensys2.coord = SkyCoord(ra=223.1143*u.deg, dec=42.4321*u.deg)
    gensys2.name = 'Sys2'

    # Combine
    gensurvey.nsys = 2
    gensurvey._abs_sys.append(gensys1)
    gensurvey._abs_sys.append(gensys2)

    # Attribute
    aNHI = gensurvey.NHI
    np.testing.assert_allclose(aNHI, np.array([16.,17.]))