A modern Python application for processing ICP-MS Hf (Hafnium) isotope data from Neptune Plus™ High Resolution Multicollector ICP-MS instruments.
All code is released under an MIT open-source license.
- Modern GUI: Clean, intuitive interface with real-time progress feedback
- Batch Processing: Process multiple .exp files in a single operation
- Data Filtering: Filter data based on Hf180 threshold values
- Statistical Analysis: Automatic calculation of means, standard deviations, and standard errors
- Export Results: Save processed results to Excel format
- Error Handling: Comprehensive error handling with detailed user feedback
- Installation
- Usage
- Project Structure
- Features in Detail
- Scientific Background
- Troubleshooting
- References
- Contact
- Python 3.7 or higher
- Works on Linux, Windows, macOS, and BSD
-
Clone or download this repository
-
Install dependencies:
pip install -r requirements-py3.txt
Or install manually:
pip install pandas>=1.3.0 numpy>=1.20.0 openpyxl>=3.0.0
-
Run the application:
python main.py
- Launch the application by running
python main.py - Click "Browse Folder" to select a folder containing
.expfiles - (Optional) Set the Hf180 Filter Threshold to exclude data points below a certain value
- Click "Process Data" to process all
.expfiles in the selected folder - Review results in the results table
- Click "Save Results" to export results to an Excel file
- Click the "Browse Folder" button
- Navigate to the folder containing your
.expfiles - The application will automatically detect and count all
.expfiles
- Set the Hf180 threshold value (default: 0)
- Data points with Hf180 ≤ threshold will be excluded from calculations
- This helps remove low-quality measurements
- Click "Process Data" to start batch processing
- Progress is shown in real-time in the status log
- Results appear in the table as each file is processed
- Green checkmarks indicate successful processing
- Red X marks indicate errors (check the log for details)
The results table displays:
- Sample: File name (without .exp extension)
- β2/3: Yb mass fractionation correction factor
- 2σ: Two standard errors for β2/3
- β7/9: Hf mass fractionation correction factor
- 2σ: Two standard errors for β7/9
- 176Yb/177Hf: Corrected Yb/Hf ratio
- 2σ: Two standard errors for 176Yb/177Hf
- 176Lu/177Hf: Corrected Lu/Hf ratio
- 2σ: Two standard errors for 176Lu/177Hf
- 176Hf/177Hf*: Corrected radiogenic Hf ratio
- 2σ: Two standard errors for 176Hf*/177Hf
- Cycles: Number of measurement cycles used
- Click "Save Results" to export all results to an Excel file
- Choose the save location and filename
- The exported file contains all calculated parameters for all processed samples
Hf/
├── main.py # Application entry point
├── gui.py # Modern GUI implementation
├── calculation.py # Hf isotope calculation engine
├── Napture.py # .exp file reader
├── requirements-py3.txt # Python dependencies
├── data/ # Sample .exp files for testing
├── reference/ # Reference spreadsheet
└── README.md # This file
main.py: Application entry point that initializes the GUIgui.py: Modern, user-friendly graphical interface with:- Real-time progress tracking
- Status logging
- Results table with sorting
- Export functionality
calculation.py: Core calculation engine implementing:- Mass fractionation corrections (β2/3 and β7/9)
- Isobaric interference corrections
- Statistical analysis
Napture.py: File parser for Neptune Plus™ .exp files
The Hf isotope data processing involves several sequential steps to correct for mass fractionation and isobaric interferences. The following sections detail each step of the calculation process.
-
File Reading: The application reads measurement cycles from
.expfiles exported by the Neptune Plus™ instrument. Each cycle contains measurements for isotopes: 172Yb, 173Yb, 175Lu, 176Hf, 177Hf, 178Hf, 179Hf, and 180Hf. -
Quality Filtering: Data points are filtered based on the Hf180 threshold value. Only cycles where Hf180 > threshold are retained for analysis. This removes low-quality measurements that may affect the accuracy of calculations.
Mass fractionation occurs during ICP-MS analysis due to the preferential transmission of heavier isotopes. Two correction factors (beta values) are calculated:
The β2/3 factor corrects for mass fractionation in Yb measurements using the ratio of 172Yb/173Yb:
β2/3 = ln(R_measured / R_true) / ln(M_172 / M_173)
Where:
R_measured= measured 172Yb/173Yb ratioR_true= true natural abundance ratio (1.35274)M_172= atomic mass of 172Yb (171.936378)M_173= atomic mass of 173Yb (172.938208)
This factor is calculated for each measurement cycle and then averaged across all cycles.
The β7/9 factor corrects for mass fractionation in Hf measurements using the ratio of 177Hf/179Hf:
β7/9 = ln(R_measured / R_true) / ln(M_177 / M_178)
Where:
R_measured= measured 177Hf/179Hf ratioR_true= true natural abundance ratio (1/0.7325)M_177= atomic mass of 177Hf (176.943217)M_178= atomic mass of 178Hf (178.945812)
Like β2/3, this factor is calculated per cycle and then averaged.
The 176Hf peak suffers from isobaric interferences from 176Yb and 176Lu, which have the same nominal mass. These interferences must be corrected before calculating accurate Hf isotope ratios.
The contribution of 176Yb to the 176Hf signal is calculated using:
176Yb = 172Yb × (M_172 / M_176)^β2/3_mean × A_176
Where:
172Yb= measured 172Yb signalM_172= atomic mass of 172Yb (171.936378)M_176= atomic mass of 176Yb (175.942564)β2/3_mean= mean β2/3 value across all cyclesA_176= natural abundance of 176Yb (0.588596)
The contribution of 176Lu to the 176Hf signal is calculated using:
176Lu = 175Lu × (M_175 / M_176)^β2/3_mean × A_176
Where:
175Lu= measured 175Lu signalM_175= atomic mass of 175Lu (174.94077)M_176= atomic mass of 176Lu (175.942679)β2/3_mean= mean β2/3 value across all cyclesA_176= natural abundance of 176Lu (0.02658)
The radiogenic 176Hf* (the portion of 176Hf that is not from interference) is calculated by subtracting the interferences:
176Hf* = 176Hf - 176Yb - 176Lu
After correcting for interferences, the isotope ratios are calculated and corrected for mass fractionation.
176Yb/177Hf = (176Yb / 177Hf) × (M_176_Yb / M_177_Hf)^β7/9
This ratio indicates the Yb contamination level in the sample.
176Lu/177Hf = (176Lu / 177Hf) × (M_176_Lu / M_177_Hf)^β7/9
This ratio indicates the Lu contamination level in the sample.
176Hf*/177Hf = (176Hf* / 177Hf) × (M_176_Hf / M_177_Hf)^β7/9_mean
This is the primary result, representing the corrected radiogenic Hf isotope ratio, where:
M_176_Hf= atomic mass of 176Hf (175.941406)M_177_Hf= atomic mass of 177Hf (176.943217)β7/9_mean= mean β7/9 value across all cycles
For each calculated parameter, the following statistics are computed:
- Mean: Average value across all measurement cycles
- Standard Deviation (SD): Measure of data dispersion
- Relative Standard Deviation (RSD): SD/Mean, expressed as a percentage
- Two Standard Errors (2SE): 2 × (SD / √n), where n is the number of cycles
- Relative Standard Errors (2RSE): 2SE/Mean
The 2SE values are reported in the results table and represent the 95% confidence interval for the mean values.
The calculations use the following physical constants:
-
Yb Isotopes:
- 172Yb/173Yb natural ratio: 1.35274
- Atomic masses: 172Yb = 171.936378, 173Yb = 172.938208, 176Yb = 175.942564
- 176Yb natural abundance: 0.588596
-
Lu Isotopes:
- Atomic masses: 175Lu = 174.94077, 176Lu = 175.942679
- 176Lu natural abundance: 0.02658
-
Hf Isotopes:
- 179Hf/177Hf natural ratio: 0.7325
- Atomic masses: 176Hf = 175.941406, 177Hf = 176.943217, 178Hf = 178.945812
The application performs the following calculations:
-
Mass Fractionation Corrections:
- β2/3: Ytterbium mass fractionation correction
- β7/9: Hafnium mass fractionation correction
-
Isobaric Interference Corrections:
- Correction for 176Yb interference on 176Hf
- Correction for 176Lu interference on 176Hf
- Calculation of radiogenic 176Hf*
-
Isotope Ratio Calculations:
- 176Yb/177Hf (corrected)
- 176Lu/177Hf (corrected)
- 176Hf*/177Hf (corrected)
-
Statistical Analysis:
- Mean values
- Standard deviation (SD)
- Relative standard deviation (RSD)
- Two standard errors (2SE)
- Relative standard errors (2RSE)
- Instrument: Neptune Plus™ High Resolution Multicollector ICP-MS
- File Type:
.exp(export files from the instrument) - Required Columns: Cycle, Time, 172Yb, 173Yb, 175Lu, 176Hf, 177Hf, 178Hf, 179Hf, 180Hf
This software implements the methods described in:
-
Iizuka & Hirata (2005): Improvements of precision and accuracy in in situ Hf isotope microanalysis of zircon using the laser ablation-MC-ICPMS technique. Chemical Geology, 220(1-2), 121-137. DOI: 10.1016/j.chemgeo.2005.03.010
-
Chu et al. (2002): Hf isotope ratio analysis using multi-collector inductively coupled plasma mass spectrometry: An evaluation of isobaric interference corrections. Journal of Analytical Atomic Spectrometry, 17, 1567-1574. DOI: 10.1039/B206707B
The calculation formulas can also be found in the reference spreadsheet in the reference/ folder.
Problem: "No .exp files found"
- Solution: Ensure you've selected the correct folder and that it contains
.expfiles
Problem: "No data points remaining after filtering"
- Solution: Lower the Hf180 threshold value or check your data quality
Problem: "Error reading file"
- Solution: Ensure the file is a valid Neptune Plus™ .exp file and not corrupted
Problem: "Missing required columns"
- Solution: Verify that your .exp file contains all required isotope columns
Problem: Processing hangs or is slow
- Solution: Large files may take time. Check the status log for progress updates.
If you encounter issues not listed here:
- Check the status log in the application for detailed error messages
- Verify your .exp files are in the correct format
- Ensure all dependencies are installed correctly
-
Iizuka, T., & Hirata, T. (2005). Improvements of precision and accuracy in in situ Hf isotope microanalysis of zircon using the laser ablation-MC-ICPMS technique. Chemical Geology, 220(1-2), 121-137. https://doi.org/10.1016/j.chemgeo.2005.03.010
-
Chu, N.C., Taylor, R.N., Chavagnac, V., Nesbitt, R.W., Boella, R.M., Milton, J.A., Germain, C.R., Bayon, G., & Burton, K. (2002). Hf isotope ratio analysis using multi-collector inductively coupled plasma mass spectrometry: An evaluation of isobaric interference corrections. Journal of Analytical Atomic Spectrometry, 17, 1567-1574. http://dx.doi.org/10.1039/B206707B
This software is actively maintained. For questions, bug reports, or feature requests, please contact:
Email: [email protected]
In newer versions, the Hf and Sr processing programs have been combined into the Isotope software suite. For more information about the integrated version, please visit the Isotope project page.
This project is licensed under the MIT License - see the LICENSE file for details.
Enjoy using Hf Isotope Data Processor!