Menu

averagedCompLineProfiles_script

A London

averagedCompLineProfiles_script


Average many 1D composition line profiles

This script loops over a list of pos files and calculates averaged elemental composition line profiles at positions defined from a "cluster statistics" file, which contains centres and sizes of each cluster for each pos file. Outputs a summary file and plots.

This only makes elemental profiles, rather than ionic ones, but it could be added as a separate script. Ideally this script's functionality would be part of a function - it may be in the future.

A profile for each cluster is saved (below) and averages plots for each different sample name are made. If you want to separate by radius or run etc. you will need to do that your self.

The "demo" files provided don't show anything interesting, only to prove that it does in fact run. Provide your own lists of pos files, rrng files, cluster statistics files and sample names to see it really work.

Syntax


(At the moment) this is a script and is run by typing its name, or pressing F5 (run) with the script open.

Inputs


  • zs = 2; Number of cluster extents to extend the profile by (top and bottom). Where cluster extent is the maximum size of the cluster in the Z-direction.
  • profilePoints = 100; number of data points for each cluster profile actual distance, for each cluster, is: x = ((pp-profilePoints/2)*2*zs/profilePoints)*Zextent
  • posList = {'clusterOverlap_noise2.pos'}; list of full pos files
  • sampleName = {'demo1'}; list of each sample identifier (used to group mulitple pos files together)
  • rangeFileList = {'clusterOverlap.rrng'}; a range file for each pos file
  • clusterFiles = {'clusterOverlap_noise2_ClusterAnalysis.csv'}; A cluster statistics file for each pos file, this will be read using the [readClusterData].m function, if you have cluster data in another format use a different function or convert it.

Outputs


This script produces several outputs, the key ones are

Summary table t2

All composition profiles are saved in a stacked or "long" format:
writetable(t2,'AveragedLineProfiles.csv');
This table has the count of each element for each position (bin) of the line profile, it also stores the run number, cluster number, rz = Z-extent (used for normalisation), sample ID number (indexes to the sampleName list above) and the volume of the bin. There is a separate row for each elemental count at each bin position and cluster, which is why this is called a stacked dataset.

Averaged data

The temperary averaged data for all the cluster for each sampleName are stored in the table d. At the end of the script this table is used to plot a composition profile for each group of samples with the same sampleName.

zprofileCache

This cell array contains to cells for each pos file. The first is the z-profile data and the second is a list of the elements present. The z-profile data has one cell for each cluster, each cell has profilePoints rows and as many columns as there are elements. Each column has the counts of each element in that bin position (each row is one bin in the z-direction).


Related

Wiki: Detailed function explanations
Wiki: FAQ

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.