Skip to content

Commit 55cbee6

Browse files
committed
change from pandas to NumPy data structure
1 parent 9737045 commit 55cbee6

9 files changed

+2807
-1985
lines changed

README.rst

+9-74
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,21 @@ pyEQUIB Python Package
99
.. image:: https://travis-ci.org/equib/pyEQUIB.svg?branch=master
1010
:target: https://travis-ci.org/equib/pyEQUIB
1111
:alt: Build Status
12-
12+
1313
.. image:: https://ci.appveyor.com/api/projects/status/b3gw6vgf8s0vu8nv?svg=true
1414
:target: https://ci.appveyor.com/project/danehkar/pyequib
1515
:alt: Build Status
16-
17-
.. image:: https://coveralls.io/repos/github/equib/pyEQUIB/badge.svg?branch=master
16+
17+
.. image:: https://coveralls.io/repos/github/equib/pyEQUIB/badge.svg?
1818
:target: https://coveralls.io/github/equib/pyEQUIB?branch=master
1919
:alt: Coverage Status
20-
20+
2121
.. image:: https://img.shields.io/badge/license-GPL-blue.svg
2222
:target: https://github.com/equib/pyEQUIB/blob/master/LICENSE
2323
:alt: GitHub license
24-
25-
.. image:: https://img.shields.io/conda/vn/conda-forge/pyequib.svg
26-
:target: https://anaconda.org/conda-forge/pyequib
27-
:alt: Anaconda Cloud
28-
29-
.. image:: https://readthedocs.org/projects/pyequib/badge/?version=latest
30-
:target: https://pyequib.readthedocs.io/en/latest/?badge=latest
31-
:alt: Documentation Status
32-
24+
3325
.. image:: https://img.shields.io/badge/python-2.7%2C%203.8-blue.svg
3426
:alt: Support Python versions 2.7 and 3.8
35-
36-
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4287576.svg
37-
:target: https://doi.org/10.5281/zenodo.4287576
38-
:alt: Zenodo
39-
40-
.. image:: http://joss.theoj.org/papers/10.21105/joss.02798/status.svg
41-
:target: https://doi.org/10.21105/joss.02798
42-
:alt: JOSS
4327

4428

4529
Description
@@ -58,7 +42,7 @@ Installation
5842
============
5943

6044
Dependent Python Packages
61-
-------------------------
45+
----------------------
6246

6347
This package requires the following packages:
6448

@@ -82,11 +66,6 @@ To install the stable version, you can use the preferred installer program (pip)
8266
8367
$ pip install pyequib
8468
85-
or you can install it from the cross-platform package manager *conda*:
86-
87-
.. code-block::
88-
89-
$ conda install -c conda-forge pyequib
9069
9170
How to Use
9271
==========
@@ -185,7 +164,7 @@ The Documentation of the Python functions provides in detail in the *API Documen
185164
abb5007 = pyequib.calc_abundance(temperature=temperature, density=density,
186165
line_flux=iobs5007, atomic_levels=levels5007,
187166
elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij,
188-
h_i_aeff_data=hi_rc_data.aeff)
167+
h_i_aeff_data=hi_rc_data['aeff'][0])
189168
print('N(O^2+)/N(H+):', abb5007)
190169

191170
which gives::
@@ -308,7 +287,7 @@ The Documentation of the Python functions provides in detail in the *API Documen
308287
density=np.float64(5000.0)
309288
pyequib.print_ionic(temperature=temperature, density=density,
310289
elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij,
311-
h_i_aeff_data=hi_rc_data.aeff)
290+
h_i_aeff_data=hi_rc_data['aeff'][0])
312291

313292
which gives::
314293
@@ -914,49 +893,5 @@ For more information on how to use the API functions from the pyEQUIB libray, pl
914893

915894
References
916895
==========
917-
* Danehkar, A. (2020). pyEQUIB Python Package, an addendum to proEQUIB: IDL Library for Plasma Diagnostics and Abundance Analysis. *J. Open Source Softw.*, **5**, 2798. doi:`10.21105/joss.02798 <https://doi.org/10.21105/joss.02798>`_ ads:`2020JOSS....5.2798D <https://ui.adsabs.harvard.edu/abs/2020JOSS....5.2798D>`_.
918-
919-
* Danehkar, A. (2018). proEQUIB: IDL Library for Plasma Diagnostics and Abundance Analysis. *J. Open Source Softw.*, **3**, 899. doi:`10.21105/joss.00899 <https://doi.org/10.21105/joss.00899>`_ ads:`2018JOSS....3..899D <https://ui.adsabs.harvard.edu/abs/2018JOSS....3..899D>`_.
920-
921-
922-
Citation
923-
========
924-
925-
Using **pyEQUIB** in a scholarly publication? Please cite thess papers:
926-
927-
.. code-block:: bibtex
928-
929-
@article{Danehkar2020,
930-
author = {{Danehkar}, Ashkbiz},
931-
title = {pyEQUIB Python Package, an addendum to proEQUIB: IDL Library for Plasma Diagnostics and Abundance Analysis},
932-
journal = {Journal of Open Source Software},
933-
volume = {5},
934-
number = {55},
935-
pages = {2798},
936-
year = {2020},
937-
doi = {10.21105/joss.02798}
938-
}
939-
940-
@article{Danehkar2018,
941-
author = {{Danehkar}, Ashkbiz},
942-
title = {proEQUIB: IDL Library for Plasma Diagnostics and Abundance Analysis},
943-
journal = {Journal of Open Source Software},
944-
volume = {3},
945-
number = {32},
946-
pages = {899},
947-
year = {2018},
948-
doi = {10.21105/joss.00899}
949-
}
950-
951-
Learn More
952-
==========
896+
* Danehkar, A. (2018). proEQUIB: IDL Library for Plasma Diagnostics and Abundance Analysis. *J. Open Source Softw.*, **3**, 899. doi:`10.21105/joss.00899 <https://doi.org/10.21105/joss.00899>`_ ads:`2018JOSS....3..899D <https://ui.adsabs.harvard.edu/abs/2018JOSS....3..899D>`_.
953897

