2D XRF data processing with Praxes
- Connect to NoMachine, and open a terminal window.
- Hop to another node on the cluster: Use: qrsh -q interactive.q -pe sge_pe 32 if you're going to do data fitting (parallel processing), otherwise any node (qrsh -q interactive.q ) is sufficient.
- Set up the praxes python environment:
- For processing data collected after January 1, 2023, run:
source /nfs/chess/sw/miniconda3_msnc/bin/activate; conda activate praxes
- For processing data collected before January 1, 2023, run:
source /nfs/chess/sw/miniconda3_msnc/bin/activate; conda activate praxes_pre2023
- Optional but convenient once praxes is open: change directory to where your data is stored. e.g. cd /nfs/chess/auxiliary/reduced_data/cycles/2022-2/x1/urban-0000-A/
- Open praxes by entering: praxes sxfm
Converting raw scan data (spec + linescans) to a single h5 file
You only need to do this step once for each scan- once it's converted, you'll work exclusively with the single h5 file this step generates.
NOTE, praxes isn't usually happy if scans of different types (flyscans, ascans, tseries) are contained under the same filename. More than one map of the same filename is fine though.
- In praxes, go to Import > Spec file
- Navigate to raw data. Choose to view All Files and select the spec file for the scan of interest.
- Choose the location where you will save the new, combined h5 file. We recommend using your auxiliary analysis area: /nfs/chess/auxiliary/reduced_data/cycles/YYYY-#/id3b/userid-X/analysis/
- Hit enter and wait.
- You should see the terminal window where praxes is running update as it converts the scan. When finished, a path to the new hdf5 file will show up in the praxes window.
Fitting spectra and generating elemental maps- first pass
You can continue directly from generating a single h5 scan file, or open an existing one.
- In the main praxes window, for the h5 file of interest, use the small triangle at the left to "drop down" to the next level. Below the filename you should see numbers indicating the scan numbers contained in that filename. Click on the scan number you're interested in working with.
- Go to Tools > Analyze MCA
- The first time you open the scan, you'll get a PyMCA popup asking you to load a configuration file. You can skip this (cancel) or load a .cfg file if you have one already.
- If this is the first time you're fitting the data, then a window will open showing a blue box with the scan dimensions.
- Check the Monitor Efficiency box- if you've done a calibration and want to apply it, you will need to change this value from 1 to the value from your run (this will be a value something like 1e-4 or 1e-5)
- Check the fit: make sure you can see the spectrum view window (View tab). Click the "plus" or crosshair icon over the blue box. Now click anywhere inside the blue box. The spectrum from that point will populate in the spectrum view window. Assess the fit- are all the peaks well fit? Are there elements that should be removed from the fit? How does the energy calibration look? More details to come on fit validation.
- When you're happy with the fit, go to Tools > Analyze spectra. This will start the processing.
- You can increase the number of nodes being used for fitting in the View > Threads window (this speeds up fitting)
Quick and dirty: Re-plotting maps in python (Jupyter notebook)
1. In a NoMachine terminal, connect to an interactive node ( qrsh -q interactive.q ). Then run export PATH="/nfs/chess/sw/anaconda3_ls/bin:$PATH" . Then change directories to desired area- Your data and notebooks are in /nfs/chess/auxiliary/reduced_data/cycles/2022-1/id3b/userid-X/setup/
OR: Use instructions here for running a remote Jupyter notebook on your machine: https://wiki.classe.cornell.edu/CHESS/Private/RemoteJupyterNotebooks; iin this case I like to start the notebook from /nfs/chess/auxiliary/reduced_data/
2. In Jupyter, locate and open the notebook file (.ipynb)
3. Check that the file paths are correct in the inputs box, then you can step through the notebook to generate, view, adjust, and save new plots.
- 25 Mar 2022