docs/example01/example01.c

Go to the documentation of this file.
00001 /*
00002 Example01: How to retrieve an absortion energy.
00003 By Carlos Pascual-Izarra
00004 
00005 To compile, use the codeblock project.
00006 ...or do it manually, linking with "libcpixe.a"
00007 */
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include "../../libcpixe/libcpixe.h"
00011 int main()
00012 {
00013     char abscoeffilename[300]="../../databases/xabs.abs";
00014     int maxZ=92;
00015     AbsCoef *TotAbsCoefArray;
00016     AbsCoef ac;
00017     double E;
00018 
00019     readAbsCoef(abscoeffilename, maxZ, &TotAbsCoefArray); //The readAbsCoef function from libcpixe
00020 
00021     ac=TotAbsCoefArray[55]; //let's say that we are interested in the element with Z=55
00022     E=ac.enr[3];  //the LII absorption line is the 3rd element of the enr member
00023     printf("\n\n\nEnerLII=%lf\n\n",E);
00024 
00025     //Now a compact form for retrieving the abs coef for the K edge of Si:
00026     E=TotAbsCoefArray[14].enr[1];
00027     printf("E K=%lf\n\n",E);
00028     return 0;
00029 }

Generated on Sat Dec 8 23:11:36 2007 for libCPIXE by  doxygen 1.5.4