954-
================== =============================================
955-
**Documentation** https://pyequib.readthedocs.io/
956-
**Repository** https://github.com/equib/pyEQUIB
957-
**Issues & Ideas** https://github.com/equib/pyEQUIB/issues
958-
**Conda-Forge** https://anaconda.org/conda-forge/pyequib
959-
**PyPI** https://pypi.org/project/pyequib/
960-
**DOI** `10.21105/joss.02798 <https://doi.org/10.21105/joss.02798>`_
961-
**Archive** `10.5281/zenodo.4287576 <https://doi.org/10.5281/zenodo.4287576>`_
962-
================== =============================================

examples/cel_abundance_example.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@
4141
print('Emissivity(O III 5007):', emis)
4242

4343
abb5007 = pyequib.calc_abundance(temperature=temperature, density=density, line_flux=iobs5007, atomic_levels=levels5007,
44-
elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij, h_i_aeff_data=hi_rc_data.aeff)
44+
elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij, h_i_aeff_data=hi_rc_data['aeff'][0])
4545
print('N(O^2+)/N(H+):', abb5007)
4646

4747
nlj = pyequib.calc_populations(temperature=temperature, density=density, elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij)
4848
print('Atomic Level Populations:', nlj)
4949

50-
5150
n_crit = pyequib.calc_crit_density(temperature=temperature, elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij)
5251
print('Critical Densities:', n_crit)
5352

@@ -58,7 +57,7 @@
5857

5958
pyequib.print_ionic(temperature=temperature, density=density,
6059
elj_data=o_iii_elj, omij_data=o_iii_omij, aij_data=o_iii_aij,
61-
h_i_aeff_data=hi_rc_data.aeff)
60+
h_i_aeff_data=hi_rc_data['aeff'][0])
6261
#
6362
# --- End MAIN program. ---------------
6463

examples/cel_diagnostics_example.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
atom_aij_file = os.path.join(base_dir,data_dir, 'AtomAij.fits')
2222
atom_rc_sh95_file = os.path.join(base_dir,data_rc_dir, 'rc_SH95.fits')
2323

24-
2524
atom = 'h'
2625
ion = 'ii' # H I Rec
2726
hi_rc_data = atomneb.read_aeff_sh95(atom_rc_sh95_file, atom, ion)
@@ -30,7 +29,7 @@
3029
ion = 'ii'
3130
s_ii_elj = atomneb.read_elj(atom_elj_file, atom, ion, level_num=5) # read Energy Levels (Ej)
3231
s_ii_omij = atomneb.read_omij(atom_omij_file, atom, ion) # read Collision Strengths (Omegaij)
33-
s_ii_aij = atomneb.read_aij(atom_aij_file, atom, ion) # read Transition Probabilities (Aij)\
32+
s_ii_aij = atomneb.read_aij(atom_aij_file, atom, ion) # read Transition Probabilities (Aij)
3433

3534
upper_levels = '1,2,1,3/'
3635
lower_levels = '1,5/'
@@ -62,6 +61,6 @@
6261

6362
pyequib.print_ionic(temperature=temperature, density=density,
6463
elj_data=s_ii_elj, omij_data=s_ii_omij, aij_data=s_ii_aij,
65-
h_i_aeff_data=hi_rc_data.aeff)
64+
h_i_aeff_data=hi_rc_data['aeff'][0])
6665

6766
# --- End MAIN program. ---------------

examples/orl_abundance_example.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
ion = 'iii' # Ne II
6464
ne_ii_rc_data = atomneb.read_aeff_collection(atom_rc_all_file, atom, ion)
6565

66-
h_i_aeff_data = h_i_rc_data.aeff
67-
he_i_aeff_data = he_i_rc_data.aeff
68-
he_ii_aeff_data = he_ii_rc_data.aeff
66+
h_i_aeff_data = h_i_rc_data['aeff'][0]
67+
he_i_aeff_data = he_i_rc_data['aeff'][0]
68+
he_ii_aeff_data = he_ii_rc_data['aeff'][0]
6969

7070
temperature = np.float64(10000.0)
7171
density = np.float64(5000.0)

0 commit comments

Comments
 (0)