I have a question on the Pourbaix diagram app. When I load a specific Pourbaix diagram, and try to look at the reference of each ion energies by clicking on the book icon, it just shows “citation ion-0”. Is there a way to find the reference information of each of the ion energies that were used for building the Pourbaix diagrams in MP?
Hi @KyuJung_Jun, thanks for pointing out this glitch. We are in the process of developing an updated site and will make sure the new Pourbaix app shows references correctly.
We have recently migrated all the ion reference data to portal.mpcontribs.org. If you go to that site, click “Browse” and then log in (you may have to make a new account), you can open the “Aqueous Ion Reference Data” project to see all the data in tabular form, with links to the associated references.
The majority of the ion reference energies are taken from the NIST NBS Tables, .pdfs of which are available via the links on the MPContribs project or by googling.
The aqueous ion reference data (MPContribs landing page) can be retrieved programmatically using the mpcontribs-client library. I recommend using an appropriate query to reduce the number of results and also restrict the returned fields. The list of filters is available here. Below some example code.
from mpcontribs.client import Client
client = Client(project="ion_ref_data")
# example queries - filters can be combined in same `query`
query = {"formula__in": ["Li[+]", "N2(aq)"]} # filter by formula
query = {"data__RefSolid__contains": "B2O3"} # filter RefSolid by substring
query = {"data__ΔGᶠ__gt": 100} # filter by Gibbs Free Energy of Formation
fields = ["id", "formula", "data.ΔGᶠ"] # fields to return
client.query_contributions(query=query, fields=fields, paginate=True)
As an alternative, if you have the new API client installed you can use the get_ion_reference_data() to download the entire data set (it’s the same data you get via the method in @tschaume post above).
make sure you have installed and updated mp-api and mpcontribs-client, and then:
from mp_api.client import MPRester
mpr = MPRester("<your api key>")
ion_data = mpr.get_ion_reference_data()
I was trying to make the local copy of all ion reference data in my computer, and I have tried your code. However, it turns error
File /opt/conda/lib/python3.11/site-packages/mp_api/client/mprester.py:903, in MPRester.get_ion_reference_data(self)
874 @lru_cache
875 def get_ion_reference_data(self) → list[dict]:
876 “”“Download aqueous ion reference data used in the construction of Pourbaix diagrams.
877
878 Use this method to examine the ion reference data and to add additional
(…)
901 compounds and aqueous species, Wiley, New York (1978)'}}
902 “””
→ 903 return self.contribs.query_contributions(
904 query={“project”: “ion_ref_data”},
905 fields=[“identifier”, “formula”, “data”],
906 paginate=True,
907 ).get(“data”)
AttributeError: ‘NoneType’ object has no attribute ‘query_contributions’
Much thanks for your help. I have successfully download all the ion data. However, I found a little problem,. The delta G of LiOH(aq) in the ion database I download is about -451.85 kJ/molkJ/mol, equal to the-4.683eV.However, when I tried to plot the pourbaix, by mpr.get_pourbaix_entries, I got PourbaixEntry(Li1 O1 H1 with energy=-2.6052, npH=-1.0, nPhi=-1.0, nH2O=1.0, entry_id=‘ion-1’), Such energy can’t be consistent, such things also happened in the Li+, the energy of the ion database is shown to be -293.71Kj/mol, equal to -3.04 eV, I got PourbaixEntry(Li1 O1 H1 with energy=-2.6052, npH=-1.0, nPhi=-1.0, nH2O=1.0, entry_id=‘ion-1’). Is there any detail I ignores?