Skip to content

Commit

Permalink
docs and notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
profxj committed Aug 4, 2016
1 parent c42d1aa commit 04045cd
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 194 deletions.
10 changes: 4 additions & 6 deletions docs/abscomp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ The default sets the properties listed above::
More commonly, one will instantiate with one
`~linetools.spectralline.AbsLine` object::

lya = AbsLine(1215.670*u.AA)
lya.analy['vlim'] = [-300.,300.]*u.km/u.s
lya.attrib['z'] = 2.92939
lya = AbsLine(1215.670*u.AA, z=2.92939)
lya.limits.set([-300.,300.]*u.km/u.s) # vlim
abscomp1 = AbsComponent.from_abslines([lya])

or multiple::

lyb = AbsLine(1025.7222*u.AA)
lyb.analy['vlim'] = [-300.,300.]*u.km/u.s
lyb.attrib['z'] = lya.attrib['z']
lyb = AbsLine(1025.7222*u.AA, z=lya.attrib['z'])
lyb.limits.set([-300.,300.]*u.km/u.s) # vlim
abscomp = AbsComponent.from_abslines([lya,lyb])

One may also instantiate from a *dict*, usually read
Expand Down
10 changes: 4 additions & 6 deletions docs/abssys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ More commonly, one will instantiate with one or more AbsComponent objects::

# HI Lya, Lyb
radec = SkyCoord(ra=123.1143*u.deg, dec=-12.4321*u.deg)
lya = AbsLine(1215.670*u.AA)
lya.analy['vlim'] = [-300.,300.]*u.km/u.s
lya.attrib['z'] = 2.92939
lyb = AbsLine(1025.7222*u.AA)
lyb.analy['vlim'] = [-300.,300.]*u.km/u.s
lyb.attrib['z'] = lya.attrib['z']
lya = AbsLine(1215.670*u.AA, z=2.92939)
lya.limits.set([-300.,300.]*u.km/u.s) # vlim
lyb = AbsLine(1025.7222*u.AA, z=lya.attrib['z'])
lyb.limits.set([-300.,300.]*u.km/u.s) # vlim
abscomp = AbsComponent.from_abslines([lya,lyb])
abscomp.coord = radec
# Finish
Expand Down
76 changes: 37 additions & 39 deletions docs/examples/AbsComponent_ColumnDensities.ipynb

Large diffs are not rendered by default.

108 changes: 52 additions & 56 deletions docs/examples/AbsComponent_examples.ipynb

Large diffs are not rendered by default.

89 changes: 52 additions & 37 deletions docs/examples/AbsLine_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Examples for AbsLine class (v1.3)"
"# Examples for AbsLine class (v1.4)"
]
},
{
Expand Down Expand Up @@ -42,10 +42,18 @@
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Loading abundances from Asplund2009\n",
"Abundances are relative by number on a logarithmic scale with H=12\n"
]
},
{
"data": {
"text/plain": [
"<AbsLine: CIV 1548, wrest=1548.1950 Angstrom>"
"<AbsLine: CIV 1548, z=0.0000 wrest=1548.1950 Angstrom>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -84,6 +92,7 @@
" 'Jk': 0.0,\n",
" 'Ref': 'Verner1994',\n",
" 'Z': 6,\n",
" 'abundance': 8.4299999999999997,\n",
" 'col0': masked,\n",
" 'col7': masked,\n",
" 'el': 0,\n",
Expand All @@ -93,13 +102,17 @@
" 'gk': 4,\n",
" 'group': 1,\n",
" 'ion': 4,\n",
" 'ion_correction': 0.0,\n",
" 'ion_name': u'CIV',\n",
" 'is_EUV': False,\n",
" 'is_HI': False,\n",
" 'is_Strong': True,\n",
" 'log(w*f)': 2.4685792560428057,\n",
" 'mol': '',\n",
" 'name': 'CIV 1548',\n",
" 'nj': 0,\n",
" 'nk': 0,\n",
" 'rel_strength': 10.898579256042805,\n",
" 'wrest': <Quantity 1548.195 Angstrom>}"
]
},
Expand Down Expand Up @@ -134,9 +147,7 @@
" u'flag_kin': 0,\n",
" u'flg_eye': 0,\n",
" u'flg_limit': 0,\n",
" u'name': 'CIV 1548',\n",
" u'vlim': {'unit': u'km / s', 'value': [0.0, 0.0]},\n",
" u'wvlim': {'unit': u'Angstrom', 'value': [0.0, 0.0]}},\n",
" u'name': 'CIV 1548'},\n",
" 'attrib': {u'DEC': 0.0,\n",
" u'EW': {'unit': u'Angstrom', 'value': 0.0},\n",
" u'N': {'unit': u'1 / cm2', 'value': 0.0},\n",
Expand All @@ -162,20 +173,25 @@
" 'Jk': 0.0,\n",
" 'Ref': 'Verner1994',\n",
" 'Z': 6,\n",
" 'abundance': 8.43,\n",
" 'el': 0,\n",
" 'f': 0.1899999976158142,\n",
" 'gamma': {'unit': u'1 / s', 'value': 0.0},\n",
" 'gj': 2,\n",
" 'gk': 4,\n",
" 'group': 1,\n",
" 'ion': 4,\n",
" 'ion_correction': 0.0,\n",
" 'ion_name': u'CIV',\n",
" 'is_EUV': False,\n",
" 'is_HI': False,\n",
" 'is_Strong': True,\n",
" 'log(w*f)': 2.4685792560428057,\n",
" 'mol': '',\n",
" 'name': 'CIV 1548',\n",
" 'nj': 0,\n",
" 'nk': 0,\n",
" 'rel_strength': 10.898579256042805,\n",
" 'wrest': {'unit': u'Angstrom', 'value': 1548.195}},\n",
" 'ltype': u'Abs',\n",
" 'name': 'CIV 1548',\n",
Expand Down Expand Up @@ -210,7 +226,7 @@
{
"data": {
"text/plain": [
"<AbsLine: CIV 1548, wrest=1548.1950 Angstrom>"
"<AbsLine: CIV 1548, z=0.0000 wrest=1548.1950 Angstrom>"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -260,7 +276,7 @@
}
],
"source": [
"wrest_values = ltlu.parse_abslines(abslines, 'wrest')\n",
"wrest_values = ltlu.parse_speclines(abslines, 'wrest')\n",
"wrest_values"
]
},
Expand All @@ -282,22 +298,22 @@
"data": {
"text/html": [
"&lt;Table length=2&gt;\n",
"<table id=\"table4594379280\">\n",
"<thead><tr><th>wrest</th><th>name</th><th>Z</th><th>ion</th><th>Ej</th><th>z</th><th>EW</th><th>sig_EW</th><th>flag_N</th><th>logN</th></tr></thead>\n",
"<thead><tr><th>Angstrom</th><th></th><th></th><th></th><th>1 / cm</th><th></th><th>Angstrom</th><th>Angstrom</th><th></th><th></th></tr></thead>\n",
"<thead><tr><th>float64</th><th>str8</th><th>int64</th><th>int64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>int64</th><th>float64</th></tr></thead>\n",
"<tr><td>1215.67</td><td>HI 1215</td><td>1</td><td>1</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td></tr>\n",
"<tr><td>1548.195</td><td>CIV 1548</td><td>6</td><td>4</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td></tr>\n",
"<table id=\"table4599800336\">\n",
"<thead><tr><th>wrest</th><th>name</th><th>Z</th><th>ion</th><th>Ej</th><th>z</th><th>EW</th><th>sig_EW</th><th>flag_N</th><th>logN</th><th>sig_logN</th></tr></thead>\n",
"<thead><tr><th>Angstrom</th><th></th><th></th><th></th><th>1 / cm</th><th></th><th>Angstrom</th><th>Angstrom</th><th></th><th></th><th></th></tr></thead>\n",
"<thead><tr><th>float64</th><th>str8</th><th>int64</th><th>int64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>int64</th><th>float64</th><th>float64</th></tr></thead>\n",
"<tr><td>1215.67</td><td>HI 1215</td><td>1</td><td>1</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td><td>0.0</td></tr>\n",
"<tr><td>1548.195</td><td>CIV 1548</td><td>6</td><td>4</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td><td>0.0</td></tr>\n",
"</table>"
],
"text/plain": [
"<Table length=2>\n",
" wrest name Z ion Ej z EW sig_EW flag_N logN \n",
"Angstrom 1 / cm Angstrom Angstrom \n",
"float64 str8 int64 int64 float64 float64 float64 float64 int64 float64\n",
"-------- -------- ----- ----- ------- ------- -------- -------- ------ -------\n",
" 1215.67 HI 1215 1 1 0.0 0.0 0.0 0.0 0 0.0\n",
"1548.195 CIV 1548 6 4 0.0 0.0 0.0 0.0 0 0.0"
" wrest name Z ion Ej ... sig_EW flag_N logN sig_logN\n",
"Angstrom 1 / cm ... Angstrom \n",
"float64 str8 int64 int64 float64 ... float64 int64 float64 float64 \n",
"-------- -------- ----- ----- ------- ... -------- ------ ------- --------\n",
" 1215.67 HI 1215 1 1 0.0 ... 0.0 0 0.0 0.0\n",
"1548.195 CIV 1548 6 4 0.0 ... 0.0 0 0.0 0.0"
]
},
"execution_count": 8,
Expand Down Expand Up @@ -338,7 +354,7 @@
"outputs": [],
"source": [
"# Set analysis range\n",
"abslin.analy['wvlim'] = [6080.78, 6087.82]*u.AA"
"abslin.limits.set([6080.78, 6087.82]*u.AA) # wvlim"
]
},
{
Expand Down Expand Up @@ -377,11 +393,10 @@
},
"outputs": [],
"source": [
"abslin.analy['wvlim'] = [0.,0.]*u.AA # Zero out for test\n",
"#\n",
"abslin.analy['spec'] = lsio.readspec('../../linetools/spectra/tests/files/UM184_nF.fits')\n",
"abslin.analy['vlim'] = (-150., 150.)*u.km/u.s\n",
"abslin.attrib['z'] = 2.92929"
"abslin.setz(2.92929)\n",
"abslin.limits.set((-150., 150.)*u.km/u.s) # vlim"
]
},
{
Expand Down Expand Up @@ -416,7 +431,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"metadata": {
"collapsed": false
},
Expand All @@ -425,25 +440,25 @@
"data": {
"text/html": [
"&lt;Table length=2&gt;\n",
"<table id=\"table4595718160\">\n",
"<thead><tr><th>wrest</th><th>name</th><th>Z</th><th>ion</th><th>Ej</th><th>z</th><th>EW</th><th>sig_EW</th><th>flag_N</th><th>logN</th></tr></thead>\n",
"<thead><tr><th>Angstrom</th><th></th><th></th><th></th><th>1 / cm</th><th></th><th>Angstrom</th><th>Angstrom</th><th></th><th></th></tr></thead>\n",
"<thead><tr><th>float64</th><th>str8</th><th>int64</th><th>int64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>int64</th><th>float64</th></tr></thead>\n",
"<tr><td>1215.67</td><td>HI 1215</td><td>1</td><td>1</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td></tr>\n",
"<tr><td>1548.195</td><td>CIV 1548</td><td>6</td><td>4</td><td>0.0</td><td>2.92929</td><td>0.993502101206</td><td>0.0527114204241</td><td>1</td><td>13.9050897399</td></tr>\n",
"<table id=\"table4599866256\">\n",
"<thead><tr><th>wrest</th><th>name</th><th>Z</th><th>ion</th><th>Ej</th><th>z</th><th>EW</th><th>sig_EW</th><th>flag_N</th><th>logN</th><th>sig_logN</th></tr></thead>\n",
"<thead><tr><th>Angstrom</th><th></th><th></th><th></th><th>1 / cm</th><th></th><th>Angstrom</th><th>Angstrom</th><th></th><th></th><th></th></tr></thead>\n",
"<thead><tr><th>float64</th><th>str8</th><th>int64</th><th>int64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>int64</th><th>float64</th><th>float64</th></tr></thead>\n",
"<tr><td>1215.67</td><td>HI 1215</td><td>1</td><td>1</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0</td><td>0.0</td><td>0.0</td></tr>\n",
"<tr><td>1548.195</td><td>CIV 1548</td><td>6</td><td>4</td><td>0.0</td><td>2.92929</td><td>0.993502101206</td><td>0.0527114204241</td><td>1</td><td>13.9050897399</td><td>0.0207026007539</td></tr>\n",
"</table>"
],
"text/plain": [
"<Table length=2>\n",
" wrest name Z ion ... sig_EW flag_N logN \n",
"Angstrom ... Angstrom \n",
"float64 str8 int64 int64 ... float64 int64 float64 \n",
"-------- -------- ----- ----- ... --------------- ------ -------------\n",
" 1215.67 HI 1215 1 1 ... 0.0 0 0.0\n",
"1548.195 CIV 1548 6 4 ... 0.0527114204241 1 13.9050897399"
" wrest name Z ion ... flag_N logN sig_logN \n",
"Angstrom ... \n",
"float64 str8 int64 int64 ... int64 float64 float64 \n",
"-------- -------- ----- ----- ... ------ ------------- ---------------\n",
" 1215.67 HI 1215 1 1 ... 0 0.0 0.0\n",
"1548.195 CIV 1548 6 4 ... 1 13.9050897399 0.0207026007539"
]
},
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading

0 comments on commit 04045cd

Please sign in to comment.