#pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 #pragma version=1.06b #pragma IgorVersion=7 #pragma moduleName=spidergram // by tony.withers@uwo.ca // Version 1.06b. A beta release - please let me know if you find a bug. // How to use this package // Select Spidergram from the Macros menu to create the spidergram panel // and preview plot. To import data from a spreadsheet, select the area // of the spreadsheet that includes all of the data, with the element // symbols in either the first row or the first column. Copy and paste // into the spidergram panel. // Input data consists of a text wave containing element symbols, and one // or more numerical waves containing element concentrations in ppm or // wt. %. The text wave and data wave(s) *must* have the same length. // Select a text wave containing element symbols from the popup menu, // then select data waves from the listbox in the Data Selection area. // Input data are normalized and reordered according to the selections in // Data Treatment, and only those elements present in both the input and // the selected element ordering scheme will be in the output. If 'skip // blanks' is not selected, every element in the ordering scheme will be // listed on the category axis, otherwise just those in the input data. // Elements in the input waves for which there are no data in the // selected normalizing scheme will be output as NaN. The plot window // shows a preview of the output data. Click the 'Do It' button in the // Data Output area to save the ordered and normalized data in waves // within a subfolder of the current data folder. The name of the // detination subfolder can be edited in the Data Output section. You can // choose whether to create a table and plot for the output data. The // spidergram panel and preview plot will close after the data have been // saved. // ********************************************************************** // ***** IMPORTANT NOTE: **** // ***** **** // ***** the values in the element order waves and **** // ***** normalizing values waves are not guaranteed **** // ***** to be right. In fact, there are very likely **** // ***** to be errors, so caveat emptor! Please let me **** // ***** know if you find errors, and send suggestions **** // ***** for other useful normalizing values. Send me **** // ***** a reference, or (preferably) tabulated values! **** // ***** **** // ********************************************************************** // Details // The text wave used as input must contain properly capitalized element // symbols. Non-alphabetic characters such as whitespace and numerals are // ignored. This means that the output from a mass spectrometer that has // element masses alongside the symbols is acceptable. It's up to you to // perform any needed corrections to the data. // The plot order and normalizing values are stored in waves in the // Packages:spidergram data folder. Look in the spider_init() function to // see how these are created. Follow the same format to add more options // for normalizing and plot order. The default options for the spidergram // plot can be edited in the spider_style() function. menu "Macros" "Spidergram", /Q, spider_init() end function spider_init() NewDataFolder /O root:Packages NewDataFolder /O root:Packages:Spidergram DFREF dfr=root:Packages:Spidergram // Waves with o_ prefix define order of elements for a category plot; // waves with n_ prefix contain normalizing values (wt. ppm). Data // waves will be divided by corresponding values in normalizing wave // and plotted in the selected order. // n_waves have element symbol as dimension labels from 1 to 92. // o_waves are text waves containing element symbols in order. // If no value is given for an element concentration in the // normalizing wave, the output will have a NaN value. If an element // is present in the order wave but not in the data it will be // optionally skipped. // ------------------- Create element order waves ---------------------- make /o/n=0/T dfr:o_AtomicNo /WAVE=o_AtomicNo o_AtomicNo = {"","H","He","Li","Be","B","C","N","O","F"} o_AtomicNo[10] = {"Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K"} o_AtomicNo[20] = {"Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu"} o_AtomicNo[30] = {"Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y"} o_AtomicNo[40] = {"Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In"} o_AtomicNo[50] = {"Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr"} o_AtomicNo[60] = {"Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm"} o_AtomicNo[70] = {"Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au"} o_AtomicNo[80] = {"Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac"} o_AtomicNo[90] = {"Th","Pa","U"} // Hofmann, A.W. (1988) Chemical differentiation of the Earth: the // relationship between mantle, continental crust, and oceanic crust // Earth and Planetary Science Letters, 90: 297-314 make /O/N=0/T dfr:o_Hofmann /WAVE=o_Hofmann o_Hofmann={"Rb","Pb","U","Th","Ba","K","La","Ce","Nb","Sn"} o_Hofmann[10]={"Pr","Sr","Nd","Hf","Zr","Na","Sm","Eu","Gd","Tb"} o_Hofmann[20]={"Dy","Ho","Yb","Er","Y","Tm","Ti","Lu","Al","Cu"} o_Hofmann[30]={"Ca","Sc","Si","Fe","Co","Mg","Ni"} // Shannon, R.D. (1976) Revised effective ionic radii and systematic // studies of interatomic distances in halides and chalcogenides. Acta // Cryst. v.A32, p.751-767. // VIII-coordinated // U and Eu appear twice (two valences). So they'll be plotted twice :) make /O/N=0/T dfr:o_radiusVIII /WAVE=o_radiusVIII o_radiusVIII={"Zr","U","Sc","Mg","Zn","Sb","Li","Fe","Pb","Mn"} o_radiusVIII[10]={"Ce","Lu","Yb","Tm","U","Er","Ho","Y","Dy","Tb"} o_radiusVIII[20]={"Th","Gd","Eu","Sm","Pm","Cd","Nd","Ca","Pr","Ce"} o_radiusVIII[30]={"La","Bi","Na","Eu","Sr","Pb","Ba","K","Rb","Cs"} // VI-coordinated ionic radius order // several elements will appear twice in output // so output will have to be corrected for valence make /O/N=0/T dfr:o_radiusVI /WAVE=o_radiusVI o_radiusVI={"Si","Mn","Al","Mo","W","Sb","Ti","Nb","Ta","Fe"} o_radiusVI[10]={"Mn","Mo","W","Sn","Zr","Mg","U","Zn","Sc","Sb"} o_radiusVI[20]={"Li","Bi","Pb","Fe","Mn","Lu","Yb","Ce","Y"} make /o/n=0/T dfr:o_order1 /WAVE=o_order1 o_order1={"Rb","Ba","Th","Nb","La","Ce","Nd","Sm","Eu","Gd","Dy","Er","Yb","Sc"} make /o/n=0/T dfr:o_LILplus /WAVE=o_LILplus o_LILplus={"Rb","Ba","Th","Nb","U","K","La","Ce","Pb","Nd","Sm","Zr","Eu","Ti","Gd","Tb","Dy","Er","Yb"} make /o/n=0/T dfr:o_order2 /WAVE=o_order2 o_order2={"Ba","Rb","Nb","La","Ce","Pr","Sr","Nd","Zr","Hf","Sm","Eu","Gd","Tb","Dy","Ho","Er","Y","Yb","Lu"} make /o/n=0/T dfr:o_REE /WAVE=o_REE o_REE={"La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"} make /o/n=0/T dfr:o_REE /WAVE=o_SDZ o_REE={"Ba","Nb","K","La","Ce","Pr","Sr","P","Nd","F","Sm","Zr","Eu","Ti","Gd","Tb","Dy","Y","Ho","Er","Tm","Yb","Lu"} make /O/N=0/T dfr:wave0 /WAVE=o_Zhang o_Zhang={"Cs","Rb","Th","Ba","B","U","K","Nb","La","Be"} o_Zhang[10]={"Ta","Li","F","P","Ce","Sr","Pr","Nd","Ti","Sm"} o_Zhang[20]={"Eu","Hf","Gd","Zr","Tb","Dy","Na","Ho","Er","Tm"} o_Zhang[30]={"Yb","Lu","Y","Cr","V"} // -------------------- create normalizing waves ------------------------ make /o/n=93 dfr: n_template /WAVE= n_template // can use this to create new ones; examples follow :) variable i for (i=1;i<93;i+=1) SetDimLabel 0, i, $o_AtomicNo[i], n_template endfor n_template=nan // Barrat, J.A., Zanda, B., Moynier, F., Bollinger, C., Liorzou, C., // Bayon, G. (2012) Geochemistry of CI chondrites: Major and trace // elements, and Cu and Zn Isotopes. Geochimica et Cosmochimica Acta // 83: 79–92. duplicate /o n_template dfr:n_CI /WAVE=n_CI n_CI[%Li]=1.44 n_CI[%Be]=0.0226 n_CI[%Na]=4800 n_CI[%Mg]=94200 n_CI[%Al]=7900 n_CI[%Si]=105200 n_CI[%P]=1010 n_CI[%K]=550 n_CI[%Ca]=8400 n_CI[%Sc]=5.85 n_CI[%Ti]=449 n_CI[%V]=52.4 n_CI[%Cr]=2627 n_CI[%Mn]=1910 n_CI[%Fe]=195200 n_CI[%Co]=519 n_CI[%Ni]=11300 n_CI[%Cu]=127 n_CI[%Zn]=303 n_CI[%Ga]=9.48 n_CI[%Rb]=2.33 n_CI[%Sr]=7.73 n_CI[%Y]=1.56 n_CI[%Zr]=3.52 n_CI[%Nb]=0.289 n_CI[%Cs]=0.189 n_CI[%Ba]=2.46 n_CI[%La]=0.235 n_CI[%Ce]=0.6 n_CI[%Pr]=0.091 n_CI[%Nd]=0.464 n_CI[%Sm]=0.153 n_CI[%Eu]=0.0586 n_CI[%Gd]=0.206 n_CI[%Tb]=0.0375 n_CI[%Dy]=0.254 n_CI[%Ho]=0.0566 n_CI[%Er]=0.166 n_CI[%Tm]=0.0262 n_CI[%Yb]=0.168 n_CI[%Lu]=0.0246 n_CI[%Hf]=0.107 n_CI[%Ta]=0.0148 n_CI[%W]=0.11 n_CI[%Pb]=2.69 n_CI[%Th]=0.0283 n_CI[%U]=0.0077 // McDonough, W.F. & Sun, S.-s. (1995) The composition of the Earth duplicate /o n_template dfr:n_CI_MDS /WAVE=n_CI_MDS n_CI_MDS[%Li]=1.5 n_CI_MDS[%Be]=0.025 n_CI_MDS[%B]=0.9 n_CI_MDS[%C]=35000 n_CI_MDS[%N]=3180 n_CI_MDS[%F]=60 n_CI_MDS[%Na]=5100 n_CI_MDS[%Mg]=96500 n_CI_MDS[%Al]=8600 n_CI_MDS[%Si]=106500 n_CI_MDS[%P]=1080 n_CI_MDS[%S]=54000 n_CI_MDS[%Cl]=680 n_CI_MDS[%K]=550 n_CI_MDS[%Ca]=9250 n_CI_MDS[%Sc]=5.92 n_CI_MDS[%Ti]=440 n_CI_MDS[%V]=56 n_CI_MDS[%Cr]=2650 n_CI_MDS[%Mn]=1920 n_CI_MDS[%Fe]=181000 n_CI_MDS[%Co]=500 n_CI_MDS[%Ni]=10500 n_CI_MDS[%Cu]=120 n_CI_MDS[%Zn]=310 n_CI_MDS[%Ga]=9.2 n_CI_MDS[%Ge]=31 n_CI_MDS[%As]=1.85 n_CI_MDS[%Se]=21 n_CI_MDS[%Br]=3.57 n_CI_MDS[%Rb]=2.3 n_CI_MDS[%Sr]=7.25 n_CI_MDS[%Y]=1.57 n_CI_MDS[%Zr]=3.82 n_CI_MDS[%Nb]=0.24 n_CI_MDS[%Mo]=0.9 n_CI_MDS[%Ru]=0.71 n_CI_MDS[%Rh]=0.13 n_CI_MDS[%Pd]=0.55 n_CI_MDS[%Ag]=0.2 n_CI_MDS[%Cd]=0.71 n_CI_MDS[%In]=0.08 n_CI_MDS[%Sn]=1.65 n_CI_MDS[%Sb]=0.14 n_CI_MDS[%Tc]=2.33 n_CI_MDS[%I]=0.45 n_CI_MDS[%Cs]=0.19 n_CI_MDS[%Ba]=2.41 n_CI_MDS[%La]=0.237 n_CI_MDS[%Ce]=0.613 n_CI_MDS[%Pr]=0.0928 n_CI_MDS[%Nd]=0.457 n_CI_MDS[%Sm]=0.148 n_CI_MDS[%Eu]=0.0563 n_CI_MDS[%Gd]=0.199 n_CI_MDS[%Tb]=0.0361 n_CI_MDS[%Dy]=0.246 n_CI_MDS[%Ho]=0.0546 n_CI_MDS[%Er]=0.16 n_CI_MDS[%Tm]=0.0247 n_CI_MDS[%Yb]=0.161 n_CI_MDS[%Lu]=0.0246 n_CI_MDS[%Hf]=0.103 n_CI_MDS[%Ta]=0.0136 n_CI_MDS[%W]=0.093 n_CI_MDS[%Re]=0.04 n_CI_MDS[%Os]=0.49 n_CI_MDS[%Ir]=0.455 n_CI_MDS[%Pt]=1.01 n_CI_MDS[%Au]=0.14 n_CI_MDS[%Hg]=0.3 n_CI_MDS[%Tl]=0.14 n_CI_MDS[%Pb]=2.47 n_CI_MDS[%Bi]=0.11 n_CI_MDS[%Th]=0.029 n_CI_MDS[%U]=0.0074 duplicate /o n_template dfr:n_BSE /WAVE=n_BSE n_BSE[%Li]=1.6 n_BSE[%Be]=0.068 n_BSE[%B]=0.3 n_BSE[%C]=120 n_BSE[%N]=2 n_BSE[%F]=75 n_BSE[%Na]=2.67 n_BSE[%Mg]=228000 n_BSE[%Al]=23500 n_BSE[%Si]=210000 n_BSE[%P]=90 n_BSE[%S]=250 n_BSE[%Cl]=17 n_BSE[%K]=240 n_BSE[%Ca]=25300 n_BSE[%Sc]=16.2 n_BSE[%Ti]=1205 n_BSE[%V]=82 n_BSE[%Cr]=2625 n_BSE[%Mn]=1045 n_BSE[%Fe]=62600 n_BSE[%Co]=105 n_BSE[%Ni]=1960 n_BSE[%Cu]=30 n_BSE[%Zn]=55 n_BSE[%Ga]=4 n_BSE[%Ge]=1.1 n_BSE[%As]=0.05 n_BSE[%Se]=0.075 n_BSE[%Br]=0.05 n_BSE[%Rb]=0.6 n_BSE[%Sr]=19.9 n_BSE[%Y]=4.3 n_BSE[%Zr]=10.5 n_BSE[%Nb]=0.658 n_BSE[%Mo]=0.05 n_BSE[%Ru]=0.005 n_BSE[%Rh]=0.0009 n_BSE[%Pd]=0.0039 n_BSE[%Ag]=0.008 n_BSE[%Cd]=0.04 n_BSE[%In]=0.011 n_BSE[%Sn]=0.13 n_BSE[%Sb]=0.0055 n_BSE[%Tc]=0.012 n_BSE[%I]=0.01 n_BSE[%Cs]=0.021 n_BSE[%Ba]=6.6 n_BSE[%La]=0.648 n_BSE[%Ce]=1.675 n_BSE[%Pr]=0.254 n_BSE[%Nd]=1.25 n_BSE[%Sm]=0.406 n_BSE[%Eu]=0.154 n_BSE[%Gd]=0.544 n_BSE[%Tb]=0.099 n_BSE[%Dy]=0.674 n_BSE[%Ho]=0.149 n_BSE[%Er]=0.438 n_BSE[%Tm]=0.068 n_BSE[%Yb]=0.441 n_BSE[%Lu]=0.0675 n_BSE[%Hf]=0.283 n_BSE[%Ta]=0.037 n_BSE[%W]=0.029 n_BSE[%Re]=0.00028 n_BSE[%Os]=0.0034 n_BSE[%Ir]=0.0032 n_BSE[%Pt]=0.0071 n_BSE[%Au]=0.001 n_BSE[%Hg]=0.01 n_BSE[%Tl]=0.0035 n_BSE[%Pb]=0.15 n_BSE[%Bi]=0.0025 n_BSE[%Th]=0.0795 n_BSE[%U]=0.0203 // Sun, S.-s. & McDonough, W.F. (1989) Chemical and isotopic // systematics of oceanic basalts: implications for mantle composition // and processes. In: Saunders, A.D. & Norry, M.J. (eds), Magmatism in // the Ocean Basins, Geological Society Special Publication No. 42, // pp. 313-345. // primitive mantle duplicate /o n_template dfr:n_pMantle /WAVE=n_pMantle n_pMantle[%Cs]=0.032 n_pMantle[%Tl]=0.005 n_pMantle[%Rb]=0.635 n_pMantle[%Ba]=6.989 n_pMantle[%W]=0.02 n_pMantle[%Th]=0.085 n_pMantle[%U]=0.021 n_pMantle[%Nb]=0.713 n_pMantle[%Ta]=0.041 n_pMantle[%K]=250 n_pMantle[%La]=0.687 n_pMantle[%Ce]=1.775 n_pMantle[%Pb]=0.185 n_pMantle[%Pr]=0.276 n_pMantle[%Mo]=0.063 n_pMantle[%Sr]=21.1 n_pMantle[%P]=95 n_pMantle[%Nd]=1.354 n_pMantle[%F]=26 n_pMantle[%Sm]=0.444 n_pMantle[%Zr]=11.2 n_pMantle[%Hf]=0.309 n_pMantle[%Eu]=0.168 n_pMantle[%Sn]=0.17 n_pMantle[%Sb]=0.005 n_pMantle[%Ti]=1300 n_pMantle[%Gd]=0.596 n_pMantle[%Tb]=0.108 n_pMantle[%Dy]=0.737 n_pMantle[%Li]=1.6 n_pMantle[%Y]=4.55 n_pMantle[%Ho]=0.164 n_pMantle[%Er]=0.48 n_pMantle[%Tm]=0.074 n_pMantle[%Yb]=0.493 n_pMantle[%Lu]=0.074 // 'normal' mid-ocean ridge basalt duplicate /o n_template dfr:n_NMORB /WAVE=n_NMORB n_NMORB[%Cs]=0.007 n_NMORB[%Tl]=0.0014 n_NMORB[%Rb]=0.56 n_NMORB[%Ba]=6.3 n_NMORB[%W]=0.01 n_NMORB[%Th]=0.12 n_NMORB[%U]=0.047 n_NMORB[%Nb]=2.33 n_NMORB[%Ta]=0.132 n_NMORB[%K]=600 n_NMORB[%La]=2.5 n_NMORB[%Ce]=7.5 n_NMORB[%Pb]=0.3 n_NMORB[%Pr]=1.32 n_NMORB[%Mo]=0.31 n_NMORB[%Sr]=90 n_NMORB[%P]=510 n_NMORB[%Nd]=7.3 n_NMORB[%F]=210 n_NMORB[%Sm]=2.63 n_NMORB[%Zr]=74 n_NMORB[%Hf]=2.05 n_NMORB[%Eu]=1.02 n_NMORB[%Sn]=1.1 n_NMORB[%Sb]=0.01 n_NMORB[%Ti]=7600 n_NMORB[%Gd]=3.68 n_NMORB[%Tb]=0.67 n_NMORB[%Dy]=4.55 n_NMORB[%Li]=4.3 n_NMORB[%Y]=28 n_NMORB[%Ho]=1.01 n_NMORB[%Er]=2.97 n_NMORB[%Tm]=0.456 n_NMORB[%Yb]=3.05 n_NMORB[%Lu]=0.455 // enriched mid-ocean ridge basalt duplicate /o n_template dfr:n_EMORB /WAVE=n_EMORB n_EMORB[%Cs]=0.063 n_EMORB[%Tl]=0.013 n_EMORB[%Rb]=5.04 n_EMORB[%Ba]=57 n_EMORB[%W]=0.092 n_EMORB[%Th]=0.6 n_EMORB[%U]=0.18 n_EMORB[%Nb]=8.3 n_EMORB[%Ta]=0.47 n_EMORB[%K]=2100 n_EMORB[%La]=6.3 n_EMORB[%Ce]=15 n_EMORB[%Pb]=0.6 n_EMORB[%Pr]=2.05 n_EMORB[%Mo]=0.47 n_EMORB[%Sr]=155 n_EMORB[%P]=620 n_EMORB[%Nd]=9 n_EMORB[%F]=250 n_EMORB[%Sm]=2.6 n_EMORB[%Zr]=73 n_EMORB[%Hf]=2.03 n_EMORB[%Eu]=0.91 n_EMORB[%Sn]=0.8 n_EMORB[%Sb]=0.01 n_EMORB[%Ti]=6000 n_EMORB[%Gd]=2.97 n_EMORB[%Tb]=0.53 n_EMORB[%Dy]=3.55 n_EMORB[%Li]=3.5 n_EMORB[%Y]=22 n_EMORB[%Ho]=0.79 n_EMORB[%Er]=2.31 n_EMORB[%Tm]=0.356 n_EMORB[%Yb]=2.37 n_EMORB[%Lu]=0.354 // ocean island basalt duplicate /o n_template dfr:n_OIB /WAVE=n_OIB n_OIB[%Cs]=0.387 n_OIB[%Tl]=0.077 n_OIB[%Rb]=31 n_OIB[%Ba]=350 n_OIB[%W]=0.56 n_OIB[%Th]=4 n_OIB[%U]=1.02 n_OIB[%Nb]=48 n_OIB[%Ta]=2.7 n_OIB[%K]=12000 n_OIB[%La]=37 n_OIB[%Ce]=80 n_OIB[%Pb]=3.2 n_OIB[%Pr]=9.7 n_OIB[%Mo]=2.4 n_OIB[%Sr]=660 n_OIB[%P]=2700 n_OIB[%Nd]=38.5 n_OIB[%F]=1150 n_OIB[%Sm]=10 n_OIB[%Zr]=280 n_OIB[%Hf]=7.8 n_OIB[%Eu]=3 n_OIB[%Sn]=2.7 n_OIB[%Sb]=0.03 n_OIB[%Ti]=17200 n_OIB[%Gd]=7.62 n_OIB[%Tb]=1.05 n_OIB[%Dy]=5.6 n_OIB[%Li]=5.6 n_OIB[%Y]=29 n_OIB[%Ho]=1.06 n_OIB[%Er]=2.62 n_OIB[%Tm]=0.35 n_OIB[%Yb]=2.16 n_OIB[%Lu]=0.3 // Rudnick, R.L and Gao, S. (2003) Composition of the Continental // Crust. In Treatise on Geochemistry. // bulk continental crust duplicate /o n_template dfr:n_CCrust /WAVE=n_CCrust n_CCrust[%Li]=16 n_CCrust[%Be]=1.9 n_CCrust[%B]=11 n_CCrust[%N]=56 n_CCrust[%F]=553 n_CCrust[%Na]=22997.58951 n_CCrust[%Mg]=28342.96844 n_CCrust[%Al]=84151.79482 n_CCrust[%Si]=283266.9762 n_CCrust[%P]=436.4351134 n_CCrust[%S]=404 n_CCrust[%Cl]=244 n_CCrust[%K]=14942.65999 n_CCrust[%Ca]=45740.53534 n_CCrust[%Sc]=21.9 n_CCrust[%Ti]=4195.846217 n_CCrust[%V]=138 n_CCrust[%Cr]=135 n_CCrust[%Mn]=774.4618464 n_CCrust[%Fe]=52080.12972 n_CCrust[%Co]=26.6 n_CCrust[%Ni]=59 n_CCrust[%Cu]=27 n_CCrust[%Zn]=72 n_CCrust[%Ga]=16 n_CCrust[%Ge]=1.3 n_CCrust[%As]=2.5 n_CCrust[%Se]=0.13 n_CCrust[%Br]=0.88 n_CCrust[%Rb]=49 n_CCrust[%Sr]=320 n_CCrust[%Y]=19 n_CCrust[%Zr]=132 n_CCrust[%Nb]=8 n_CCrust[%Mo]=0.8 n_CCrust[%Ru]=0.0006 n_CCrust[%Pd]=0.0015 n_CCrust[%Ag]=0.056 n_CCrust[%Cd]=0.08 n_CCrust[%In]=0.052 n_CCrust[%Sn]=1.7 n_CCrust[%Sb]=0.2 n_CCrust[%I]=0.7 n_CCrust[%Cs]=2 n_CCrust[%Ba]=456 n_CCrust[%La]=20 n_CCrust[%Ce]=43 n_CCrust[%Pr]=4.9 n_CCrust[%Nd]=20 n_CCrust[%Sm]=3.9 n_CCrust[%Eu]=1.1 n_CCrust[%Gd]=3.7 n_CCrust[%Tb]=0.6 n_CCrust[%Dy]=3.6 n_CCrust[%Ho]=0.77 n_CCrust[%Er]=2.1 n_CCrust[%Tm]=0.28 n_CCrust[%Yb]=1.9 n_CCrust[%Lu]=0.3 n_CCrust[%Hf]=3.7 n_CCrust[%Ta]=0.7 n_CCrust[%W]=1 n_CCrust[%Re]=0.000188 n_CCrust[%Os]=0.000041 n_CCrust[%Ir]=0.000037 n_CCrust[%Pt]=0.0015 n_CCrust[%Au]=0.0013 n_CCrust[%Hg]=0.03 n_CCrust[%Tl]=0.5 n_CCrust[%Pb]=11 n_CCrust[%Bi]=0.18 n_CCrust[%Th]=5.6 n_CCrust[%U]=1.3 // upper continental crust duplicate /o n_template dfr:n_UCC /WAVE=n_UCC n_UCC[%Si]=311313 n_UCC[%Ti]=3836 n_UCC[%Al]=81505 n_UCC[%Fe]=39176 n_UCC[%Mn]=774 n_UCC[%Mg]=14955 n_UCC[%Ca]=25657 n_UCC[%Na]=24258 n_UCC[%K]=23244 n_UCC[%P]=654 n_UCC[%Li]=24 n_UCC[%Be]=2.1 n_UCC[%B]=17 n_UCC[%N]=83 n_UCC[%F]=557 n_UCC[%S]=62 n_UCC[%Cl]=370 n_UCC[%Sc]=14 n_UCC[%V]=97 n_UCC[%Cr]=92 n_UCC[%Co]=17.3 n_UCC[%Ni]=47 n_UCC[%Cu]=28 n_UCC[%Zn]=67 n_UCC[%Ga]=17.5 n_UCC[%Ge]=1.4 n_UCC[%As]=4.8 n_UCC[%Se]=0.09 n_UCC[%Br]=1.6 n_UCC[%Rb]=84 n_UCC[%Sr]=320 n_UCC[%Y]=21 n_UCC[%Zr]=193 n_UCC[%Nb]=12 n_UCC[%Mo]=1.1 n_UCC[%Ru]=0.00034 n_UCC[%Pd]=0.00052 n_UCC[%Ag]=0.053 n_UCC[%Cd]=0.09 n_UCC[%In]=0.056 n_UCC[%Sn]=2.1 n_UCC[%Sb]=0.4 n_UCC[%I]=1.4 n_UCC[%Cs]=4.9 n_UCC[%Ba]=628 n_UCC[%La]=31 n_UCC[%Ce]=63 n_UCC[%Pr]=7.1 n_UCC[%Nd]=27 n_UCC[%Sm]=4.7 n_UCC[%Eu]=1 n_UCC[%Gd]=4 n_UCC[%Tb]=0.7 n_UCC[%Dy]=3.9 n_UCC[%Ho]=0.83 n_UCC[%Er]=2.3 n_UCC[%Tm]=0.3 n_UCC[%Yb]=1.96 n_UCC[%Lu]=0.31 n_UCC[%Hf]=5.3 n_UCC[%Ta]=0.9 n_UCC[%W]=1.9 n_UCC[%Re]=0.000198 n_UCC[%Os]=0.000031 n_UCC[%Ir]=0.000022 n_UCC[%Pt]=0.0005 n_UCC[%Au]=0.0015 n_UCC[%Hg]=0.05 n_UCC[%Tl]=0.9 n_UCC[%Pb]=17 n_UCC[%Bi]=0.16 n_UCC[%Th]=10.5 n_UCC[%U]=2.7 // Pearce, J.A., Harris, N.B.W. and Tindle, A.G. (1984) Trace Element // Discrimination Diagrams for the Tectonic Interpretation of Granitic // Rocks. Journal of Petrology, 25: 956-983. // ocean ridge granite duplicate /o n_template dfr:n_ORG /WAVE=n_ORG n_ORG[%K]=0.332 n_ORG[%Rb]=4 n_ORG[%Ba]=50 n_ORG[%Th]=0.8 n_ORG[%Ta]=0.7 n_ORG[%Nb]=10 n_ORG[%Ce]=35 n_ORG[%Hf]=9 n_ORG[%Zr]=340 n_ORG[%Sm]=9 n_ORG[%Y]=70 n_ORG[%Yb]=80 // need more of these... // ---------------------- end of reference data ----------------------- newdatafolder /o dfr:spiderData spider_makePanel() end function spider_makePanel() DFREF dfr=root:Packages:spidergram wave /T w_newwavelist=ListToTextWave(spider_datawaves(), ";") duplicate /o w_newwavelist dfr:w_wavelist /wave=w_wavelist killwaves /Z w_newwavelist make /o/n=(numpnts(w_wavelist)) dfr:w_waveselection /wave=w_waveselection variable i=0,deltaY=23,v_left=20,v_top=10,groupw=200,font=12,grout=10 dowindow /k spiderpanel NewPanel /K=1/N=spiderpanel/W=(0,0,740,420) as "Spidergram" ModifyPanel /W=spiderpanel, noEdit=1, fixedsize=1 string cmd="spiderdata" // set default save location cmd=SelectString(datafolderexists(cmd) , cmd, uniquename(cmd, 11, 1)) GroupBox group0,pos={v_left-grout,v_top+deltaY*i},size={groupw,deltaY*8},title="Data selection" GroupBox group0,fSize=font i+=1 // store values internally in these controls PopupMenu popElements, mode=1, Value=WaveList("*", ";", "DIMS:1,TEXT:1"), title="Elements",pos={v_left,v_top+deltaY*i},size={220,20} PopupMenu popElements, help={"select elements wave" }, proc=spider_popup,fSize=font i+=1 ListBox listboxWaves, win=spiderpanel, pos={v_left,v_top+deltaY*i},size={groupw-2*grout, deltaY*4.7}, listwave=w_wavelist, selwave=w_waveselection, mode=9 ListBox listboxWaves, win=spiderpanel, proc=spider_ListBox spider_setSelecter() i+=5 Checkbox check_ppm, pos={v_left,v_top+deltaY*i}, fsize=font, value=1, proc=spider_checkbox, title="ppm" Checkbox check_ppm, mode=1,help={"input data in ppm"} Checkbox check_pc, pos={v_left+80,v_top+deltaY*i}, fsize=font, value=0, proc=spider_checkbox, title="wt. % " Checkbox check_pc, mode=1,help={"input data in wt. %"} i+=1.5 GroupBox group1,pos={v_left-grout,v_top+deltaY*i},size={groupw,deltaY*4},title="Data treatment" GroupBox group1,fSize=font i+=1 PopupMenu popOrder, mode=1, Value="data;"+spider_waves(2), title="Plot order",pos={v_left,v_top+deltaY*i},size={130,20} PopupMenu popOrder, help={"Select element order for output" }, proc=spider_popup,fSize=font, popmatch="REE" i+=1 PopupMenu popNorm, mode=1, Value="none;"+spider_waves(1), title="Normalize to",pos={v_left,v_top+deltaY*i},size={130,20} PopupMenu popNorm, help={"Select normalization scheme" }, proc=spider_popup,fSize=font, popmatch="CI" i+=1 Checkbox checkSkip, pos={v_left,v_top+deltaY*i}, fsize=font, value=1, proc=spider_checkbox, title="Skip blanks" Checkbox checkSkip, mode=0,help={"Don't plot elements that aren't in input data"} Checkbox checkNum, pos={v_left+100,v_top+deltaY*i}, fsize=font, value=1, proc=spider_checkbox, title="Ignore #s" Checkbox checkNum, mode=0,help={"Strip numbers from the elements wave"} i+=1.5 GroupBox group2,pos={v_left-grout,v_top+deltaY*i},size={groupw,deltaY*4.3},title="Data output" GroupBox group2,fSize=font i+=1 SetVariable setvarDF,pos={v_left,v_top+deltaY*i},size={180,16},title="Save to:" SetVariable setvarDF,value=_STR:cmd, proc=spider_setVar SetVariable setvarDF,help={"Name for output data folder"}, fsize=font i+=1 Checkbox checkPlot, pos={v_left,v_top+deltaY*i}, fsize=font, value=1, title="New plot" Checkbox checkPlot, mode=0,help={"Plot output in new graph window"} Checkbox checkTable, pos={v_left+90,v_top+deltaY*i}, fsize=font, value=1, title="Make table" Checkbox checkTable, mode=0,help={"Edit output in new table"} i+=1 Button sav,pos={v_left+135,v_top+deltaY*i},size={45,20},title="Do It", proc=spider_button Button sav,help={"Save a copy of the output"} Display /W=(220,10,730,410) /HOST=SpiderPanel/N=spidergraph ModifyGraph /W=SpiderPanel#spidergraph frameStyle=7 spider_style("spiderpanel#spidergraph") SetActiveSubwindow SpiderPanel #if IgorVersion() >= 7 SetWindow SpiderPanel#spidergraph, activeChildFrame=0 #endif SetWindow SpiderPanel, hook(hPaste)=spider_hook spider_update() end function spider_setvar(s) STRUCT WMsetVariableAction &s if(s.eventcode!=8) return 0 endif string cmd=cleanupname(s.sval,0) SetVariable $s.ctrlName, win=$s.win, value=_STR:cmd if(datafolderexists(cmd)) SetVariable $s.ctrlName, win=$s.win, valueBackColor=(65535,0,0) else SetVariable $s.ctrlName, win=$s.win, valueBackColor=(65535,65535,65535) endif end function spider_button(s) STRUCT WMButtonAction &s if(s.eventCode!=2) return 0 endif spider_save() end function spider_checkbox(s) STRUCT WMCheckboxAction &s if(stringmatch(s.ctrlName, "check_ppm")) Checkbox check_pc, win=$s.win, value=0 endif if(stringmatch(s.ctrlName, "check_pc")) Checkbox check_ppm, win=$s.win, value=0 endif spider_update() end function spider_popup(s) STRUCT WMPopupAction &s if(stringmatch(s.ctrlName, "popElements")) // set wave selector spider_setSelecter() endif spider_update() return 0 end function /t spider_waves(type) variable type // 1=numeric n_waves, 2=text o_waves DFREF dfr=root:Packages:Spidergram string s_list="", s_wave="" variable i=0, imax=CountObjectsDFR(dfr, 1) do s_wave=GetIndexedObjNameDFR(dfr, 1, i) if(type==1 && stringmatch(s_wave, "n_*")) s_list=addlistitem(s_wave[2,strlen(s_wave)-1], s_list) elseif(type==2 && stringmatch(s_wave, "o_*")) s_list=addlistitem(s_wave[2,strlen(s_wave)-1], s_list) endif i+=1 while(i-1) e_out[numpnts(e_out)]={w_cat[v_value]} elseif(skipBlanks==0) e_out[numpnts(e_out)]={w_order[i]} endif endfor wave /T w_wavelist=dfr:w_wavelist wave w_waveselection=dfr:w_waveselection make /n=0/o/WAVE dfr:wavs /wave=wavs nn=numpnts(w_wavelist) if (nn==0) return 0 endif for (i=0;i-1) if(waveexists(w_norm)) if(FindDimLabel(w_norm, 0, w_order[i])!=-2) w_out[numpnts(w_out)]={w_in[v_value]*mult/w_norm[%$w_order[i]]} else w_out[numpnts(w_out)]={nan} endif else w_out[numpnts(w_out)]={w_in[v_value]} // output not normalized, has same units as input endif elseif(skipBlanks==0) w_out[numpnts(w_out)]={nan} endif endfor note w_out note(w_in) appendtograph /w=spiderpanel#spidergraph w_out vs e_out endfor // relabel Y axis controlinfo /w=spiderpanel popNorm if(stringmatch(s_value, "none")) controlinfo /w=spiderpanel check_ppm s_value=SelectString(v_value , "wt. %", "ppm") else s_value="/"+s_value endif label /W=spiderpanel#spidergraph left, s_value sprintf s "element wave: %s;", nameofwave(w_elements) sprintf s "%s data: %s;", s, nameofwave(w_elements) sprintf s "%s order: %s;", s, (nameofwave(w_order))[2,strlen(nameofwave(w_order))-1] if(waveexists(w_norm)) sprintf s "%s normalized to: %s;", s, (nameofwave(w_norm))[2,strlen(nameofwave(w_norm))-1] endif note w_out "" spider_style("spiderpanel#spidergraph") return 1 end static function spider_zapBlanks(w) wave /T w variable i=0 do if(strlen(w[i])==0) deletepoints i, 1, w else i+=1 endif while(iElementMatches(w_firstRow)) redimension /N=(numcolumns, numrows) w_table w_table[][]=stringfromlist(p, stringfromlist(q, s, "\r"), "\t") // inefficient??? numrows=dimsize(w_table,0) numcolumns=dimsize(w_table,1) endif string s_newname="", s_elementsName="elements" if(checkname(s_elementsName, 1)) s_elementsName=uniquename(s_elementsName+"_", 1, 1) endif make /T/n=(numcolumns-1) $s_elementsName /wave=w_elements w_elements=w_table[0][p+1] for (row=1;rownumpnts(w_input)-1) break endif endif while(1) endfor return hits end #if IgorVersion() < 7 function /wave ListToTextWave(s_list, s_seperator) string s_list, s_seperator make /T/free/n=(itemsinlist(s_list, s_seperator)) w w=stringfromlist(p, s_list, s_seperator) return w end #endif