Examples for AbsSurvey


In [1]:
# imports
from astropy.coordinates import SkyCoord

from xastropy.igm.abs_sys import abs_survey as xiaa
from xastropy.igm.abs_sys import abssys_utils as abssys

Simple instantiation


In [2]:
reload(xiaa)
gensurvey = xiaa.GenericAbsSurvey()
gensurvey


Out[2]:
[AbslineSurvey: nsys=0, type=Generic, ref=]

In [3]:
gensys = abssys.GenericAbsSystem(NHI=16., zabs=1.244)
gensys.coord = SkyCoord(ra=123.1143*u.deg, dec=-12.4321*u.deg)
gensys.name = 'Sys1'
#
gensys2 = abssys.GenericAbsSystem(NHI=17., zabs=1.744)
gensys2.coord = SkyCoord(ra=223.1143*u.deg, dec=42.4321*u.deg)
gensys2.name = 'Sys2'

In [4]:
gensurvey.nsys = 2
gensurvey._abs_sys.append(gensys)
gensurvey._abs_sys.append(gensys2)

In [5]:
gensurvey._abs_sys


Out[5]:
[[AbslineSystem: Sys1 Generic 08:12:27.432 -12:25:55.56, z=1.244, NHI=16],
 [AbslineSystem: Sys2 Generic 14:52:27.432 42:25:55.56, z=1.744, NHI=17]]

Parsing


In [8]:
gensurvey.NHI


Out[8]:
array([ 16.,  17.])

In [9]:
gensurvey.zabs


Out[9]:
array([ 1.244,  1.744])

In [ ]: