-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AbsComponent work #414
AbsComponent work #414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments for revision.
@@ -64,6 +64,11 @@ from the hard-drive:: | |||
|
|||
:::: | |||
|
|||
One may also generate a set of components from a larger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a set or a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list; fixed
(mandatory column names include: `['RA', 'DEC', 'ion_name', 'z_comp', 'vmin', 'vmax']`):: | ||
You can also create a list of components using an input `astropy.table.Table` object | ||
(mandatory column names are | ||
`['RA', 'DEC', 'ion_name', 'z_comp', 'vmin', 'vmax', 'Z', 'ion', 'Ej']`):: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ion_name
mandatory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
docs/abscomp.rst
Outdated
to each corresponding AbsComponent in the `complist`. In this example, only those AbsLines expected to have rest-frame | ||
equivalent widths larger than `0.01*u.AA` will be appended, but if you wish to include all of the available AbsLines | ||
you can set `min_Wr=None`. Here, we have set `chk_sep=False` to avoid checking for coordinates because by construction the | ||
This will look for transitions in the `LineList('ISM')` object and append those within |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "within" in this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/abscomp.rst
Outdated
tab['ion_name'] = ['HI', 'HI', 'CIV', 'SiII', 'OVI'] | ||
tab['Z'] = [1,1,4,14,8] | ||
tab['ion'] = [1,1,4,2,6] | ||
tab['z_comp'] = [0.05, 0.0999, 0.1, 0.1001, 0.3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ej
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
linetools/isgm/utils.py
Outdated
@@ -270,7 +271,7 @@ def complist_from_table(table): | |||
|
|||
Notes | |||
----- | |||
Mandatory column names: 'RA', 'DEC', 'ion_name', 'z_comp', 'vmin', 'vmax' | |||
Mandatory column names: 'RA', 'DEC', 'ion_name', 'z', 'vmin', 'vmax' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be z_comp
, to differenciate from Z
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
linetools/isgm/utils.py
Outdated
else: | ||
if table[key].unit is not None: | ||
abscomp.attrib[key] *= table[key].unit | ||
complist.append(abscomp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or check all units properly afterwards here... but cannot have column with wrong units in the output AbsComponent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow this one.
@@ -360,29 +347,61 @@ def table_from_complist(complist): | |||
Special columns: 'name', 'comment', 'logN', 'sig_logN', 'flag_logN' | |||
See also complist_from_table() | |||
""" | |||
key_order = ['RA', 'DEC', 'name', 'z_comp', 'sig_z', 'Z', 'ion', 'Ej', | |||
'vmin', 'vmax','ion_name', 'flag_N', 'logN', 'sig_logN', | |||
'b','sig_b', 'specfile'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reliability
should be included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is introduced later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine. Please update the docstring accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
linetools/isgm/utils.py
Outdated
tab['ion'] = [icomp.Zion[1] for icomp in complist] | ||
|
||
# . attributes | ||
for attrib in ['zcomp', 'Ej', 'flag_N', 'logN', 'sig_logN']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add reliability
and comment
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted that these are required.
tab['name'] = [comp.name for comp in complist] | ||
tab['reliability'] = [comp.reliability for comp in complist] | ||
for key in ['comment', 'reliability']: | ||
if hasattr(complist[0], key): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of being separated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment and reliability are not required
so I prefer to separate them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine.
@@ -407,6 +426,7 @@ def iontable_from_components(components, ztbl=None, NHI_obj=None): | |||
------- | |||
iontbl : Table | |||
""" | |||
warnings.warn("It is likely this method will be Deprecated", DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me, do not think I have used this much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
I'm still not fully convinced with the units thing... I feel is important to have that check done. |
I'm willing to have a warning thrown. But |
Sure, a warning should do. Fine to merge after the warning is implemented. |
done. merging |
Started as a simple bug fix but worked into a
refactor of table_from_complist() and its opposite.
Modified docs, tests, and NB