├── .gitignore ├── README.md ├── baddata ├── BadFiles.txt ├── bad_00.xdi ├── bad_01.xdi ├── bad_02.xdi ├── bad_03.xdi ├── bad_04.xdi ├── bad_05.xdi ├── bad_06.xdi ├── bad_07.xdi ├── bad_08.xdi ├── bad_09.xdi ├── bad_10.xdi ├── bad_11.xdi ├── bad_12.xdi ├── bad_13.xdi ├── bad_14.xdi ├── bad_15.xdi ├── bad_16.xdi ├── bad_17.xdi ├── bad_18.xdi ├── bad_19.xdi ├── bad_20.xdi ├── bad_21.xdi ├── bad_22.xdi ├── bad_23.xdi ├── bad_24.xdi ├── bad_25.xdi ├── bad_26.xdi ├── bad_27.xdi ├── bad_28.xdi ├── bad_29.xdi ├── bad_30.xdi ├── bad_31.xdi ├── bad_32.xdi ├── bad_33.xdi ├── bad_34.xdi └── bad_35.xdi ├── binaries ├── linux-x86 │ ├── libxdifile.so │ └── xdi_reader ├── macosx │ ├── libxdifile.dylib │ └── xdi_reader └── win32 │ ├── xdi_reader.exe │ └── xdifile.dll ├── data ├── co_metal_rt.xdi ├── cu_metal_10K.xdi ├── cu_metal_rt.xdi ├── fe2o3_rt.xdi ├── fe3c_rt.xdi ├── fe_metal_rt.xdi ├── fen_rt.xdi ├── feo_rt1.xdi ├── ni_metal_rt.xdi ├── nonxafs_1d.xdi ├── nonxafs_2d.xdi ├── nonxafs_negvalues.xdi ├── pt_metal_rt.xdi ├── se_na2so4_rt.xdi ├── se_znse_rt.xdi └── zn_znse_rt.xdi ├── doc └── Poster_XAFS15 │ ├── XDI_Poster.pdf │ ├── XDI_Poster.tex │ ├── beamerposter.sty │ ├── beamerthemeXDI.sty │ └── images │ ├── hdf5.png │ └── sqlite.png ├── filemagic ├── README.md ├── install_magic ├── magic ├── xdi.ico └── xdi.reg ├── languages ├── fortran │ ├── Makefile.in │ ├── config.h.in │ ├── configure │ ├── configure.in │ ├── install-sh │ ├── missing │ ├── reconf │ ├── str_util.f │ ├── xdi_example1.f │ └── xdifile.f ├── perl │ ├── Changes │ ├── LICENSE │ ├── MANIFEST │ ├── MANIFEST.SKIP │ ├── Makefile.PL │ ├── README.org │ ├── example │ │ └── xdi_reader.pl │ ├── lib │ │ └── Xray │ │ │ ├── XDI.pm │ │ │ ├── XDI │ │ │ └── WriterPP.pm │ │ │ └── XDIFile.pm │ └── t │ │ ├── 00_base.t │ │ ├── 01_moose_nonmoose.t │ │ ├── 02_moosish.t │ │ ├── 03_nofile.t │ │ ├── baddata │ │ ├── 01_no_xdi_line.t │ │ ├── 02_no_edge.t │ │ ├── 03_no_symbol.t │ │ ├── 06_no_minus_signs.t │ │ ├── 07_columns.t │ │ ├── 11_bad_comment_char.t │ │ ├── 12_no_dspacing.t │ │ ├── 13_inconsistent_columns.t │ │ ├── 15_nonnumeric.t │ │ ├── 18_headers.t │ │ ├── 25_things_missing.t │ │ ├── 28_datatime.t │ │ ├── 99_coverage.t │ │ └── test_coverage.sh │ │ ├── gooddata │ │ ├── 01_cu_metal_10k.t │ │ ├── 02_cu_metal_rt.t │ │ ├── 03_fe2o3.t │ │ ├── 04_fe3c_rt.t │ │ ├── 05_fe_metal_rt.t │ │ ├── 06_fen_rt.t │ │ ├── 07_feo_rt1.t │ │ ├── 08_ni_metal_rt.t │ │ ├── 09_pt_metal_rt.t │ │ ├── 10_se_na2so4_rt.t │ │ ├── 11_se_znse_rt.t │ │ └── 12_zn_na2so4_rt.t │ │ └── writer │ │ └── 01_pp.t └── python │ ├── INSTALL │ ├── dlls │ ├── darwin │ │ └── libxdifile.dylib │ └── linux64 │ │ └── libxdifile.so │ ├── setup.py │ ├── tests │ └── test1.py │ └── xdifile │ ├── __init__.py │ └── xdi.py ├── lib ├── LICENSE ├── LICENSE.slre ├── Makefile.in ├── README.md ├── build_mac_osx.sh ├── build_win32.bat ├── config.h ├── config.h.in ├── configure ├── configure.in ├── cu_metal_rt.xdi ├── install-sh ├── missing ├── reconf ├── slre.c ├── slre.h ├── strutil.c ├── strutil.h ├── test_valgrind.pl ├── writetest.c ├── xdi_reader.c ├── xdifile.c └── xdifile.h └── specification ├── README.md ├── background.md ├── dictionary.md ├── images ├── convxas.png ├── dafs.png ├── nixs.png └── xrfxas.png ├── maketex.sh ├── spec.md ├── xdi.sty ├── xdi_background.pdf ├── xdi_background.tex ├── xdi_dictionary.pdf ├── xdi_dictionary.tex ├── xdi_spec.pdf └── xdi_spec.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.o 3 | *.a 4 | *~ 5 | *# 6 | 7 | lib/autom4te.cache/* 8 | lib/Makefile 9 | lib/aclocal.m4 10 | lib/config.log 11 | lib/config.status 12 | lib/libxdifile.so 13 | lib/stamp-h1 14 | lib/xdi_reader 15 | lib/writetest 16 | 17 | languages/fortran/Makefile 18 | languages/fortran/config.h 19 | languages/fortran/config.log 20 | languages/fortran/config.status 21 | languages/fortran/stamp-h1 22 | languages/fortran/xdi_example1 23 | 24 | languages/python/build/* 25 | 26 | languages/perl/_Inline 27 | languages/perl/_build 28 | languages/perl/blib 29 | languages/perl/Build 30 | languages/perl/META.yml 31 | languages/perl/MYMETA.yml 32 | languages/perl/MYMETA.json 33 | languages/perl/MANIFEST.bak 34 | languages/perl/Makefile 35 | languages/perl/Makefile.old 36 | languages/perl/XDIFile.inl 37 | languages/perl/pm_to_blib 38 | languages/perl/t/baddata/coverage.txt 39 | languages/perl/*.inl 40 | 41 | *.aux 42 | *.dvi 43 | *.nav 44 | *.out 45 | *.snm 46 | *.toc 47 | latex/auto/* 48 | latex/xdi.log 49 | latex/xdi.pdf 50 | doc/Poster_XAFS15/XDI_Poster.log 51 | 52 | specification/auto/* 53 | specification/background_inner.tex 54 | specification/*_inner.tex 55 | specification/xdi_*.log 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | XAS Data Interchange 3 | ==================== 4 | 5 | [![License Public Domain](https://img.shields.io/badge/license-public_domain-blue.svg)](http://choosealicense.com/licenses/unlicense/) 6 | 7 | 8 | 9 | This README file explains the XAS Data Interchange (XDI) distribution. 10 | The XDI distribution contains the specification documents and various 11 | implementations of a formally specified system for reading and writing 12 | files containing single-scan XAS data. 13 | 14 | 15 | **This is a work in progress. Version 1.0 of the XDI specification has 16 | not yet been declared done.** 17 | 18 | 19 | Specification Documents 20 | ----------------------- 21 | 22 | * The [XDI specification](specification/spec.md), version 1.0. 23 | 24 | * The [metadata dictionary](specification/dictionary.md), version 1.0. 25 | 26 | * Bruce's [presentation on XDI](https://speakerdeck.com/bruceravel/xas-data-interchange-a-file-format-for-a-single-xas-spectrum) at the XAFS16 satellite meeting on [Data acquisition, treatment, storage – quality assurance in XAFS spectroscopy](https://indico.desy.de/conferenceDisplay.py?ovw=True&confId=10169) 27 | 28 | 29 | 30 | 31 | Implementations 32 | --------------- 33 | 34 | Implementations are found in directories named according to the 35 | programming language. The main C library is in `lib/`, all others are 36 | under `languages`. 37 | 38 | At this time, we provide 39 | 40 | * C (written by Matt Newville and Bruce Ravel) 41 | * Python (written by Matt Newville) 42 | * Perl (written by Bruce Ravel) 43 | * Fortran 77 (written by Matt Newville) 44 | 45 | We encourage the contribution of new language implementations, 46 | such as: 47 | 48 | * Matlab 49 | * IDL 50 | * LabView 51 | * Fortran 95 or later 52 | * Java 53 | 54 | and any other language that gets used by XAS practitioners. 55 | 56 | The contents of a folder containing a language implementation should 57 | follow the package distribution conventions used by that language 58 | community. Unit testing is strongly encouraged. So is complete 59 | documentation of the building, installation, and use of the language 60 | package. 61 | 62 | Build 63 | ----- 64 | 65 | cd into the `lib/` directory and do: 66 | 67 | ~> ./configure 68 | ~> make 69 | ~> sudo make install 70 | 71 | This will install static and dynamic libraries to `/usr/local/lib` and 72 | header files to `/usr/local/include`. 73 | 74 | Obviously, you will need a C compiler. 75 | 76 | To build the language specific interfaces, cd to the folder under 77 | `languages/` and follow the build instructions there. 78 | 79 | 80 | Other files 81 | ----------- 82 | 83 | * The `binaries/` folder contains shared object compilations of the C 84 | interface, `libxdifile` for various common operating systems. 85 | * The `data/` folder contains examples of valid XDI files 86 | * The `baddata/` folder contains examples of files that fail to 87 | validate as XDI 88 | * The `doc/` folder contains the LaTeX source of the poster on XDI 89 | presented at the XAFS15 conference 90 | * The `filemagic` folder contains tools for use by the Unix file 91 | determination system: 92 | 93 | ~> file -m magic data/co_metal_rt.xdi 94 | data/co_metal_rt.xdi: XAS Data Interchange file -- XDI specification 1.0 95 | 96 | It also defines an icon and a registry entry for XDI files on 97 | Windows. (The Windows reg entry does not currently work) 98 | -------------------------------------------------------------------------------- /baddata/BadFiles.txt: -------------------------------------------------------------------------------- 1 | invalid xdi files. None should segfault. 2 | All should either pass or give a useful error message. 3 | 4 | file status OK? description of error in file 5 | -------- -------- --- -------------------- 6 | bad_00.xdi file read Y valid xdi file, used to modify for rest of files 7 | bad_01.xdi error msg Y No XDI line at top 8 | bad_02.xdi file read(1) Y No element.edge 9 | bad_03.xdi file read(1) Y No element.symbol 10 | bad_04.xdi file read(1) Y Invalid element.edge 11 | bad_05.xdi file read(1) Y Invalid element.symbol 12 | bad_06.xdi file read(1) Y No '------' 13 | bad_07.xdi file read(2) Y No Column labels - 14 | bad_08.xdi file read(2) Y Too few Column labels 15 | bad_09.xdi file read(2) Y Too many Column labels 16 | bad_10.xdi file read(2) Y Column indices not continuous 17 | bad_11.xdi file read(3) Y Unsupported comment character 18 | bad_12.xdi file read(1) Y angle given without mono.d_spacing 19 | bad_13.xdi error msg Y inconsistent number of columns in data table -- too few 20 | bad_14.xdi error msg Y inconsistent number of columns in data table -- too many 21 | bad_15.xdi error msg Y NaN in data table 22 | bad_16.xdi error msg Y string in data table 23 | bad_17.xdi error msg Y bad number ('1.2.3') in data table 24 | bad_18.xdi error msg Y Header 'Family.Key: Value' -- no value 25 | bad_19.xdi error msg Y Header 'Family.Key: Value' -- no ':' 26 | bad_20.xdi error msg Y Header 'Family.Key: Value' -- two ':' 27 | bad_21.xdi error msg Y Header 'Family.Key: Value' -- no '.' 28 | bad_22.xdi error msg Y Header 'Family.Key: Value' -- two '.' 29 | bad_23.xdi file read(4) Y Header 'Family.Key: Value' -- key starts with number 30 | bad_24.xdi error msg Y Header 'Family.Key: Value' -- Family starts with number 31 | bad_25.xdi file read(5) Y No extra version given 32 | bad_26.xdi file read(6) Y No user comment 33 | bad_27.xdi file read(6) Y Line of '////', but no user comment 34 | bad_28.xdi file read(1) Y incorrectly format date-time 35 | bad_29.xdi file read(1) Y date-time has invalid range (month > 12) 36 | bad_30.xdi file read(1) Y Invalid element.edge and element.symbol, test accumulation in XDI_required_metadata 37 | bad_31.xdi file read(1) Y Invalid value for d-spacing, trigger error in XDI_required_metadata 38 | bad_32.xdi file read(7) Y Missing recommended fields 39 | bad_33.xdi file read(1) Y Invalid Sample.temperature 40 | bad_34.xdi file read(1) Y Invalid Facility.energy 41 | bad_35.xdi file read(1) Y Invalid Facility.current 42 | 43 | Notes: 44 | 1. files read, return value > 0, indicating Warning 45 | 2. extra column labels ignored, unspecified column labels set to 'colN' (N=1...) 46 | 3. lines with unrecognized comment characters ignored 47 | 4. keys are allowed to start with a number... 48 | 5. extra version is left as empty string '' 49 | 6. user comment is left as empty string '' 50 | 7. files read, XDI_recommended_metadata returns non-0 51 | -------------------------------------------------------------------------------- /baddata/bad_00.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_01.xdi: -------------------------------------------------------------------------------- 1 | # 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_02.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_03.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_04.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: Foo 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_05.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Foo 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_06.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | # 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_07.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Element.edge: K 3 | # Element.symbol: Cu 4 | # Scan.edge_energy: 8980.0 5 | # Mono.name: Si 111 6 | # Mono.d_spacing: 3.13553 7 | # Beamline.name: 13ID 8 | # Beamline.collimation: none 9 | # Beamline.focusing: yes 10 | # Beamline.harmonic_rejection: rhodium-coated mirror 11 | # Facility.name: APS 12 | # Facility.energy: 7.00 GeV 13 | # Facility.xray_source: APS Undulator A 14 | # Scan.start_time: 2001-06-26T22:27:31 15 | # Detector.I0: 10cm N2 16 | # Detector.I1: 10cm N2 17 | # Sample.name: Cu 18 | # Sample.prep: Cu metal foil 19 | # GSE.EXTRA: config 1 20 | # /// 21 | # Cu foil Room Temperature 22 | # measured at beamline 13-ID 23 | #---- 24 | # energy i0 itrans mutrans 25 | 8779.0 149013.7 550643.089065 -1.3070486 26 | 8789.0 144864.7 531876.119084 -1.3006104 27 | 8799.0 132978.7 489591.10592 -1.3033816 28 | 8809.0 125444.7 463051.104096 -1.3059724 29 | 8819.0 121324.7 449969.103983 -1.3107085 30 | 8829.0 119447.7 444386.117562 -1.3138152 31 | 8839.0 119100.7 440176.091039 -1.3072055 32 | 8849.0 117707.7 440448.106567 -1.3195882 33 | 8859.0 117754.7 442302.10637 -1.3233895 34 | 8869.0 117428.7 441944.116528 -1.3253521 35 | 8879.0 117383.7 442810.120466 -1.327693 36 | 8889.0 117185.7 443658.11566 -1.3312944 37 | -------------------------------------------------------------------------------- /baddata/bad_08.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Element.edge: K 6 | # Element.symbol: Cu 7 | # Scan.edge_energy: 8980.0 8 | # Mono.name: Si 111 9 | # Mono.d_spacing: 3.13553 10 | # Beamline.name: 13ID 11 | # Beamline.collimation: none 12 | # Beamline.focusing: yes 13 | # Beamline.harmonic_rejection: rhodium-coated mirror 14 | # Facility.name: APS 15 | # Facility.energy: 7.00 GeV 16 | # Facility.xray_source: APS Undulator A 17 | # Scan.start_time: 2001-06-26T22:27:31 18 | # Detector.I0: 10cm N2 19 | # Detector.I1: 10cm N2 20 | # Sample.name: Cu 21 | # Sample.prep: Cu metal foil 22 | # GSE.EXTRA: config 1 23 | # /// 24 | # Cu foil Room Temperature 25 | # measured at beamline 13-ID 26 | #---- 27 | # energy i0 itrans mutrans 28 | 8779.0 149013.7 550643.089065 -1.3070486 29 | 8789.0 144864.7 531876.119084 -1.3006104 30 | 8799.0 132978.7 489591.10592 -1.3033816 31 | 8809.0 125444.7 463051.104096 -1.3059724 32 | 8819.0 121324.7 449969.103983 -1.3107085 33 | 8829.0 119447.7 444386.117562 -1.3138152 34 | 8839.0 119100.7 440176.091039 -1.3072055 35 | 8849.0 117707.7 440448.106567 -1.3195882 36 | 8859.0 117754.7 442302.10637 -1.3233895 37 | 8869.0 117428.7 441944.116528 -1.3253521 38 | 8879.0 117383.7 442810.120466 -1.327693 39 | 8889.0 117185.7 443658.11566 -1.3312944 40 | -------------------------------------------------------------------------------- /baddata/bad_09.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Column.5: misc_fluor 7 | # Element.edge: K 8 | # Element.symbol: Cu 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_10.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.7: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_11.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | ! Beamline.collimation: none 13 | ! Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_12.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: angle degrees 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.invalid_d_spacing_name: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # angle i0 itrans mutrans 29 | 12.300 149013.7 550643.089065 -1.3070486 30 | 12.200 144864.7 531876.119084 -1.3006104 31 | 12.100 132978.7 489591.10592 -1.3033816 32 | 12.000 125444.7 463051.104096 -1.3059724 33 | 11.900 121324.7 449969.103983 -1.3107085 34 | 11.800 119447.7 444386.117562 -1.3138152 35 | 11.700 119100.7 440176.091039 -1.3072055 36 | 11.600 117707.7 440448.106567 -1.3195882 37 | -------------------------------------------------------------------------------- /baddata/bad_13.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3033816 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_14.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 2.3 3.3 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_15.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 nan 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_16.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 STRING 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_17.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 1.4.9 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_18.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family.key: 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_19.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family.key Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_20.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family:key: Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_21.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family key: Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_22.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family.key.subkey: Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_23.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Family.00key: Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_24.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # 2000Family.key: Value 9 | # Scan.edge_energy: 8980.0 10 | # Mono.name: Si 111 11 | # Mono.d_spacing: 3.13553 12 | # Beamline.name: 13ID 13 | # Beamline.collimation: none 14 | # Beamline.focusing: yes 15 | # Beamline.harmonic_rejection: rhodium-coated mirror 16 | # Facility.name: APS 17 | # Facility.energy: 7.00 GeV 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_25.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # GSE.EXTRA2: config 2 25 | # GSE.EXTRA3: config 3 26 | # /// 27 | # Cu foil Room Temperature 28 | # measured at beamline 13-ID 29 | #---- 30 | # energy i0 itrans mutrans 31 | 8779.0 149013.7 550643.089065 -1.3070486 32 | 8789.0 144864.7 531876.119084 -1.3006104 33 | 8799.0 132978.7 489591.10592 -1.3033816 34 | 8809.0 125444.7 463051.104096 -1.3059724 35 | 8819.0 121324.7 449969.103983 -1.3107085 36 | 8829.0 119447.7 444386.117562 -1.3138152 37 | 8839.0 119100.7 440176.091039 -1.3072055 38 | 8849.0 117707.7 440448.106567 -1.3195882 39 | 8859.0 117754.7 442302.10637 -1.3233895 40 | 8869.0 117428.7 441944.116528 -1.3253521 41 | 8879.0 117383.7 442810.120466 -1.327693 42 | 8889.0 117185.7 443658.11566 -1.3312944 43 | -------------------------------------------------------------------------------- /baddata/bad_26.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | #----------- 25 | # energy i0 itrans mutrans 26 | 8779.0 149013.7 550643.089065 -1.3070486 27 | 8789.0 144864.7 531876.119084 -1.3006104 28 | 8799.0 132978.7 489591.10592 -1.3033816 29 | 8809.0 125444.7 463051.104096 -1.3059724 30 | 8819.0 121324.7 449969.103983 -1.3107085 31 | 8829.0 119447.7 444386.117562 -1.3138152 32 | 8839.0 119100.7 440176.091039 -1.3072055 33 | 8849.0 117707.7 440448.106567 -1.3195882 34 | 8859.0 117754.7 442302.10637 -1.3233895 35 | 8869.0 117428.7 441944.116528 -1.3253521 36 | 8879.0 117383.7 442810.120466 -1.327693 37 | 8889.0 117185.7 443658.11566 -1.3312944 38 | -------------------------------------------------------------------------------- /baddata/bad_27.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-02 22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | #////// 25 | #------- 26 | # energy i0 itrans mutrans 27 | 8779.0 149013.7 550643.089065 -1.3070486 28 | 8789.0 144864.7 531876.119084 -1.3006104 29 | 8799.0 132978.7 489591.10592 -1.3033816 30 | 8809.0 125444.7 463051.104096 -1.3059724 31 | 8819.0 121324.7 449969.103983 -1.3107085 32 | 8829.0 119447.7 444386.117562 -1.3138152 33 | 8839.0 119100.7 440176.091039 -1.3072055 34 | 8849.0 117707.7 440448.106567 -1.3195882 35 | 8859.0 117754.7 442302.10637 -1.3233895 36 | 8869.0 117428.7 441944.116528 -1.3253521 37 | 8879.0 117383.7 442810.120466 -1.327693 38 | 8889.0 117185.7 443658.11566 -1.3312944 39 | -------------------------------------------------------------------------------- /baddata/bad_28.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-Jun-26 22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_29.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-26-6T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_30.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: Bar 7 | # Element.symbol: Foo 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_31.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: three point one three five five three 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_32.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: Energie eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.collimation: none 12 | # Beamline.focusing: yes 13 | # Beamline.harmonic_rejection: rhodium-coated mirror 14 | # Facility.energy: 7.00 GeV 15 | # Facility.xray_source: APS Undulator A 16 | # Scan.start_time: 2001-06-26T22:27:31 17 | # Detector.I0: 10cm N2 18 | # Detector.I1: 10cm N2 19 | # Sample.name: Cu 20 | # Sample.prep: Cu metal foil 21 | # GSE.EXTRA: config 1 22 | # /// 23 | # Cu foil Room Temperature 24 | # measured at beamline 13-ID 25 | #---- 26 | # energy i0 itrans mutrans 27 | 8779.0 149013.7 550643.089065 -1.3070486 28 | 8789.0 144864.7 531876.119084 -1.3006104 29 | 8799.0 132978.7 489591.10592 -1.3033816 30 | 8809.0 125444.7 463051.104096 -1.3059724 31 | 8819.0 121324.7 449969.103983 -1.3107085 32 | 8829.0 119447.7 444386.117562 -1.3138152 33 | 8839.0 119100.7 440176.091039 -1.3072055 34 | 8849.0 117707.7 440448.106567 -1.3195882 35 | 8859.0 117754.7 442302.10637 -1.3233895 36 | 8869.0 117428.7 441944.116528 -1.3253521 37 | 8879.0 117383.7 442810.120466 -1.327693 38 | 8889.0 117185.7 443658.11566 -1.3312944 39 | -------------------------------------------------------------------------------- /baddata/bad_33.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # Sample.temperature: 300.0a K 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /baddata/bad_34.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 missing units 17 | # Facility.xray_source: APS Undulator A 18 | # Scan.start_time: 2001-06-26T22:27:31 19 | # Detector.I0: 10cm N2 20 | # Detector.I1: 10cm N2 21 | # Sample.name: Cu 22 | # Sample.prep: Cu metal foil 23 | # GSE.EXTRA: config 1 24 | # /// 25 | # Cu foil Room Temperature 26 | # measured at beamline 13-ID 27 | #---- 28 | # energy i0 itrans mutrans 29 | 8779.0 149013.7 550643.089065 -1.3070486 30 | 8789.0 144864.7 531876.119084 -1.3006104 31 | 8799.0 132978.7 489591.10592 -1.3033816 32 | 8809.0 125444.7 463051.104096 -1.3059724 33 | 8819.0 121324.7 449969.103983 -1.3107085 34 | 8829.0 119447.7 444386.117562 -1.3138152 35 | 8839.0 119100.7 440176.091039 -1.3072055 36 | 8849.0 117707.7 440448.106567 -1.3195882 37 | 8859.0 117754.7 442302.10637 -1.3233895 38 | 8869.0 117428.7 441944.116528 -1.3253521 39 | 8879.0 117383.7 442810.120466 -1.327693 40 | 8889.0 117185.7 443658.11566 -1.3312944 41 | -------------------------------------------------------------------------------- /baddata/bad_35.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.0 GSE/1.0 2 | # Column.1: energy eV 3 | # Column.2: i0 4 | # Column.3: itrans 5 | # Column.4: mutrans 6 | # Element.edge: K 7 | # Element.symbol: Cu 8 | # Scan.edge_energy: 8980.0 9 | # Mono.name: Si 111 10 | # Mono.d_spacing: 3.13553 11 | # Beamline.name: 13ID 12 | # Beamline.collimation: none 13 | # Beamline.focusing: yes 14 | # Beamline.harmonic_rejection: rhodium-coated mirror 15 | # Facility.name: APS 16 | # Facility.energy: 7.00 GeV 17 | # Facility.current: 101x ma 18 | # Facility.xray_source: APS Undulator A 19 | # Scan.start_time: 2001-06-26T22:27:31 20 | # Detector.I0: 10cm N2 21 | # Detector.I1: 10cm N2 22 | # Sample.name: Cu 23 | # Sample.prep: Cu metal foil 24 | # GSE.EXTRA: config 1 25 | # /// 26 | # Cu foil Room Temperature 27 | # measured at beamline 13-ID 28 | #---- 29 | # energy i0 itrans mutrans 30 | 8779.0 149013.7 550643.089065 -1.3070486 31 | 8789.0 144864.7 531876.119084 -1.3006104 32 | 8799.0 132978.7 489591.10592 -1.3033816 33 | 8809.0 125444.7 463051.104096 -1.3059724 34 | 8819.0 121324.7 449969.103983 -1.3107085 35 | 8829.0 119447.7 444386.117562 -1.3138152 36 | 8839.0 119100.7 440176.091039 -1.3072055 37 | 8849.0 117707.7 440448.106567 -1.3195882 38 | 8859.0 117754.7 442302.10637 -1.3233895 39 | 8869.0 117428.7 441944.116528 -1.3253521 40 | 8879.0 117383.7 442810.120466 -1.327693 41 | 8889.0 117185.7 443658.11566 -1.3312944 42 | -------------------------------------------------------------------------------- /binaries/linux-x86/libxdifile.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/linux-x86/libxdifile.so -------------------------------------------------------------------------------- /binaries/linux-x86/xdi_reader: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/linux-x86/xdi_reader -------------------------------------------------------------------------------- /binaries/macosx/libxdifile.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/macosx/libxdifile.dylib -------------------------------------------------------------------------------- /binaries/macosx/xdi_reader: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/macosx/xdi_reader -------------------------------------------------------------------------------- /binaries/win32/xdi_reader.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/win32/xdi_reader.exe -------------------------------------------------------------------------------- /binaries/win32/xdifile.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/binaries/win32/xdifile.dll -------------------------------------------------------------------------------- /data/nonxafs_negvalues.xdi: -------------------------------------------------------------------------------- 1 | # XDI/1.1 2 | # Scan.start_time: 2015-04-13 10:36:55 3 | # Column.1: X 4 | # Column.2: Y 5 | # Column.3: Z 6 | # Mono.d_spacing: 3.13477 7 | # Facility.Ring_Lifetime: 9.2 || S:SRlifeTimeHrsCC.VAL 8 | # Facility.Ring_Current: 102.1 || S:SRcurrentAI.VAL 9 | # Facility.xray_source: undultaor, 3.6 cm period, 2.1 m length 10 | # Facility.name: Advanced Photon Source 11 | # Beamline.name: GSECARS, 13-ID-E 12 | #-------------- 13 | # X Y Z 14 | -0.500 0.150 1.000 15 | -0.400 0.250 1.000 16 | -0.300 0.350 2.000 17 | -0.200 0.470 3.500 18 | -0.100 0.520 3.800 19 | 0.000 0.550 4.100 20 | 0.200 0.590 4.400 21 | 0.300 0.660 4.300 22 | 0.400 0.710 3.900 23 | 0.500 0.720 3.600 24 | -------------------------------------------------------------------------------- /doc/Poster_XAFS15/XDI_Poster.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/doc/Poster_XAFS15/XDI_Poster.pdf -------------------------------------------------------------------------------- /doc/Poster_XAFS15/beamerthemeXDI.sty: -------------------------------------------------------------------------------- 1 | % this style was modified from I6pd2, created by Thomas Deselaers an Philippe Dreuw 2 | \ProvidesPackage{beamerthemeXDI} 3 | 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | %% colors from tangocolors 6 | % butter (yellowish) 7 | \definecolor{tabutter}{rgb}{0.98824, 0.91373, 0.30980} % #fce94f 8 | \definecolor{ta2butter}{rgb}{0.92941, 0.83137, 0} % #edd400 9 | 10 | % orange 11 | \definecolor{taorange}{rgb}{0.98824, 0.68627, 0.24314} % #fcaf3e 12 | \definecolor{ta2orange}{rgb}{0.96078, 0.47451, 0} % #f57900 13 | \definecolor{ta3orange}{rgb}{0.80784, 0.36078, 0} % #ce5c00 14 | 15 | % aluminium 16 | \definecolor{taaluminium}{rgb}{0.93333, 0.93333, 0.92549} % #eeeeec 17 | \definecolor{ta2aluminium}{rgb}{0.82745, 0.84314, 0.81176} % #d3d7cf 18 | 19 | % gray 20 | \definecolor{tagray}{rgb}{0.53333, 0.54118, 0.52157} % #888a85 21 | \definecolor{ta2gray}{rgb}{0.33333, 0.34118, 0.32549} % #555753 22 | 23 | \selectcolormodel{cmyk} 24 | \mode 25 | 26 | \usecolortheme{orchid} 27 | \useinnertheme[shadow]{rounded} 28 | \usecolortheme{whale} 29 | 30 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 31 | \definecolor{blockbg}{rgb}{0.97, 0.97, 0.94} 32 | \definecolor{posterbg}{rgb}{0.94, 0.93, 0.90} 33 | \definecolor{posterbg}{rgb}{0.92, 0.91, 0.85} 34 | 35 | \setbeamercolor{headline}{fg=black, bg=tabutter} 36 | \setbeamerfont{footline}{size=\large,series=\tt} 37 | \setbeamercolor{separation line}{bg=ta2aluminium} 38 | \setbeamercolor{author in headline}{fg=blue} 39 | \setbeamercolor{institute in headline}{fg=blue} 40 | 41 | \setbeamercolor{author in head/foot}{fg=blue, bg=tabutter} 42 | 43 | %% sets background color for non-blocks 44 | \setbeamercolor*{normal text}{fg=blue, bg=posterbg} 45 | 46 | %% sets background color for blocks 47 | \setbeamercolor*{block body}{fg=black, bg=blockbg} 48 | \setbeamercolor*{block title}{fg=ta2butter, bg=ta2gray} 49 | \setbeamerfont{block title}{size=\large,series=\bf} 50 | 51 | \setbeamercolor{upper separation line head}{bg=taorange} 52 | \setbeamercolor{lower separation line head}{bg=taorange} 53 | \setbeamercolor{upper separation line foot}{bg=taorange} 54 | \setbeamercolor{lower separation line foot}{bg=taorange} 55 | 56 | 57 | % \setbeamercolor*{example body}{fg=ta3aluminium,bg=black} 58 | % \setbeamercolor*{example text}{fg=ta3aluminium,bg=black} 59 | % \setbeamercolor*{example title}{bg=taorange,fg=ta2gray} 60 | 61 | %% \setbeamercolor{alerted text}{fg=pink} 62 | 63 | % %\setbeamercolor{example text}{fg=taorange} 64 | 65 | \setbeamercolor{structure}{fg=blue} 66 | 67 | % \setbeamertemplate{itemize items}[triangle] 68 | \setbeamertemplate{navigation symbols}{} % no navigation on a poster 69 | 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 71 | \setbeamertemplate{block begin}{ 72 | \vskip.75ex 73 | \begin{beamercolorbox}[ht=3.5ex,dp=0.25ex,center,leftskip=-0.1em,colsep*=.75ex]{block title}% 74 | \usebeamerfont*{block title}% 75 | {\phantom{Gg}\insertblocktitle}% phantom because of baseline problem 76 | \end{beamercolorbox}% 77 | {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}% 78 | \usebeamerfont{block body}% 79 | \begin{beamercolorbox}[leftskip=1em,colsep*=.75ex,sep=0.5ex,vmode]{block body}% 80 | \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}% 81 | } 82 | \setbeamertemplate{block end}{ 83 | \end{beamercolorbox} 84 | } 85 | 86 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 87 | \setbeamertemplate{headline}{ 88 | \leavevmode 89 | 90 | \begin{beamercolorbox}[wd=\paperwidth]{headline} 91 | \begin{columns}[T] 92 | \begin{column}{.05\paperwidth} 93 | \end{column} 94 | \begin{column}{.9\paperwidth} 95 | \vskip4ex 96 | \raggedleft 97 | \usebeamercolor{title in headline}{\color{fg}\textbf{\LARGE{\inserttitle}}\\[1ex]} 98 | \usebeamercolor{author in headline}{\color{fg}\large{\insertauthor}\\[1ex]} 99 | \usebeamercolor{institute in headline}{\color{fg}\normalsize{\insertinstitute}\\[1ex]} 100 | \end{column} 101 | \begin{column}{.05\paperwidth} 102 | \end{column} 103 | \end{columns} 104 | \vskip2ex 105 | \end{beamercolorbox} 106 | 107 | \begin{beamercolorbox}[wd=\paperwidth]{lower separation line head} 108 | \rule{0pt}{4pt} 109 | \end{beamercolorbox} 110 | } 111 | 112 | 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | \setbeamertemplate{footline}{ 115 | \begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot} 116 | \rule{0pt}{4pt} 117 | \end{beamercolorbox} 118 | 119 | \leavevmode% 120 | \begin{beamercolorbox}[ht=3.5ex,leftskip=1em,rightskip=1em]{author in head/foot}% 121 | \vskip1ex 122 | \texttt{http://github.com/XraySpectroscopy} 123 | \hfill 124 | \texttt{xasformat@millenia.cars.aps.anl.gov} 125 | \vskip1ex 126 | \end{beamercolorbox} 127 | \vskip0pt% 128 | \begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot} 129 | \rule{0pt}{4pt} 130 | \end{beamercolorbox} 131 | } 132 | 133 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 134 | % Display a grid to help align images ... and it looks nice with this color scheme 135 | %\beamertemplategridbackground[1cm] 136 | 137 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 138 | \mode 139 | 140 | % adapt height of itemize rectangles 141 | \setbeamertemplate{itemize items}[triangle] 142 | \setbeamertemplate{itemize item}{\raisebox{0.12ex}{\hskip5.0em$\blacktriangleright$}\hskip0.2em} 143 | \setbeamertemplate{itemize subitem}{\raisebox{0.12ex}{$\triangleright$}\hskip0.2em} 144 | % or define your own template using \defbeamertemplate{itemize item}, see beameruserguide.pdf 145 | 146 | % equal font sizes for all levels 147 | \setbeamerfont{itemize/enumerate body}{size=\scriptsize} 148 | \setbeamerfont{itemize/enumerate subbody}{size=\tiny} 149 | \setbeamerfont{itemize/enumerate subsubbody}{size=\tiny} 150 | 151 | -------------------------------------------------------------------------------- /doc/Poster_XAFS15/images/hdf5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/doc/Poster_XAFS15/images/hdf5.png -------------------------------------------------------------------------------- /doc/Poster_XAFS15/images/sqlite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/doc/Poster_XAFS15/images/sqlite.png -------------------------------------------------------------------------------- /filemagic/README.md: -------------------------------------------------------------------------------- 1 | Tools for using XDI files 2 | ========================= 3 | 4 | # Unix computers 5 | 6 | * `magic`: file type difinition for XDI for the [Unix file type recognition system](http://en.wikipedia.org/wiki/File_%28command%29) 7 | * `install_magic`: Bash shell script for installing the contents of the `magic` file 8 | 9 | 10 | Install XDI file magic as root: 11 | 12 | ~> sudo ./install_magic 13 | 14 | This assumes that the file `/etc/magic` is used for local magic data. 15 | If the local file magic file is in some other location on your 16 | computer, then 17 | 18 | ~> sudo ./install_magic /path/to/magic 19 | 20 | where `/path/to/magic` is that location on your computer. 21 | 22 | Once installed, XDI files can be identified with the [file command](http://en.wikipedia.org/wiki/File_%28command%29): 23 | 24 | ~> file -m magic data/co_metal_rt.xdi 25 | data/co_metal_rt.xdi: XAS Data Interchange file -- XDI specification 1.0 26 | 27 | # Windows computers 28 | 29 | Modify the Windows registry to assign an icon to `.xdi` files. 30 | 31 | **PLEASE NOTE:** 32 | 33 | This works, but is currently an imperfect solution. The 34 | location of the icon is hard wired in the registry file. 35 | Thus, the registry file must currently be edited by hand to 36 | point to the correct location of the icon file. 37 | 38 | A script that installed the icon file to a suitable 39 | location, modifies the registry file, then runs the regsitry 40 | edit would be a welcome contribution! 41 | 42 | 43 | * `xdi.ico`: Windows icon for XDI files 44 | * `xdi.reg`: Windows registry entry for XDI files 45 | 46 | Double click on the `xdi.reg` file to modify a computer's registry. 47 | Once this is done, XDI files will be displayed using the XDI icon. 48 | 49 | See http://stackoverflow.com/questions/8407066/how-do-i-associate-a-filetype-with-an-icon 50 | and the MSDN link on that page. 51 | -------------------------------------------------------------------------------- /filemagic/install_magic: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################## 3 | ## install magic for recognizing XDI files into 4 | ## system magic file 5 | ################################################## 6 | ## this must be run as root/sudo 7 | ################################################## 8 | 9 | 10 | showhelp () { 11 | echo " 12 | install_magic: append file magic for XDI file to system magic file 13 | 14 | install_magic [filename] [-h] 15 | filename specify location of system magic file (default=/etc/magic) 16 | -h show this help 17 | " 18 | } 19 | 20 | ## ======== identify system file ========================= 21 | system_file=/etc/magic 22 | if [ $1 ]; then 23 | system_file=$1 24 | fi 25 | if [ "$system_file" = '-h' ]; then 26 | showhelp 27 | exit 0 28 | fi 29 | tempfile=./system.magic 30 | 31 | ## ======== sanity checking ============================== 32 | if [ `whoami` != 'root' ]; then 33 | echo "install_magic: this script must be run as root" 34 | exit 0 35 | fi 36 | 37 | if [ ! -e $system_file ]; then 38 | echo "install_magic: magic file not found at '$system_file'" 39 | exit 0 40 | fi 41 | 42 | ## ======== append XDi magic to system file ============== 43 | cp $system_file $tempfile # make a copy of the system magic file 44 | sed -i "/# ----- XDI/,/# ----- XDI/ d" $tempfile # remove any previous definition of an XDI file 45 | cat $tempfile magic > $system_file # concatinate system file with XDI definition 46 | rm $tempfile # remove copy of old system file 47 | -------------------------------------------------------------------------------- /filemagic/magic: -------------------------------------------------------------------------------- 1 | # ----- XDI files: file(1) magic for XAS Data Interchange (XDI) files 2 | # 3 | 0 string #\ XDI/ XAS Data Interchange file 4 | >&0 regex [0-9.]+ -- XDI specification %s 5 | # ----- XDI files 6 | -------------------------------------------------------------------------------- /filemagic/xdi.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/filemagic/xdi.ico -------------------------------------------------------------------------------- /filemagic/xdi.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_CLASSES_ROOT\.xdi] 4 | 5 | [HKEY_CLASSES_ROOT\.xdi\DefaultIcon] 6 | @="C:\\Users\\bravel\\Documents\\GitHub\\XAS-Data-Interchange\\filemagic\\xdi.ico,0" 7 | -------------------------------------------------------------------------------- /languages/fortran/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for XDI Fortran code 3 | # 4 | # you may want to customize these two items: 5 | # 6 | AR = ar 7 | 8 | CC = @CC@ 9 | CPP = @CPP@ 10 | F77 = @F77@ 11 | FFLAGS = @FFLAGS@ -Wall 12 | FLIBS = @FLIBS@ 13 | MAKEINFO = @MAKEINFO@ 14 | PACKAGE = @PACKAGE@ 15 | RANLIB = @RANLIB@ 16 | SHELL = @SHELL@ 17 | 18 | srcdir = @srcdir@ 19 | prefix = @prefix@ 20 | exec_prefix = @exec_prefix@ 21 | LDFLAGS = @LDFLAGS@ 22 | bindir = @bindir@ 23 | libdir = @libdir@ 24 | 25 | F77LINK = $(F77) $(FFLAGS) $(LDFLAGS) -o $@ 26 | 27 | .f.o: 28 | $(F77) $(FFLAGS) -c $*.f 29 | 30 | # you shouldn't have to alter anything below this line 31 | #--------------------------------- 32 | EXAMPLE1 = xdi_example1 33 | LIBXDIF = libxdif.a 34 | LINKXDIF = -L$(libdir) -L. -lxdif 35 | all: $(EXAMPLE1) 36 | 37 | $(EXAMPLE1).o: $(EXAMPLE1).f 38 | 39 | .PHONY: clean install default 40 | 41 | default: $(EXAMPLE1) 42 | 43 | XDI_OBJ = xdifile.o str_util.o 44 | 45 | $(LIBXDIF): $(XDI_OBJ) 46 | @rm -f $@ 47 | $(AR) cru $(LIBXDIF) $(XDI_OBJ) 48 | $(RANLIB) $(LIBXDIF) 49 | 50 | $(EXAMPLE1): $(LIBXDIF) $(EXAMPLE1).o 51 | $(F77LINK) -o $(EXAMPLE1) $(EXAMPLE1).o $(LINKXDIF) $(FLIBS) 52 | 53 | clean : 54 | rm -f $(XDI_OBJ) $(EXAMPLE1).o $(EXAMPLE1) $(LIBXDIF) 55 | 56 | install: $(LIBXDIF) 57 | cp -pr $(LIBXDIF) $(libdir)/$(LIBXDIF) 58 | -------------------------------------------------------------------------------- /languages/fortran/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Name of package */ 4 | #undef PACKAGE 5 | 6 | /* Define to the address where bug reports for this package should be sent. */ 7 | #undef PACKAGE_BUGREPORT 8 | 9 | /* Define to the full name of this package. */ 10 | #undef PACKAGE_NAME 11 | 12 | /* Define to the full name and version of this package. */ 13 | #undef PACKAGE_STRING 14 | 15 | /* Define to the one symbol short name of this package. */ 16 | #undef PACKAGE_TARNAME 17 | 18 | /* Define to the version of this package. */ 19 | #undef PACKAGE_VERSION 20 | 21 | /* Version number of package */ 22 | #undef VERSION 23 | -------------------------------------------------------------------------------- /languages/fortran/configure.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2000 Matt Newville 2 | # 3 | # This file is free software; the author gives unlimited permission 4 | # to copy and/or distribute it, with or without modifications, as 5 | # long as this notice is preserved. 6 | # 7 | AC_INIT(XDI Library, 0.1.0, newville@cars.uchicago.edu) 8 | AM_INIT_AUTOMAKE(xdilib,0.1.0) 9 | AC_PROG_CC(gcc cc ) 10 | AC_PROG_CPP(gcc cc) 11 | AM_CONFIG_HEADER(config.h) 12 | AC_ISC_POSIX 13 | AC_PROG_RANLIB 14 | 15 | ################################ 16 | FCLIST='gfortran g95 g77 f90 f77' 17 | AC_ARG_WITH(fortran, 18 | [ --with-fortran=compiler specify fortran compiler g77 g95 gfortran], 19 | [if test "$withval"; then FCLIST=$withval; fi]) 20 | 21 | AC_PROG_F77($FCLIST) 22 | AC_F77_LIBRARY_LDFLAGS 23 | AC_OUTPUT([Makefile]) 24 | -------------------------------------------------------------------------------- /languages/fortran/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | true 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | chmodcmd="" 122 | else 123 | instcmd=mkdir 124 | fi 125 | else 126 | 127 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 128 | # might cause directories to be created, which would be especially bad 129 | # if $src (and thus $dsttmp) contains '*'. 130 | 131 | if [ -f $src -o -d $src ] 132 | then 133 | true 134 | else 135 | echo "install: $src does not exist" 136 | exit 1 137 | fi 138 | 139 | if [ x"$dst" = x ] 140 | then 141 | echo "install: no destination specified" 142 | exit 1 143 | else 144 | true 145 | fi 146 | 147 | # If destination is a directory, append the input filename; if your system 148 | # does not like double slashes in filenames, you may need to add some logic 149 | 150 | if [ -d $dst ] 151 | then 152 | dst="$dst"/`basename $src` 153 | else 154 | true 155 | fi 156 | fi 157 | 158 | ## this sed command emulates the dirname command 159 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 160 | 161 | # Make sure that the destination directory exists. 162 | # this part is taken from Noah Friedman's mkinstalldirs script 163 | 164 | # Skip lots of stat calls in the usual case. 165 | if [ ! -d "$dstdir" ]; then 166 | defaultIFS=' 167 | ' 168 | IFS="${IFS-${defaultIFS}}" 169 | 170 | oIFS="${IFS}" 171 | # Some sh's can't handle IFS=/ for some reason. 172 | IFS='%' 173 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 174 | IFS="${oIFS}" 175 | 176 | pathcomp='' 177 | 178 | while [ $# -ne 0 ] ; do 179 | pathcomp="${pathcomp}${1}" 180 | shift 181 | 182 | if [ ! -d "${pathcomp}" ] ; 183 | then 184 | $mkdirprog "${pathcomp}" 185 | else 186 | true 187 | fi 188 | 189 | pathcomp="${pathcomp}/" 190 | done 191 | fi 192 | 193 | if [ x"$dir_arg" != x ] 194 | then 195 | $doit $instcmd $dst && 196 | 197 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 198 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 199 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 200 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 201 | else 202 | 203 | # If we're going to rename the final executable, determine the name now. 204 | 205 | if [ x"$transformarg" = x ] 206 | then 207 | dstfile=`basename $dst` 208 | else 209 | dstfile=`basename $dst $transformbasename | 210 | sed $transformarg`$transformbasename 211 | fi 212 | 213 | # don't allow the sed command to completely eliminate the filename 214 | 215 | if [ x"$dstfile" = x ] 216 | then 217 | dstfile=`basename $dst` 218 | else 219 | true 220 | fi 221 | 222 | # Make a temp file name in the proper directory. 223 | 224 | dsttmp=$dstdir/#inst.$$# 225 | 226 | # Move or copy the file name to the temp name 227 | 228 | $doit $instcmd $src $dsttmp && 229 | 230 | trap "rm -f ${dsttmp}" 0 && 231 | 232 | # and set any options; do chmod last to preserve setuid bits 233 | 234 | # If any of these fail, we abort the whole thing. If we want to 235 | # ignore errors from any of these, just make sure not to ignore 236 | # errors from the above "$doit $instcmd $src $dsttmp" command. 237 | 238 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 239 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 240 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 241 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 242 | 243 | # Now rename the file to the real destination. 244 | 245 | $doit $rmcmd -f $dstdir/$dstfile && 246 | $doit $mvcmd $dsttmp $dstdir/$dstfile 247 | 248 | fi && 249 | 250 | 251 | exit 0 252 | -------------------------------------------------------------------------------- /languages/fortran/reconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2001,2003 Matt Newville 4 | # 5 | # Purpose: rerun autoconf and automake after playing with 6 | # configure.in and other primitive build instruction 7 | # files. 8 | # This requires a full set of autotools to be installed, and only 9 | # needs to be run for development, not for building and installation. 10 | # 11 | # This file is free software; as a special exception the author gives 12 | # unlimited permission to copy and/or distribute it, with or without 13 | # modifications, as long as this notice is preserved. 14 | # 15 | # This program is distributed in the hope that it will be useful, but 16 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 17 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | # 19 | # 20 | rm -f config.cache acconfig.h config.h 21 | 22 | aclocal # don't run this, as it blows away the TERMCAP_LIB check 23 | autoconf 24 | autoheader 25 | # acconfig 26 | # automake -a 27 | echo " ready for configure" 28 | exit 29 | -------------------------------------------------------------------------------- /languages/fortran/xdi_example1.f: -------------------------------------------------------------------------------- 1 | program xdi_test1 2 | 3 | implicit none 4 | save 5 | 6 | character*32 fname 7 | 8 | integer max_attr, max_pts, max_comments, i, istrln 9 | integer maxcol, npts 10 | parameter(maxcol = 16) 11 | parameter(max_attr = 256, max_pts = 16384, max_comments=64) 12 | 13 | character*256 comments(max_comments), labels(maxcol), version 14 | character*256 attr_names(max_attr), attr_values(max_attr) 15 | 16 | double precision energy(max_pts), dat_i0(max_pts) 17 | double precision dat_it(max_pts), dat_if(max_pts) 18 | double precision dat_ir(max_pts) 19 | 20 | fname = '../data/test_01.xdi' 21 | 22 | call read_xdi(fname, max_attr, max_pts, max_comments, 23 | $ attr_names, attr_values, version, labels, comments, 24 | $ npts, energy, dat_i0, dat_it, dat_if, dat_ir) 25 | 26 | print*, ' ------------' 27 | print*, '== Version: ', version 28 | print*, '== Labels' 29 | do i = 1, maxcol 30 | if (istrln(labels(i)) .ge. 1) then 31 | print*, ' ', i, ' = ', labels(i)(1:istrln(labels(i))) 32 | endif 33 | enddo 34 | print*, '== Comments' 35 | do i = 1, max_comments 36 | if (istrln(comments(i)) .ge. 1) then 37 | print*, ' ', i, ' = ', 38 | $ comments(i)(1:istrln(comments(i))) 39 | endif 40 | enddo 41 | print*, '== Attributes' 42 | do i = 1, max_attr 43 | if (istrln(attr_names(i)) .ge. 1) then 44 | print*, attr_names(i)(1:istrln(attr_names(i))), ' = ', 45 | $ attr_values(i)(1:istrln(attr_values(i))) 46 | endif 47 | enddo 48 | print*, '== Data ', npts 49 | do i = 1, npts 50 | print*, energy(i), dat_i0(i), dat_it(i), dat_if(i), dat_ir(i) 51 | enddo 52 | return 53 | end 54 | -------------------------------------------------------------------------------- /languages/fortran/xdifile.f: -------------------------------------------------------------------------------- 1 | subroutine read_xdi(fname, max_attr, max_pts, max_comments, 2 | $ attr_names, attr_values, version, labels, comments, 3 | $ npts, energy, dat_i0, dat_it, dat_if, dat_ir) 4 | 5 | c 6 | c Read/Write XAS Data Interchange Format for Fortran 7 | c 8 | c To the extent possible, the authors have waived all rights 9 | c granted by copyright law and related laws for the code and 10 | c documentation that make up the Fortran Interface to the 11 | c XAS Data Interchange Format. While information about 12 | c Authorship may be retained in some files for historical 13 | c reasons, this work is hereby placed in the Public Domain. 14 | c This work is published from: United States. 15 | c 16 | c Matt Newville 17 | c Last Update: 2011-March-08 18 | c 19 | implicit none 20 | save 21 | integer max_attr, max_pts, max_comments, mwords, maxcol 22 | parameter(mwords = 128, maxcol = 16) 23 | 24 | character*128 words(mwords) 25 | character*(*) comments(max_comments), labels(maxcol) 26 | character*(*) attr_names(max_attr), attr_values(max_attr) 27 | character*(*) fname, version 28 | integer npts, istrln, ilen, iread 29 | integer i, icomm, iattr 30 | double precision energy(max_pts), dat_i0(max_pts) 31 | double precision dat_it(max_pts), dat_if(max_pts) 32 | double precision dat_ir(max_pts), dpval 33 | 34 | logical isComment 35 | integer lun, nwords, iex, ier, jline, ipt 36 | integer icole, icol0, icolt, icolf, icolr 37 | character*(*) stat*10, cchars*2 38 | character*128 tmpline, state*16, tmpstr*256 39 | character*2048 line, labstr, msg 40 | external istrln, iread 41 | 42 | 43 | npts = max_pts 44 | cchars = ';#' 45 | c column indices for i0, energy, trans, fluor, refer 46 | icol0 = -1 47 | icole = -1 48 | icolt = -1 49 | icolf = -1 50 | icolr = -1 51 | ipt = 0 52 | c now that the needed program variables are known, the strategy is: 53 | c 1. open file, with error checking 54 | c 2. determine # of arrays to read 55 | c 3. assign names and positions for arrays to be read 56 | c 4. read arrays from file 57 | c 5. assign number of points for each array 58 | c 59 | c open file 60 | iex = 1 61 | ier = 0 62 | lun = -1 63 | stat = 'old' 64 | ilen = istrln(fname) 65 | call openfl(lun, fname(1:ilen), stat, iex, ier) 66 | if ((ier.lt.0).or.(iex.lt.0)) then 67 | ilen = istrln(fname) 68 | msg = '** '//fname 69 | call echo('** read_xdi: error opening file') 70 | call echo(msg) 71 | if (lun.gt.0) close(lun) 72 | return 73 | end if 74 | 75 | c while loop for reading data from open file 76 | jline = 0 77 | icomm = 0 78 | iattr = 0 79 | isComment = .false. 80 | state = 'VERSION' 81 | 100 continue 82 | ilen = iread(lun, line) 83 | if (ilen .lt. 0) goto 900 84 | jline = jline + 1 85 | call triml(line) 86 | if ((ilen.le.1).or.(line.eq.' ')) goto 100 87 | 88 | isComment = (line(1:1).ne.' ').and.(index(cchars,line(1:1)).ne.0) 89 | if (isComment) then 90 | line = line(2:) 91 | endif 92 | 93 | tmpline = line(1:128) 94 | call lower(tmpline) 95 | nwords = 3 96 | call bwords(tmpline, nwords, words) 97 | 98 | if (tmpline(1:3).eq.'---') then 99 | state = 'LABELS' 100 | else if (tmpline(1:3).eq.'///') then 101 | state = 'COMMENTS' 102 | else if (state.eq.'VERSION') then 103 | call triml(line) 104 | if (line(1:4).ne.'XDI/') then 105 | ilen = istrln(fname) 106 | msg = '** '//fname 107 | call echo('** read_xdi: invalid XDI File') 108 | call echo(msg) 109 | return 110 | endif 111 | nwords = 3 112 | call bwords(line(5:), nwords, words) 113 | version = words(1)(1:istrln(words(1))) 114 | 121 format ('Application_',i1.1) 115 | if (nwords .ge. 1) then 116 | do i = 1, nwords-1 117 | iattr = iattr+1 118 | write(tmpstr, 121) i 119 | attr_names(iattr) = tmpstr(1:istrln(tmpstr)) 120 | attr_values(iattr) = words(i+1)(1:istrln(words(i+1))) 121 | enddo 122 | endif 123 | state = 'FIELDS' 124 | else if (state.eq.'LABELS') then 125 | labstr = line(1:istrln(line)) 126 | nwords = maxcol 127 | call bwords(labstr, nwords, words) 128 | do i = 1, nwords 129 | labels(i) = words(i)(1:istrln(words(i))) 130 | end do 131 | state = 'DATA' 132 | else if (state.eq.'COMMENTS') then 133 | icomm = icomm + 1 134 | if (icomm.le.max_comments) then 135 | comments(icomm) = line(1:istrln(line)) 136 | endif 137 | else if (state.eq.'FIELDS') then 138 | nwords = 2 139 | call strsplit(line, nwords, words, ':') 140 | tmpstr = words(1)(:istrln(words(1))) 141 | iattr = iattr + 1 142 | attr_names(iattr) = tmpstr(1:istrln(tmpstr)) 143 | attr_values(iattr) = words(2)(1:istrln(words(2))) 144 | call lower(tmpstr) 145 | if (tmpstr(1:7).eq.'column_') then 146 | tmpstr = tmpstr(8:20) 147 | if (tmpstr(1:2) .eq. 'i0') then 148 | call str2in(attr_values(iattr), icol0, ier) 149 | else if (tmpstr(1:6) .eq. 'itrans') then 150 | call str2in(attr_values(iattr), icolt, ier) 151 | else if (tmpstr(1:6) .eq. 'energy') then 152 | call str2in(attr_values(iattr), icole, ier) 153 | else if (tmpstr(1:6) .eq. 'ifluor') then 154 | call str2in(attr_values(iattr), icolf, ier) 155 | else if (tmpstr(1:6) .eq. 'irefer') then 156 | call str2in(attr_values(iattr), icolr, ier) 157 | endif 158 | endif 159 | else if (state.eq.'DATA') then 160 | ipt = ipt + 1 161 | nwords = mwords 162 | call bwords(line, nwords, words) 163 | do i = 1, nwords 164 | call str2dp(words(i), dpval, ier) 165 | if (i.eq.icole) then 166 | energy(ipt) = dpval 167 | else if (i.eq.icol0) then 168 | dat_i0(ipt) = dpval 169 | else if (i.eq.icolt) then 170 | dat_it(ipt) = dpval 171 | else if (i.eq.icolf) then 172 | dat_if(ipt) = dpval 173 | else if (i.eq.icolr) then 174 | dat_ir(ipt) = dpval 175 | endif 176 | enddo 177 | npts = ipt 178 | 179 | endif 180 | 181 | if ((ilen.ge.0).or.(line.eq.' ')) goto 100 182 | 183 | c parsing complete 184 | 900 continue 185 | if (lun.gt.0) close(lun) 186 | 187 | return 188 | c end subroutine read_xdi 189 | end 190 | 191 | -------------------------------------------------------------------------------- /languages/perl/Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension Xray::XDIFile. 2 | 3 | 0.01 Tue Sep 4 11:32:19 2012 4 | - original version; created by h2xs 1.23 with options 5 | -PAXn Xray::XDIFile 6 | 7 | -------------------------------------------------------------------------------- /languages/perl/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | To the extent possible, the authors have waived all rights granted by 3 | copyright law and related laws for the code and documentation that 4 | make up the Perl Interface to the XAS Data Interchange Format. 5 | While information about Authorship may be retained in some files for 6 | historical reasons, this work is hereby placed in the Public Domain. 7 | This work is published from: United States. 8 | 9 | Author: Bruce Ravel (bravel AT bnl DOT gov). 10 | Last update: 6 May, 2015 -------------------------------------------------------------------------------- /languages/perl/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | example/xdi_reader.pl 3 | lib/Xray/XDI.pm 4 | lib/Xray/XDI/WriterPP.pm 5 | lib/Xray/XDIFile.pm 6 | LICENSE 7 | Makefile.PL 8 | MANIFEST 9 | README.org 10 | t/00_base.t 11 | t/01_moose_nonmoose.t 12 | t/02_moosish.t 13 | t/03_nofile.t 14 | t/baddata/01_no_xdi_line.t 15 | t/baddata/02_no_edge.t 16 | t/baddata/03_no_symbol.t 17 | t/baddata/06_no_minus_signs.t 18 | t/baddata/07_columns.t 19 | t/baddata/11_bad_comment_char.t 20 | t/baddata/12_no_dspacing.t 21 | t/baddata/13_inconsistent_columns.t 22 | t/baddata/15_nonnumeric.t 23 | t/baddata/18_headers.t 24 | t/baddata/25_things_missing.t 25 | t/baddata/28_datatime.t 26 | t/baddata/99_coverage.t 27 | t/baddata/test_coverage.sh 28 | t/gooddata/01_cu_metal_10k.t 29 | t/gooddata/02_cu_metal_rt.t 30 | t/gooddata/03_fe2o3.t 31 | t/gooddata/04_fe3c_rt.t 32 | t/gooddata/05_fe_metal_rt.t 33 | t/gooddata/06_fen_rt.t 34 | t/gooddata/07_feo_rt1.t 35 | t/gooddata/08_ni_metal_rt.t 36 | t/gooddata/09_pt_metal_rt.t 37 | t/gooddata/10_se_na2so4_rt.t 38 | t/gooddata/11_se_znse_rt.t 39 | t/gooddata/12_zn_na2so4_rt.t 40 | t/writer/01_pp.t 41 | -------------------------------------------------------------------------------- /languages/perl/MANIFEST.SKIP: -------------------------------------------------------------------------------- 1 | # Version control files and dirs. 2 | \bRCS\b 3 | \bCVS\b 4 | ,v$ 5 | \B\.svn\b 6 | 7 | # Makemaker generated files and dirs. 8 | ^MANIFEST\. 9 | ^Makefile$ 10 | ^blib/ 11 | ^MakeMaker-\d 12 | 13 | # Temp, old and emacs backup files. 14 | ~$ 15 | \.old$ 16 | ^#.*#$ 17 | ^\.# 18 | 19 | XDIFile.inl 20 | ^_Inline/ 21 | MYMETA.json 22 | MYMETA.yml 23 | pm_to_blib 24 | -------------------------------------------------------------------------------- /languages/perl/Makefile.PL: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | eval { 4 | require Inline::MakeMaker; 5 | }; 6 | if ($@) { 7 | print "You need to install the 'Inline' perl module before building the XDI perl wrapper. 8 | See https://metacpan.org/release/Inline 9 | or install from a package for your system: 10 | debian/ubuntu: libinline-perl 11 | redhat/mandriva: perl-Inline 12 | suse: perl-Inline 13 | gentoo: dev-perl/Inline 14 | "; 15 | exit; 16 | } 17 | } 18 | 19 | import Inline::MakeMaker; 20 | 21 | WriteMakefile( 22 | NAME => 'Xray::XDI', 23 | VERSION_FROM => 'lib/Xray/XDI.pm', # finds $VERSION 24 | PREREQ_PM => { 25 | Inline => 0.5, 26 | Inline::C => 0.62, 27 | Moose => 2.06, 28 | MooseX::NonMoose => 0.22, 29 | MooseX::Aliases => 0.10, 30 | MooseX::Clone => 0.05, 31 | }, 32 | ($] >= 5.005 ? ## Add these new keywords supported since 5.005 33 | (ABSTRACT_FROM => 'lib/Xray/XDI.pm', # retrieve abstract from module 34 | AUTHOR => 'Bruce Ravel ') : ()), 35 | LICENSE => 'unrestricted', 36 | CONFIGURE_REQUIRES => { 37 | 'Inline::MakeMaker' => 0.45, 38 | 'ExtUtils::MakeMaker' => 6.52, 39 | }, 40 | 'test' => { 41 | 'TESTS' => 't/*.t t/gooddata/*.t t/baddata/*.t t/writer/*.t' 42 | }, 43 | ); 44 | 45 | # To the extent possible, the authors have waived all rights granted by 46 | # copyright law and related laws for the code and documentation that 47 | # make up the Perl Interface to the XAS Data Interchange Format. 48 | # While information about Authorship may be retained in some files for 49 | # historical reasons, this work is hereby placed in the Public Domain. 50 | # This work is published from: United States. 51 | # 52 | # Author: Bruce Ravel (bravel AT bnl DOT gov). 53 | # Last update: 22 July, 2014 54 | -------------------------------------------------------------------------------- /languages/perl/README.org: -------------------------------------------------------------------------------- 1 | * Xray-XDI version 0.01 2 | 3 | This module provides a perl interface to ~libxdifile~, the C interface 4 | to the XDI file format. 5 | 6 | ** INSTALLATION 7 | 8 | Before installation, you must somehow install perl's [[https://metacpan.org/release/Inline][Inline]] package. 9 | This can be installed from the ~cpan~ utility (=install Inline=) or 10 | using your system's package manager (~libinline-perl~ on debian & ubuntu, 11 | ~perl-Inline~ on redhat, mandriva, & SUSE). 12 | 13 | To install this module type the following: 14 | 15 | : perl Makefile.PL 16 | : make 17 | : make test 18 | : make install 19 | 20 | If any tests fail, send a bug report to Bruce Ravel (bravel AT bnl DOT 21 | gov). The bug report should identify the operating system, the 22 | version of perl (~perl -v~), and screen output from the ~make test~ 23 | phase. 24 | 25 | For documentation, once installed: 26 | 27 | : perldoc Xray::XDI 28 | 29 | 30 | ** DEPENDENCIES 31 | 32 | This module requires these modules, all available from cpan and as 33 | packages for major linux distributions: 34 | 35 | 1. Inline 36 | 2. Inline::C 37 | 3. Moose 38 | 4. MooseX::NonMoose 39 | 5. MooseX::Aliases 40 | 41 | ** MISSING FEATURES 42 | 43 | * method for putting an array onto an Xray::XDI object 44 | * method for getting all tokens (extend token method) 45 | 46 | ** COPYRIGHT AND LICENCE 47 | 48 | To the extent possible, the authors have waived all rights granted by 49 | copyright law and related laws for the code and documentation that 50 | make up the Perl Interface to the XAS Data Interchange Format. While 51 | information about Authorship may be retained in some files for 52 | historical reasons, this work is hereby placed in the Public Domain. 53 | This work is published from: United States. 54 | 55 | Author: Bruce Ravel (bravel AT bnl DOT gov). 56 | Last update: 22 July, 2014 57 | -------------------------------------------------------------------------------- /languages/perl/example/xdi_reader.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | ## This is a replica in perl of the xdi_reader.c test program 4 | ## the only difference is the order in which the metadata is printed to the screen 5 | ## 6 | ## to run this *before* installing Xray::XDI, try using the -I flag like so: 7 | ## perl -Iblib/lib -Iblib/arch example/xdi_reader.pl ../../baddata/bad_32.xdi 8 | 9 | use strict; 10 | use warnings; 11 | use Xray::XDI; 12 | 13 | my $xdi = Xray::XDI->new(file=>$ARGV[0]||""); 14 | if (not defined($xdi->xdifile)) { 15 | print "Syntax: xdi_reader.pl filename\n"; 16 | exit; 17 | }; 18 | if ($xdi->errorcode < 0) { 19 | printf "Error reading XDI file '%s':\n\t%s\t(error code = %d)\n", $ARGV[0], $xdi->errormessage, $xdi->errorcode; 20 | exit; 21 | }; 22 | if ($xdi->errorcode > 0) { 23 | printf "Warning reading XDI file '%s':\n\t%s\t(warning code = %d)\n\n", $ARGV[0], $xdi->errormessage, $xdi->errorcode; 24 | }; 25 | 26 | 27 | print "#------\n"; 28 | printf "# XDI FILE Read %s: |%s|%s|\n", $xdi->filename, $xdi->xdi_version, $xdi->extra_version; 29 | printf "# Elem/Edge: %s|%s|\n", $xdi->element, $xdi->edge; 30 | 31 | 32 | 33 | print "# User comments:\n"; 34 | print $xdi->comments, $/; 35 | 36 | 37 | 38 | printf "# Metadata(%d entries):\n--\n", $xdi->nmetadata; 39 | foreach my $fam (sort keys %{$xdi->metadata}) { 40 | foreach my $key (sort keys %{$xdi->metadata->{$fam}}) { 41 | my $value = $xdi->metadata->{$fam}->{$key}; 42 | printf " %s / %s => %s\n", $fam, $key, $value; 43 | my $i = $xdi->validate($fam, $key, $value); 44 | if ($i) { 45 | printf "-- Warning for %s.%s: %s\t(warning code = %d)\n\t%s\n", 46 | $fam, $key, $value, $i, $xdi->errormessage; 47 | }; 48 | }; 49 | }; 50 | print $/; 51 | 52 | 53 | 54 | my $i = $xdi->required; 55 | printf "# check for required metadata -- (requirement code %d):\n%s\n", $i, $xdi->errormessage; 56 | 57 | $i = $xdi->recommended; 58 | printf "# check for recommended metadata -- (recommendation code %d):\n%s\n", $i, $xdi->errormessage; 59 | 60 | 61 | 62 | printf "# Arrays Index, Name, Values: (%s points total):\n", $xdi->npts; 63 | $i = 0; 64 | foreach my $lab (@{$xdi->array_labels}) { 65 | my @x = $xdi->get_array($lab); 66 | printf "%d %9s: %s, %s, %s, %s, ... %s, %s\n", $i, $lab, @x[0..3], @x[-2,-1]; 67 | ++$i; 68 | }; 69 | -------------------------------------------------------------------------------- /languages/perl/lib/Xray/XDI/WriterPP.pm: -------------------------------------------------------------------------------- 1 | package Xray::XDI::WriterPP; 2 | 3 | use Moose::Role; 4 | use MooseX::Aliases; 5 | 6 | sub export { 7 | my ($self, $filename) = @_; 8 | open(my $OUT, '>', $filename) or die "could not write an XDI file to $filename"; 9 | print $OUT $self->export_text; 10 | close $OUT; 11 | return $self; 12 | }; 13 | alias write => 'export'; 14 | alias freeze => 'export'; 15 | 16 | sub export_text { 17 | my ($self) = @_; 18 | my $text = $self->_section_version; 19 | $text .= $self->_section_columns; 20 | $text .= $self->_section_metadata; 21 | $text .= $self->_section_comments; 22 | $text .= $self->_section_labels; 23 | $text .= $self->_section_data; 24 | return $text; 25 | }; 26 | 27 | sub _section_version { 28 | my ($self) = @_; 29 | return $self->token('comment') . ' ' . 30 | $self->token('version') . $self->xdi_libversion . ' ' . 31 | $self->extra_version . $/; 32 | }; 33 | 34 | sub _section_columns { 35 | my ($self) = @_; 36 | my $text = q{}; 37 | my $i = 1; 38 | foreach my $col ($self->labels) { 39 | $text .= $self->token('comment') . ' ' . 40 | ucfirst($self->token('column')) . $i . $self->token('delimiter') . ' ' . 41 | $col . $/; 42 | $i++; 43 | }; 44 | return $text; 45 | }; 46 | 47 | sub _section_metadata { 48 | my ($self) = @_; 49 | my $text = q{}; 50 | foreach my $fam ($self->families) { 51 | next if (lc($fam) eq 'column'); 52 | foreach my $key ($self->keywords($fam)) { 53 | $text .= $self->token('comment') . ' ' . 54 | ucfirst($fam) . $self->token('dot') . $key . $self->token('delimiter') . ' ' . 55 | $self->get_item($fam, $key) . $/; 56 | }; 57 | }; 58 | return $text; 59 | }; 60 | 61 | sub _section_comments { 62 | my ($self) = @_; 63 | my $text = q{}; 64 | $text .= $self->token('comment') . $self->token('startcomment') x 20 . $/; 65 | foreach my $cl (split(/\n/, $self->comments)) { 66 | $text .= $self->token('comment') . $cl . $/; 67 | }; 68 | $text .= $self->token('comment') . $self->token('endcomment') x 20 . $/; 69 | return $text; 70 | }; 71 | 72 | 73 | sub _section_labels { 74 | my ($self) = @_; 75 | my $text = q{}; 76 | $text .= $self->token('comment'); 77 | foreach my $lab ($self->labels) { 78 | $text .= ' ' . $lab; 79 | }; 80 | $text .= $/; 81 | return $text; 82 | }; 83 | 84 | sub _section_data { 85 | my ($self) = @_; 86 | my $text = q{}; 87 | foreach my $i (0 .. $self->npts-1) { 88 | foreach my $col ($self->labels) { 89 | $text .= sprintf(" %-14s", $self->data->{$col}->[$i]); 90 | }; 91 | $text .= $/; 92 | }; 93 | return $text; 94 | }; 95 | 96 | 1; 97 | 98 | =head1 NAME 99 | 100 | Xray::XDI - A pure perl XAS Data Interchange exporter 101 | 102 | =head1 VERSION 103 | 104 | 0.01 105 | 106 | =head1 SYNOPSIS 107 | 108 | Export an XDI file: 109 | 110 | $xdi -> export("outfile.dat"); 111 | 112 | C and C are aliases for C and may be used 113 | interchangeably. 114 | 115 | =head1 DEPENDENCIES 116 | 117 | =over 4 118 | 119 | =item * 120 | 121 | L, L 122 | 123 | =back 124 | 125 | =head1 BUGS AND LIMITATIONS 126 | 127 | =over 4 128 | 129 | =item * 130 | 131 | Need an algorithm for determining column formatting in 132 | C<_section_data>. Need to preserve resolution. 133 | 134 | =back 135 | 136 | Please report problems to Bruce Ravel (bravel AT bnl DOT gov) 137 | 138 | Patches are welcome. 139 | 140 | =head1 AUTHOR 141 | 142 | Bruce Ravel (bravel AT bnl DOT gov) 143 | 144 | L 145 | 146 | =head1 LICENCE AND COPYRIGHT 147 | 148 | To the extent possible, the authors have waived all rights granted by 149 | copyright law and related laws for the code and documentation that 150 | make up the Perl Interface to the XAS Data Interchange Format. 151 | While information about Authorship may be retained in some files for 152 | historical reasons, this work is hereby placed in the Public Domain. 153 | This work is published from: United States. 154 | 155 | Author: Bruce Ravel (bravel AT bnl DOT gov). 156 | Last update: 8 September, 2012 157 | 158 | =cut 159 | -------------------------------------------------------------------------------- /languages/perl/t/00_base.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../blib/lib -I../blib/arch 2 | 3 | ## test the Inline C code in the Xray::XDIFile module 4 | 5 | use Test::More tests => 46; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDIFile') }; 15 | 16 | my $errcode = 0; 17 | my $here = dirname($0); 18 | my $file = File::Spec->catfile($here, '..', '..', '..', 'data', 'co_metal_rt.xdi'); 19 | my $xdifile = Xray::XDIFile->new($file, $errcode); 20 | ok($errcode == 0, 'error code = 0'); 21 | ok($xdifile =~ m{Xray::XDIFile}, 'created Xray::XDIFile object'); 22 | 23 | ok( $xdifile->_token('comment') eq '#', 'token: comment'); 24 | ok( $xdifile->_token('delimiter') eq ':', 'token: delimiter'); 25 | ok( $xdifile->_token('dot') eq '.', 'token: dot'); 26 | ok( $xdifile->_token('startcomment') eq '///', 'token: startcomment'); 27 | ok( $xdifile->_token('endcomment') eq '---', 'token: endcomment'); 28 | ok( $xdifile->_token('energycolumn') eq 'energy', 'token: energycolumn'); 29 | ok( $xdifile->_token('anglecolumn') eq 'angle', 'token: anglecolumn'); 30 | ok( $xdifile->_token('version') eq 'XDI/', 'token: version'); 31 | ok( $xdifile->_token('edge') eq 'element.edge', 'token: edge'); 32 | ok( $xdifile->_token('element') eq 'element.symbol', 'token: element'); 33 | ok( $xdifile->_token('column') eq 'column.', 'token: column'); 34 | ok( $xdifile->_token('dspacing') eq 'mono.d_spacing', 'token: dspacing'); 35 | ok( $xdifile->_token('timestamp') eq 'scan.start_time', 'token: starttime'); 36 | ok( $xdifile->_token('glorb') eq '', 'token: "glorb" is not a token'); 37 | 38 | my @edges = $xdifile->_valid_edges; 39 | ok($#edges == 26, 'edge symbols'); 40 | my @elements = $xdifile->_valid_elements; 41 | ok($#elements == 117, 'element symbols'); 42 | 43 | ok($xdifile->_filename =~ m{co_metal_rt.xdi}, 'filename'); 44 | ok($xdifile->_xdi_libversion eq '1.1.0', 'xdi_libversion'); 45 | ok($xdifile->_xdi_version >= 1.0, 'xdi_version'); 46 | ok($xdifile->_extra_version =~ m{GSE}, 'extra_version'); 47 | 48 | ok(ucfirst($xdifile->_element) eq 'Co', 'element'); 49 | ok(ucfirst($xdifile->_edge) eq 'K', 'edge'); 50 | print $xdifile->_dspacing, $/; 51 | ok(abs($xdifile->_dspacing - 3.13555) < $epsi, 'dspacing'); 52 | ok($xdifile->_comments =~ m{room temperature}, 'comments'); 53 | ok($xdifile->_nmetadata == 19, 'nmetadata'); 54 | 55 | my @families = $xdifile->_meta_families; 56 | my @keywords = $xdifile->_meta_keywords; 57 | my @values = $xdifile->_meta_values; 58 | 59 | ok($#families == $xdifile->_nmetadata -1, 'number of families'); 60 | ok($#families == $xdifile->_nmetadata -1, 'number of keywords'); 61 | ok($#values == $xdifile->_nmetadata -1, 'number of values'); 62 | 63 | ok($families[6] eq 'Mono', 'specific family'); 64 | ok($keywords[6] eq 'name', 'specific keyword'); 65 | ok($values[6] eq 'Si 111', 'specific value'); 66 | 67 | ok($xdifile->_npts == 418, 'npts'); 68 | ok($xdifile->_narrays == 3, 'narrays'); 69 | ok($xdifile->_narrays == $xdifile->_narray_labels, 'narray_labels'); 70 | 71 | my @array_labels = $xdifile->_array_labels; 72 | ok($#array_labels == $xdifile->_narrays -1, 'number of arrays'); 73 | ok((($array_labels[0] eq 'energy') and ($array_labels[1] eq 'mutrans') and ($array_labels[2] eq 'i0')), 'array labels'); 74 | 75 | my @array_units = $xdifile->_array_units; 76 | ok(lc($array_units[0]) eq 'ev', 'array units'); 77 | 78 | my @x = $xdifile->_data_array(0); 79 | my @y = $xdifile->_data_array(1); 80 | my @z = $xdifile->_data_array(2); 81 | 82 | ok($#x == $xdifile->_npts -1, 'number of pts, array 0'); 83 | ok($#y == $xdifile->_npts -1, 'number of pts, array 1'); 84 | ok($#z == $xdifile->_npts -1, 'number of pts, array 2'); 85 | 86 | ok((abs($x[7] - 7579) < $epsi), '7th data point, array 0'); 87 | ok((abs($y[7] + 0.82160876) < $epsi), '7th data point, array 1'); 88 | ok((abs($z[7] - 116268.7) < $epsi), '7th data point, array 2'); 89 | -------------------------------------------------------------------------------- /languages/perl/t/01_moose_nonmoose.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../blib/lib -I../blib/arch 2 | 3 | ## test the construction of the Moose attribute structure in Xray::XDI; 4 | 5 | use Test::More tests => 46; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', 'data', 'co_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | ok($xdi =~ m{Xray::XDI}, 'created Xray::XDI object'); 20 | ok(($xdi->errorcode == 0), 'errorcode 0'); 21 | ok(($xdi->errormessage =~ m{\A\s*\z}), 'error text is empty'); 22 | 23 | ok( $xdi->token('comment') eq '#', 'token: comment'); 24 | ok( $xdi->token('delimiter') eq ':', 'token: delimiter'); 25 | ok( $xdi->token('dot') eq '.', 'token: dot'); 26 | ok( $xdi->token('startcomment') eq '///', 'token: startcomment'); 27 | ok( $xdi->token('endcomment') eq '---', 'token: endcomment'); 28 | ok( $xdi->token('energycolumn') eq 'energy', 'token: energycolumn'); 29 | ok( $xdi->token('anglecolumn') eq 'angle', 'token: anglecolumn'); 30 | ok( $xdi->token('version') eq 'XDI/', 'token: version'); 31 | ok( $xdi->token('edge') eq 'element.edge', 'token: edge'); 32 | ok( $xdi->token('element') eq 'element.symbol', 'token: element'); 33 | ok( $xdi->token('column') eq 'column.', 'token: column'); 34 | ok( $xdi->token('dspacing') eq 'mono.d_spacing', 'token: dspacing'); 35 | ok( $xdi->token('timestamp') eq 'scan.start_time', 'token: timestamp'); 36 | ok( $xdi->token('glorb') eq '', 'token: "glorb" is not a token'); 37 | 38 | my @edges = $xdi->valid_edges; 39 | ok($#edges == 26, 'edge symbols'); 40 | my @elements = $xdi->valid_elements; 41 | ok($#elements == 117, 'element symbols'); 42 | 43 | 44 | ok($xdi->filename =~ m{co_metal_rt.xdi}, 'filename'); 45 | ok($xdi->xdi_libversion eq '1.1.0', 'xdi_libversion'); 46 | ok($xdi->xdi_version >= 1.0, 'xdi_version'); 47 | ok($xdi->extra_version =~ m{GSE}, 'extra_version'); 48 | 49 | ok(ucfirst($xdi->element) eq 'Co', 'element'); 50 | ok(ucfirst($xdi->edge) eq 'K', 'edge'); 51 | ok(abs($xdi->dspacing - 3.13555) < $epsi, 'dspacing'); 52 | ok($xdi->comments =~ m{room temperature}, 'comments'); 53 | ok($xdi->nmetadata == 19, 'nmetadata'); 54 | 55 | ok($xdi->comments =~ m{vert slits}, 'comments'); 56 | 57 | my $hash = $xdi->metadata; 58 | my @families = sort keys(%$hash); 59 | ok($#families == 7, 'number of metadata families'); 60 | 61 | my $count = 0; 62 | foreach my $f (@families) { 63 | $count += keys(%{$xdi->metadata->{$f}}); 64 | }; 65 | ok($count == $xdi->nmetadata, 'correct number of metadata items'); 66 | 67 | ok($xdi->metadata->{Mono}->{name} eq 'Si 111', 'fetching Mono.name'); 68 | ok($xdi->metadata->{Facility}->{xray_source} eq 'APS undulator A', 'fetching Facility.xray_source'); 69 | 70 | ok($xdi->npts == 418, 'npts'); 71 | ok($xdi->narrays == 3, 'narrays'); 72 | ok($xdi->narrays == $xdi->narray_labels, 'narray_labels'); 73 | 74 | my $array_labels = $xdi->array_labels; 75 | ok($#{$array_labels} == $xdi->narrays -1, 'number of arrays'); 76 | ok(( ($array_labels->[0] eq 'energy' ) 77 | and ($array_labels->[1] eq 'mutrans') 78 | and ($array_labels->[2] eq 'i0' )), 'array labels'); 79 | 80 | my $array_units = $xdi->array_units; 81 | ok(lc($array_units->[0]) eq 'ev', 'array units'); 82 | 83 | 84 | ok($#{$xdi->data->{$array_labels->[0]}} == $xdi->npts -1, 'number of pts, array 0'); 85 | ok($#{$xdi->data->{$array_labels->[1]}} == $xdi->npts -1, 'number of pts, array 1'); 86 | ok($#{$xdi->data->{$array_labels->[2]}} == $xdi->npts -1, 'number of pts, array 2'); 87 | 88 | ok((abs($xdi->data->{$array_labels->[0]}->[7] - 7579) < $epsi), '7th data point, array 0'); 89 | ok((abs($xdi->data->{$array_labels->[1]}->[7] + 0.82160876) < $epsi), '7th data point, array 1'); 90 | ok((abs($xdi->data->{$array_labels->[2]}->[7] - 116268.7) < $epsi), '7th data point, array 2'); 91 | -------------------------------------------------------------------------------- /languages/perl/t/02_moosish.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../blib/lib -I../blib/arch 2 | 3 | ## test the more perl-y interface provided by the Xray::XDI methods 4 | 5 | use Test::More tests => 29; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', 'data', 'co_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 2, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[1] eq 'harmonic_rejection') and 40 | ($keywords[2] eq 'name')), 'keywords: keyword names'); 41 | my $a = join("|", $xdi->keywords('Beamline')); 42 | my $b = join("|", $xdi->keywords('beamline')); 43 | my $c = join("|", $xdi->keywords('BEAMLINE')); 44 | ok((($a eq $b) and ($a eq $c)), 'keywords: capitalization'); 45 | my @d = $xdi->keywords('frobnox'); 46 | ok($#d == -1, 'keywords: empty list for non-family'); 47 | 48 | 49 | ##### test get_item ############################################# 50 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 51 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS undulator A', 'get_item: fetching Facility.xray_source'); 52 | 53 | ok($xdi->get_item(qw(Frobnox name)) eq q{}, 'get_item: empty list for non-family'); 54 | ok($xdi->get_item(qw(Mono frobnox)) eq q{}, 'get_item: empty list for non-keyword'); 55 | 56 | ##### test get_array and get_iarray ############################## 57 | my @values = (7579, -0.82160876, 116268.7); 58 | foreach my $lab (@{$xdi->array_labels}) { 59 | my @x = $xdi->get_array($lab); 60 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 61 | my $val = shift @values; 62 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 63 | }; 64 | @values = (7579, -0.82160876, 116268.7); 65 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 66 | my @x = $xdi->get_iarray($i); 67 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 68 | my $val = shift @values; 69 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 70 | }; 71 | 72 | @d = $xdi->get_array('frobnox'); 73 | ok($#d == -1, 'get_array: empty list for non-label'); 74 | @d = $xdi->get_iarray(12); 75 | ok($#d == -1, 'get_iarray: empty list for non-column number (12)'); 76 | @d = $xdi->get_iarray(-3); 77 | ok($#d == -1, 'get_iarray: empty list for non-column number (-3)'); 78 | 79 | -------------------------------------------------------------------------------- /languages/perl/t/03_nofile.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../blib/lib -I../blib/arch 2 | 3 | ## test that unfindable and non-XDI files are handled sensibly 4 | 5 | use Test::More tests => 3; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | BEGIN { use_ok('Xray::XDI') }; 13 | 14 | my $here = dirname($0); 15 | my $file = File::Spec->catfile($here, '..', '..', '..', 'data', 'co_metal_rt.xdiX'); 16 | my $xdi = Xray::XDI->new(file=>$file); 17 | ok($xdi->errormessage =~ m{does not exist}, 'file not exist'); 18 | 19 | $file = File::Spec->catfile($here, '..', '..', '..', 'data'); 20 | $xdi = Xray::XDI->new(file=>$file); 21 | ok($xdi->errormessage =~ m{is a folder}, 'is a folder'); 22 | 23 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/01_no_xdi_line.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the no XDI line bad data example 4 | 5 | use Test::More tests => 3; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_01.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | #my $xdi = Xray::XDI->new; 20 | #$xdi->file($file); 21 | 22 | ok(($xdi->errorcode<0), 'bad_01.xdi flagged as failing to import'); 23 | ok(($xdi->errormessage =~ m{not an XDI}), 'correctly identified problem'); 24 | 25 | open(my $COV, '>', 'coverage.txt'); 26 | print $COV 1, $/; 27 | close $COV; 28 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/02_no_edge.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the no XDI line bad data example 4 | 5 | use Test::More tests => 5; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_02.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | $xdi->required; 21 | ok(($xdi->errorcode>0), 'bad_02.xdi flagged with a warning'); 22 | ok(($xdi->errormessage =~ m{Element.edge missing}), 'correctly identified missing edge symbol'); 23 | 24 | 25 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_04.xdi'); 26 | $xdi = Xray::XDI->new(file=>$file); 27 | 28 | $xdi->required; 29 | ok(($xdi->errorcode>0), 'bad_04.xdi flagged with a warning'); 30 | ok(($xdi->errormessage =~ m{Element.edge missing}), 'correctly identified invalid edge symbol'); 31 | 32 | open(my $COV, '>>', 'coverage.txt'); 33 | print $COV 2, $/; 34 | print $COV 4, $/; 35 | close $COV; 36 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/03_no_symbol.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the no XDI line bad data example 4 | 5 | use Test::More tests => 5; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_03.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | $xdi->required; 21 | ok(($xdi->errorcode>0), 'bad_03.xdi flagged with a warning'); 22 | ok(($xdi->errormessage =~ m{Element.symbol missing}), 'correctly identified missing element symbol'); 23 | 24 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_05.xdi'); 25 | $xdi = Xray::XDI->new(file=>$file); 26 | 27 | $xdi->required; 28 | ok(($xdi->errorcode>0), 'bad_05.xdi flagged with a warning'); 29 | ok(($xdi->errormessage =~ m{Element.symbol missing}), 'correctly identified invalid element symbol'); 30 | 31 | 32 | open(my $COV, '>>', 'coverage.txt'); 33 | print $COV 3, $/; 34 | print $COV 5, $/; 35 | close $COV; 36 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/06_no_minus_signs.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the no line of minus signs bad data example 4 | 5 | use Test::More tests => 3; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_06.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok(($xdi->errorcode>0), 'bad_06.xdi flagged with warning'); 21 | ok(($xdi->errormessage =~ m{no line of minus signs}), 'correctly identified lack of minus signs '); 22 | 23 | 24 | open(my $COV, '>>', 'coverage.txt'); 25 | print $COV 6, $/; 26 | close $COV; 27 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/07_columns.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the non numeric values in columns bad data examples 4 | 5 | use Test::More tests => 9; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | BEGIN { use_ok('Xray::XDI') }; 13 | 14 | my $here = dirname($0); 15 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_07.xdi'); 16 | my $xdi = Xray::XDI->new(file=>$file); 17 | 18 | $xdi->recommended; 19 | ok(($xdi->errorcode>1), 'bad_07.xdi flagged as ok'); 20 | ok(($xdi->errormessage =~ m{Column.1}), 'no column labels'); 21 | 22 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_08.xdi'); 23 | $xdi = Xray::XDI->new(file=>$file); 24 | 25 | $xdi->recommended; 26 | ok(($xdi->errorcode == 0), 'bad_08.xdi flagged as ok'); 27 | ok(($xdi->errormessage =~ m{\A\s*\z}), 'to few column labels'); 28 | 29 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_09.xdi'); 30 | $xdi = Xray::XDI->new(file=>$file); 31 | 32 | $xdi->recommended; 33 | ok(($xdi->errorcode == 0), 'bad_09.xdi flagged as ok'); 34 | ok(($xdi->errormessage =~ m{\A\s*\z}), 'to many column labels'); 35 | 36 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_10.xdi'); 37 | $xdi = Xray::XDI->new(file=>$file); 38 | 39 | $xdi->recommended; 40 | ok(($xdi->errorcode == 0), 'bad_10.xdi flagged as ok'); 41 | ok(($xdi->errormessage =~ m{\A\s*\z}), 'column indeces not continuous'); 42 | 43 | 44 | open(my $COV, '>>', 'coverage.txt'); 45 | print $COV 7, $/; 46 | print $COV 8, $/; 47 | print $COV 9, $/; 48 | print $COV 10, $/; 49 | close $COV; 50 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/11_bad_comment_char.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the bad comment character bad data example 4 | 5 | use Test::More tests => 3; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_11.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok(($xdi->errorcode>0), 'bad_11.xdi flagged with warning on import'); 21 | ok(($xdi->errormessage =~ m{contains unrecognized header lines}), 'correctly identified bad comment character in metadata line'); 22 | 23 | 24 | open(my $COV, '>>', 'coverage.txt'); 25 | print $COV 11, $/; 26 | close $COV; 27 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/12_no_dspacing.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the no XDI line bad data example 4 | 5 | use Test::More tests => 3; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_12.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok(($xdi->errorcode>0), 'bad_12.xdi flagged as ok'); 21 | ok(($xdi->errormessage =~ m{no mono.d_spacing}), 'correctly identified missing d-spacing'); 22 | 23 | 24 | open(my $COV, '>>', 'coverage.txt'); 25 | print $COV 12, $/; 26 | close $COV; 27 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/13_inconsistent_columns.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the inconsistent column number bad data examples 4 | 5 | use Test::More tests => 5; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_13.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok(($xdi->errorcode<0), 'bad_13.xdi flagged as failing to import'); 21 | ok(($xdi->errormessage =~ m{number of columns changes}), 'correctly identified too few columns'); 22 | 23 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_14.xdi'); 24 | $xdi = Xray::XDI->new(file=>$file); 25 | 26 | ok(($xdi->errorcode<0), 'bad_14.xdi flagged as failing to import'); 27 | ok(($xdi->errormessage =~ m{number of columns changes}), 'correctly identified too many columns'); 28 | 29 | 30 | open(my $COV, '>>', 'coverage.txt'); 31 | print $COV 13, $/; 32 | print $COV 14, $/; 33 | close $COV; 34 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/15_nonnumeric.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the non numeric values in columns bad data examples 4 | 5 | use Test::More tests => 7; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_15.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok(($xdi->errorcode<0), 'bad_15.xdi flagged as failing to import'); 21 | ok(($xdi->errormessage =~ m{non-numeric value}), 'correctly identified NaN as a problem'); 22 | 23 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_16.xdi'); 24 | $xdi = Xray::XDI->new(file=>$file); 25 | 26 | ok(($xdi->errorcode<0), 'bad_16.xdi flagged as failing to import'); 27 | ok(($xdi->errormessage =~ m{non-numeric value}), 'correctly identified string as a problem'); 28 | 29 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_17.xdi'); 30 | $xdi = Xray::XDI->new(file=>$file); 31 | 32 | ok(($xdi->errorcode<0), 'bad_17.xdi flagged as failing to import'); 33 | ok(($xdi->errormessage =~ m{non-numeric value}), 'correctly identified 1.2.3 as a problem'); 34 | 35 | 36 | open(my $COV, '>>', 'coverage.txt'); 37 | print $COV 15, $/; 38 | print $COV 16, $/; 39 | print $COV 17, $/; 40 | close $COV; 41 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/18_headers.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the bad headers examples 4 | 5 | use Test::More tests => 13; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | BEGIN { use_ok('Xray::XDI') }; 13 | 14 | my $here = dirname($0); 15 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_18.xdi'); 16 | my $xdi = Xray::XDI->new(file=>$file); 17 | 18 | ok(($xdi->errorcode<0), 'bad_18.xdi flagged as failing to import'); 19 | ok(($xdi->errormessage =~ m{not formatted as}), 'correctly identified Family.Key -- no value'); 20 | 21 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_19.xdi'); 22 | $xdi = Xray::XDI->new(file=>$file); 23 | 24 | ok(($xdi->errorcode<0), 'bad_19.xdi flagged as failing to import'); 25 | ok(($xdi->errormessage =~ m{not formatted as}), 'correctly identified Family.Key -- no colon'); 26 | 27 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_20.xdi'); 28 | $xdi = Xray::XDI->new(file=>$file); 29 | 30 | ok(($xdi->errorcode<0), 'bad_20.xdi flagged as failing to import'); 31 | ok(($xdi->errormessage =~ m{not formatted as}), 'correctly identified Family.Key -- two colons'); 32 | 33 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_21.xdi'); 34 | $xdi = Xray::XDI->new(file=>$file); 35 | 36 | ok(($xdi->errorcode<0), 'bad_21.xdi flagged as failing to import'); 37 | ok(($xdi->errormessage =~ m{not formatted as}), 'correctly identified Family.Key -- no dot'); 38 | 39 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_22.xdi'); 40 | $xdi = Xray::XDI->new(file=>$file); 41 | 42 | ok(($xdi->errorcode<0), 'bad_22.xdi flagged as failing to import'); 43 | ok(($xdi->errormessage =~ m{invalid keyword name}), 'correctly identified Family.Key -- two dots'); 44 | 45 | # $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_23.xdi'); 46 | # $xdi = Xray::XDI->new(file=>$file); 47 | 48 | # ok(($xdi->errorcode==0), 'bad_23.xdi flagged as ok'); 49 | # ok(($xdi->errormessage), 'correctly identified Family.Key -- key starts with number'); 50 | 51 | 52 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_24.xdi'); 53 | $xdi = Xray::XDI->new(file=>$file); 54 | 55 | ok(($xdi->errorcode<0), 'bad_24.xdi flagged as failing to import'); 56 | ok(($xdi->errormessage =~ m{invalid family name}), 'correctly identified Family.Key -- family starts with number'); 57 | 58 | open(my $COV, '>>', 'coverage.txt'); 59 | print $COV 18, $/; 60 | print $COV 19, $/; 61 | print $COV 20, $/; 62 | print $COV 21, $/; 63 | print $COV 22, $/; 64 | print $COV 23, $/; 65 | print $COV 24, $/; 66 | close $COV; 67 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/25_things_missing.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test exmples with various things missing 4 | 5 | use Test::More tests => 7; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | BEGIN { use_ok('Xray::XDI') }; 13 | 14 | my $here = dirname($0); 15 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_25.xdi'); 16 | my $xdi = Xray::XDI->new(file=>$file); 17 | 18 | ok(($xdi->errorcode == 0), 'bad_25.xdi flagged as ok'); 19 | $xdi->validate('GSE', 'EXTRA', $xdi->metadata->{GSE}->{EXTRA}); 20 | ok(($xdi->errormessage =~ m{extension field used without}), 'missing extra version'); 21 | 22 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_26.xdi'); 23 | $xdi = Xray::XDI->new(file=>$file); 24 | 25 | ok(($xdi->errorcode==0), 'bad_26.xdi flagged as ok'); 26 | ok(($xdi->comments =~ m{\A\s*\z}), 'missing user comments'); 27 | 28 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_27.xdi'); 29 | $xdi = Xray::XDI->new(file=>$file); 30 | 31 | ok(($xdi->errorcode==0), 'bad_27.xdi flagged as ok'); 32 | ok(($xdi->comments =~ m{\A\s*\z}), 'line of slashes, no user comments'); 33 | 34 | open(my $COV, '>>', 'coverage.txt'); 35 | print $COV 25, $/; 36 | print $COV 26, $/; 37 | print $COV 27, $/; 38 | close $COV; 39 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/28_datatime.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test bad timestamp examples 4 | 5 | use Test::More tests => 5; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | BEGIN { use_ok('Xray::XDI') }; 13 | 14 | my $here = dirname($0); 15 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_28.xdi'); 16 | my $xdi = Xray::XDI->new(file=>$file); 17 | 18 | ok(($xdi->errorcode == 0), 'bad_28.xdi imports ok'); 19 | $xdi->validate('Scan', 'start_time', $xdi->metadata->{Scan}->{start_time}); 20 | ok(($xdi->errormessage =~ m{invalid timestamp}), 'correctly identified invalid timestamp format'); 21 | 22 | $file = File::Spec->catfile($here, '..', '..', '..', '..', 'baddata', 'bad_29.xdi'); 23 | $xdi = Xray::XDI->new(file=>$file); 24 | 25 | ok(($xdi->errorcode == 0), 'bad_29.xdi imports ok'); 26 | $xdi->validate('Scan', 'start_time', $xdi->metadata->{Scan}->{start_time}); 27 | ok(($xdi->errormessage =~ m{invalid timestamp}), 'correctly identified invalid timestamp month range'); 28 | 29 | open(my $COV, '>>', 'coverage.txt'); 30 | print $COV 28, $/; 31 | print $COV 29, $/; 32 | close $COV; 33 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/99_coverage.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## bad file coverage test 4 | 5 | use Test::More tests => 1; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $here = dirname($0); 13 | my $file = File::Spec->catfile($here, 'coverage.txt'); 14 | 15 | 16 | my $text; 17 | { 18 | local $/; 19 | open(my $COV, '<', 'coverage.txt'); 20 | $text = <$COV>; 21 | close $COV; 22 | }; 23 | 24 | my @list = sort {$a <=> $b} split(" ", $text); 25 | my @all = (1 .. 29); 26 | 27 | ok($#list eq $#all, sprintf('tested %d of %d bad files (%s)', 28 | $#list+1, $#all+1, join(",", @list))); 29 | unlink 'coverage.txt'; 30 | -------------------------------------------------------------------------------- /languages/perl/t/baddata/test_coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # run all the bad file tests such that the messages get printed to the 4 | # screen. this allows easy examination of the coverage test. 5 | 6 | all=`ls *.t` 7 | for f in $all; do 8 | perl $f 9 | done 10 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/01_cu_metal_10k.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the cu_metal_10k good data example 4 | 5 | use Test::More tests => 18; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'cu_metal_10K.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 1, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans')), 'labels: label names'); 28 | 29 | my @families = $xdi->families; 30 | ok($#families == 7, 'families: number of families'); 31 | ok( (($families[0] eq 'Beamline') and 32 | ($families[1] eq 'Column') and 33 | ($families[3] eq 'Element')), 'famlies: family names'); 34 | 35 | my @keywords = $xdi->keywords('Beamline'); 36 | ok($#keywords == 4, 'keywords: number of keywords'); 37 | ok( (($keywords[0] eq 'collimation') and 38 | ($keywords[2] eq 'harmonic_rejection') and 39 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 40 | 41 | 42 | ##### test get_item ############################################# 43 | ok($xdi->get_item(qw(Mono name)) eq 'Si(111)', 'get_item: fetching Mono.name'); 44 | ok($xdi->get_item(qw(Facility xray_source)) eq 'bend magnet', 'get_item: fetching Facility.xray_source'); 45 | 46 | ##### test get_array and get_iarray ############################## 47 | my @values = (.8856322E+04, .9656931E+00); 48 | foreach my $lab (@{$xdi->array_labels}) { 49 | my @x = $xdi->get_array($lab); 50 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 51 | my $val = shift @values; 52 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 53 | }; 54 | @values =(.8856322E+04, .9656931E+00) ; 55 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 56 | my @x = $xdi->get_iarray($i); 57 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 58 | my $val = shift @values; 59 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 60 | }; 61 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/02_cu_metal_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the cu_metal_rt good data example 4 | 5 | use Test::More tests => 26; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'cu_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 3, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[3] eq 'mutrans')), 'labels: label names'); 28 | 29 | my @families = $xdi->families; 30 | ok($#families == 8, 'families: number of families'); 31 | ok( (($families[0] eq 'Beamline') and 32 | ($families[1] eq 'Column') and 33 | ($families[2] eq 'Detector')), 'famlies: family names'); 34 | 35 | my @keywords = $xdi->keywords('Beamline'); 36 | ok($#keywords == 3, 'keywords: number of keywords'); 37 | ok( (($keywords[0] eq 'collimation') and 38 | ($keywords[2] eq 'harmonic_rejection') and 39 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 40 | 41 | 42 | ##### test get_item ############################################# 43 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 44 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS Undulator A', 'get_item: fetching Facility.xray_source'); 45 | 46 | ##### test get_array and get_iarray ############################## 47 | my @values = (8849.0, 117707.7, 440448.106567, -1.3195882); 48 | foreach my $lab (@{$xdi->array_labels}) { 49 | my @x = $xdi->get_array($lab); 50 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 51 | my $val = shift @values; 52 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 53 | }; 54 | @values = (8849.0, 117707.7, 440448.106567, -1.3195882) ; 55 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 56 | my @x = $xdi->get_iarray($i); 57 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 58 | my $val = shift @values; 59 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 60 | }; 61 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/03_fe2o3.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the fe2o3_rt good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'fe2o3_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (7032.0000, 0.37157474, 305809.00); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (7032.0000, 0.37157474, 305809.00) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/04_fe3c_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the fe3c_rt good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'fe3c_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (7032.0000, -0.16121120, 305480.80); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (7032.0000, -0.16121120, 305480.80) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/05_fe_metal_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the fe_metal_rt good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'fe_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (7032.0000, 0.35642420E-01, 305603.00); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (7032.0000, 0.35642420E-01, 305603.00) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/06_fen_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the fen_rt good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'fen_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (7032.0000, -0.49471379, 304033.20); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (7032.0000, -0.49471379, 304033.20) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/07_feo_rt1.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the feo_rt1 good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | 17 | my $here = dirname($0); 18 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'feo_rt1.xdi'); 19 | my $xdi = Xray::XDI->new(file=>$file); 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | 23 | ##### test things that return arrays of strings ################# 24 | 25 | my @labels = $xdi->labels; 26 | ok($#labels == 2, 'labels: number of labels'); 27 | ok( (($labels[0] eq 'energy') and 28 | ($labels[1] eq 'mutrans') and 29 | ($labels[2] eq 'i0')), 'labels: label names'); 30 | 31 | my @families = $xdi->families; 32 | ok($#families == 6, 'families: number of families'); 33 | ok( (($families[0] eq 'Beamline') and 34 | ($families[1] eq 'Column') and 35 | ($families[2] eq 'Detector')), 'famlies: family names'); 36 | 37 | my @keywords = $xdi->keywords('Beamline'); 38 | ok($#keywords == 2, 'keywords: number of keywords'); 39 | ok( (($keywords[2] eq 'name') and 40 | ($keywords[1] eq 'harmonic_rejection') and 41 | ($keywords[0] eq 'focusing')), 'keywords: keyword names'); 42 | 43 | 44 | ##### test get_item ############################################# 45 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 46 | ok($xdi->get_item(qw(Sample name)) eq 'FeO', 'get_item: fetching Sample.name'); 47 | 48 | ##### test get_array and get_iarray ############################## 49 | my @values = (6946.8779, -0.57534656E-01, 284661.00); 50 | foreach my $lab (@{$xdi->array_labels}) { 51 | my @x = $xdi->get_array($lab); 52 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 53 | my $val = shift @values; 54 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 55 | }; 56 | @values = (6946.8779, -0.57534656E-01, 284661.00) ; 57 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 58 | my @x = $xdi->get_iarray($i); 59 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 60 | my $val = shift @values; 61 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 62 | }; 63 | 64 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/08_ni_metal_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the ni_metal_rt good data example 4 | 5 | use Test::More tests => 22; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'ni_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 2, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'mutrans') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 2, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[1] eq 'harmonic_rejection') and 40 | ($keywords[2] eq 'name')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS undulator A', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (8203.0000, -1.2073376, 116165.70); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (8203.0000, -1.2073376, 116165.70) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/09_pt_metal_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the pt_metal_rt good data example 4 | 5 | use Test::More tests => 26; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'pt_metal_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 3, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'time') and 28 | ($labels[2] eq 'itrans')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 2, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[1] eq 'harmonic_rejection') and 40 | ($keywords[2] eq 'name')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS undulator A', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (11434.00, 1.00, 293113.1, 47988.70); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (11434.00, 1.00, 293113.1, 47988.70) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/10_se_na2so4_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the se_na2so4_rt good data example 4 | 5 | use Test::More tests => 26; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'se_na2so4_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 3, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'time') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (12543.00, 2.000000, 119305.4, 549955.4); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (12543.00, 2.000000, 119305.4, 549955.4) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/11_se_znse_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the se_znse_rt good data example 4 | 5 | use Test::More tests => 26; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'se_znse_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 3, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'time') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (12543.00, 2.000000, 118952.4, 392466.4); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (12543.00, 2.000000, 118952.4, 392466.4) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/gooddata/12_zn_na2so4_rt.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the zn_znse_rt good data example 4 | 5 | use Test::More tests => 26; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | 12 | my $epsi = 0.001; 13 | 14 | BEGIN { use_ok('Xray::XDI') }; 15 | 16 | my $here = dirname($0); 17 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'zn_znse_rt.xdi'); 18 | my $xdi = Xray::XDI->new(file=>$file); 19 | 20 | ok($xdi->errorcode == 0, 'file imported properly'); 21 | 22 | ##### test things that return arrays of strings ################# 23 | 24 | my @labels = $xdi->labels; 25 | ok($#labels == 3, 'labels: number of labels'); 26 | ok( (($labels[0] eq 'energy') and 27 | ($labels[1] eq 'time') and 28 | ($labels[2] eq 'i0')), 'labels: label names'); 29 | 30 | my @families = $xdi->families; 31 | ok($#families == 7, 'families: number of families'); 32 | ok( (($families[0] eq 'Beamline') and 33 | ($families[1] eq 'Column') and 34 | ($families[2] eq 'Detector')), 'famlies: family names'); 35 | 36 | my @keywords = $xdi->keywords('Beamline'); 37 | ok($#keywords == 3, 'keywords: number of keywords'); 38 | ok( (($keywords[0] eq 'collimation') and 39 | ($keywords[2] eq 'harmonic_rejection') and 40 | ($keywords[1] eq 'focusing')), 'keywords: keyword names'); 41 | 42 | 43 | ##### test get_item ############################################# 44 | ok($xdi->get_item(qw(Mono name)) eq 'Si 111', 'get_item: fetching Mono.name'); 45 | ok($xdi->get_item(qw(Facility xray_source)) eq 'APS bending magnet', 'get_item: fetching Facility.xray_source'); 46 | 47 | ##### test get_array and get_iarray ############################## 48 | my @values = (9544.000, 1.000000, 100224.7, 167246.2); 49 | foreach my $lab (@{$xdi->array_labels}) { 50 | my @x = $xdi->get_array($lab); 51 | ok($#x == $xdi->npts -1, "get_array: number of pts, array $lab"); 52 | my $val = shift @values; 53 | ok((abs($x[7] - $val) < $epsi), "get_array: 7th data point, array $lab"); 54 | }; 55 | @values = (9544.000, 1.000000, 100224.7, 167246.2) ; 56 | foreach my $i (1 .. $#{$xdi->array_labels}+1) { 57 | my @x = $xdi->get_iarray($i); 58 | ok($#x == $xdi->npts -1, "get_iarray: number of pts, array $i"); 59 | my $val = shift @values; 60 | ok((abs($x[7] - $val) < $epsi), "get_iarray: 7th data point, array $i"); 61 | }; 62 | -------------------------------------------------------------------------------- /languages/perl/t/writer/01_pp.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -I../../blib/lib -I../../blib/arch 2 | 3 | ## test the pure perl writer 4 | 5 | use Test::More tests => 13; 6 | 7 | use strict; 8 | use warnings; 9 | use File::Basename; 10 | use File::Spec; 11 | use List::Util qw{sum}; 12 | use List::MoreUtils qw{pairwise}; 13 | use vars qw($a $b); 14 | 15 | my $epsi = 0.0001; 16 | 17 | BEGIN { use_ok('Xray::XDI') }; 18 | 19 | my $here = dirname($0); 20 | my $file = File::Spec->catfile($here, '..', '..', '..', '..', 'data', 'cu_metal_10K.xdi'); 21 | my $xdi = Xray::XDI->new(file=>$file); 22 | 23 | $xdi->export('foo.xdi'); 24 | 25 | my $new = Xray::XDI->new(file=>'foo.xdi'); 26 | 27 | ok($xdi->xdi_libversion eq $new->xdi_version, 'xdi_version'); 28 | ok($xdi->extra_version eq $new->extra_version, 'extra_version'); 29 | 30 | ok(ucfirst($xdi->element) eq ucfirst($new->element), 'element'); 31 | ok(ucfirst($xdi->edge) eq ucfirst($new->edge), 'edge'); 32 | ok(abs($xdi->dspacing - $new->dspacing) < $epsi, 'dspacing'); 33 | 34 | # use Term::ANSIColor qw(:constants); 35 | # use String::Diff; 36 | # local %String::Diff::DEFAULT_MARKS = ( 37 | # remove_open => RED.REVERSE, 38 | # remove_close => RESET, 39 | # append_open => GREEN.REVERSE, 40 | # append_close => RESET, 41 | # ); 42 | # my($x, $n) = String::Diff::diff($xdi->comments, $new->comments); 43 | # print $x, $/, $/; 44 | # print $n, $/; 45 | 46 | ok($xdi->comments eq $new->comments, 'comments'); 47 | ok($xdi->npts == $new->npts, 'npts'); 48 | ok($xdi->narrays == $new->narrays, 'narrays'); 49 | ok($xdi->narray_labels == $new->narray_labels, 'narray_labels'); 50 | 51 | my @x = $xdi->get_array('mutrans'); 52 | my @y = $new->get_array('mutrans'); 53 | ok(sum(pairwise {abs($a - $b)} @x, @y) < $epsi, 'mutrans array'); 54 | 55 | $xdi->write('write.xdi'); 56 | $xdi->freeze('freeze.xdi'); 57 | ok(-s 'foo.xdi' == -s 'write.xdi', 'write alias' ); 58 | ok(-s 'foo.xdi' == -s 'freeze.xdi', 'freeze alias'); 59 | 60 | unlink 'foo.xdi'; 61 | unlink 'write.xdi'; 62 | unlink 'freeze.xdi'; 63 | -------------------------------------------------------------------------------- /languages/python/INSTALL: -------------------------------------------------------------------------------- 1 | Installation instructions for XDI Python module 2 | =============================================== 3 | 4 | To install the xdi module from source, use 5 | 6 | python setup.py build 7 | python setup.py install 8 | 9 | This assumes that Python 2.6 or higher is installed. 10 | 11 | Matt Newville 12 | Last Update: 2011-March-06 13 | 14 | 15 | -------------------------------------------------------------------------------- /languages/python/dlls/darwin/libxdifile.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/languages/python/dlls/darwin/libxdifile.dylib -------------------------------------------------------------------------------- /languages/python/dlls/linux64/libxdifile.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/languages/python/dlls/linux64/libxdifile.so -------------------------------------------------------------------------------- /languages/python/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | from xdifile import __version__, get_localdll 4 | 5 | dlldir, dllname = get_localdll() 6 | 7 | setup(name = 'xdifile', 8 | version = __version__, 9 | author = 'Matthew Newville', 10 | author_email = 'newville@cars.uchicago.edu', 11 | url = 'http://xas.org/XasDataLibrary', 12 | license = 'Public Domain', 13 | description = 'x-ray absorption spectra library', 14 | data_files = [(dlldir, [dllname])], 15 | package_dir = {'xdifile': 'xdifile'}, 16 | packages = ['xdifile']) 17 | -------------------------------------------------------------------------------- /languages/python/tests/test1.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | sys.path.insert(0, '../') 4 | import lib as xdi 5 | 6 | testfile = os.path.join('..', '..', 'data', 'cu_metal_10k.xdi') 7 | if len(sys.argv) > 1: 8 | testfile = sys.argv[1] 9 | 10 | f = xdi.XDIFile(testfile) 11 | 12 | print( 'Read file ', f.filename) 13 | 14 | #print( '==Extra Fields') 15 | #for key in dir(f): 16 | # if not key.startswith('_'): 17 | # print( ' %s: %s' % (key, getattr(f, key))) 18 | 19 | print( '==File:', f.filename) 20 | print( '==Element, Edge: ', f.element, f.edge) 21 | print( '==Extra Version:', f.extra_version) 22 | print( '==User Comments:', f.comments) 23 | print( '==Array Labels:', f.array_labels) 24 | print( '==Array Npts:', f.npts) 25 | print( '==Data: array shape, type:', f.rawdata.shape, f.rawdata.dtype) 26 | -------------------------------------------------------------------------------- /languages/python/xdifile/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Xas Data Interchange Format 3 | 4 | Matthew Newville 5 | last update: 2015-Apr-12 6 | 7 | == License: 8 | To the extent possible, the authors have waived all rights 9 | granted by copyright law and related laws for the code and 10 | documentation that make up the XAS Data Library. While 11 | information about Authorship may be retained in some files 12 | for historical reasons, this work is hereby placed in the 13 | Public Domain. This work is published from: United States. 14 | 15 | == Overview: 16 | The xdi module provides a way to read/write files in the 17 | XAS Data Interchange format 18 | 19 | """ 20 | 21 | from .xdi import XDIFile, get_dllname, get_localdll, __version__ 22 | -------------------------------------------------------------------------------- /lib/LICENSE: -------------------------------------------------------------------------------- 1 | The xdifile library and its consitutuent source code (xdifile.c, 2 | xdifile.h, strutil.f, strutils.h) are free and unencumbered software 3 | released into the public domain. 4 | 5 | Anyone is free to copy, modify, publish, use, compile, sell, or 6 | distribute this software, either in source code form or as a compiled 7 | binary, for any purpose, commercial or non-commercial, and by any 8 | means. 9 | 10 | In jurisdictions that recognize copyright laws, the author or authors 11 | of this software dedicate any and all copyright interest in the 12 | software to the public domain. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 | OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/LICENSE.slre: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2013 Sergey Lyubka 2 | Copyright (c) 2013 Cesanta Software Limited 3 | All rights reserved 4 | 5 | This code is dual-licensed: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License version 2 as 7 | published by the Free Software Foundation. For the terms of this 8 | license, see . 9 | 10 | You are free to use this code under the terms of the GNU General 11 | Public License, but WITHOUT ANY WARRANTY; without even the implied 12 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU General Public License for more details. 14 | 15 | Alternatively, you can license this code under a commercial 16 | license, as set out in . 17 | -------------------------------------------------------------------------------- /lib/Makefile.in: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for XDIFile C library 3 | # 4 | # 5 | AR = ar 6 | CPP = @CPP@ 7 | MAKEINFO = @MAKEINFO@ 8 | PACKAGE = @PACKAGE@ 9 | RANLIB = @RANLIB@ 10 | SHELL = @SHELL@ 11 | LINK = @CC@ 12 | srcdir = @srcdir@ 13 | prefix = @prefix@ 14 | exec_prefix = @exec_prefix@ 15 | LDFLAGS = @LDFLAGS@ 16 | bindir = @bindir@ 17 | libdir = @libdir@ 18 | includedir = @includedir@ 19 | 20 | # you may have to alter these settings 21 | #--------------------------------- 22 | 23 | CCOPTS = -fPIC -g 24 | ## CCOPTS = -arch i386 -arch x86_64 25 | 26 | # you shouldn't have to alter anything below this line 27 | #--------------------------------- 28 | READER = xdi_reader 29 | LIBXDIF_STATIC = libxdifile.a 30 | LIBXDIF_SHARED = libxdifile.so 31 | LIBXDIF_DYLIB = libxdifile.dylib 32 | LIBXDIF_DLL = xdifile.dll 33 | XDIHEADERS = strutil.h xdifile.h 34 | XDIF_OBJ = xdifile.o strutil.o slre.o 35 | SHARED = $(CCOPTS) -shared 36 | CC = @CC@ $(CCOPTS) 37 | LINKXDIF = -L$(libdir) -L. -lxdifile 38 | 39 | all: $(READER) $(LIBXDIF_STATIC) $(LIBXDIF_SHARED) 40 | 41 | $(READER).o: $(READER).c $(XDIHEADERS) 42 | 43 | .PHONY: clean install default 44 | 45 | default: $(READER) 46 | 47 | strutil.o: strutil.h 48 | xdifile.o: xdifile.h strutil.h slre.h 49 | slre.o: slre.h 50 | 51 | $(LIBXDIF_STATIC): $(XDIF_OBJ) 52 | @rm -f $@ 53 | $(AR) cru $(LIBXDIF_STATIC) $(XDIF_OBJ) 54 | $(RANLIB) $(LIBXDIF_STATIC) 55 | 56 | $(LIBXDIF_SHARED): $(XDIF_OBJ) 57 | @rm -f $@ 58 | $(LINK) $(SHARED) -o $@ $(XDIF_OBJ) 59 | 60 | $(READER): $(LIBXDIF_STATIC) $(READER).o 61 | $(LINK) -o $(READER) $(READER).o $(LIBXDIF_STATIC) 62 | 63 | clean: 64 | rm -f $(XDIF_OBJ) $(READER).o $(READER) $(LIBXDIF_STATIC) $(LIBXDIF_SHARED) $(LIBXDIF_DYLIB) $(LIBXDIF_DLL) 65 | 66 | distclean: clean 67 | rm -f Makefile config.log config.status stamp-h1 68 | 69 | install: $(LIBXDIF_STATIC) $(LIBXDIF_SHARED) 70 | cp -pr $(LIBXDIF_STATIC) $(libdir)/$(LIBXDIF_STATIC) 71 | cp -pr $(LIBXDIF_SHARED) $(libdir)/$(LIBXDIF_SHARED) 72 | cp -pr $(XDIHEADERS) $(includedir) 73 | -------------------------------------------------------------------------------- /lib/build_mac_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # build for Mac OS X 3 | arch='-arch i386 -arch x86_64 -arch ppc' 4 | make clean 5 | ./configure 6 | make CC="gcc -O2 $arch" LINK="gcc -O2 $arch" 7 | mv libxdifile.so libxdifile.dylib 8 | -------------------------------------------------------------------------------- /lib/build_win32.bat: -------------------------------------------------------------------------------- 1 | REM This builds xdifile.dll for Win32 using MinGW 2 | 3 | @echo off 4 | 5 | REM 6 | REM it assumes MinGW is installed in C:\MinGW\bin, 7 | REM and that MinGW msys is in C:\MinGW\msys 8 | REM 9 | 10 | set oldpath=%PATH% 11 | SET PATH=C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem; 12 | 13 | make clean 14 | make 15 | gcc -shared -o xdifile.dll xdifile.o strutil.o -Wl,--add-stdcall-alias -lgcc -lm -mwindows 16 | 17 | SET PATH=%oldpath% 18 | 19 | -------------------------------------------------------------------------------- /lib/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* Name of package */ 5 | #define PACKAGE "xdilib" 6 | 7 | /* Define to the address where bug reports for this package should be sent. */ 8 | #define PACKAGE_BUGREPORT "newville@cars.uchicago.edu" 9 | 10 | /* Define to the full name of this package. */ 11 | #define PACKAGE_NAME "XDIFile Library" 12 | 13 | /* Define to the full name and version of this package. */ 14 | #define PACKAGE_STRING "XDIFile Library 0.1.0" 15 | 16 | /* Define to the one symbol short name of this package. */ 17 | #define PACKAGE_TARNAME "xdifile-library" 18 | 19 | /* Define to the home page for this package. */ 20 | #define PACKAGE_URL "" 21 | 22 | /* Define to the version of this package. */ 23 | #define PACKAGE_VERSION "0.1.0" 24 | 25 | /* Version number of package */ 26 | #define VERSION "0.1.0" 27 | -------------------------------------------------------------------------------- /lib/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Name of package */ 4 | #undef PACKAGE 5 | 6 | /* Define to the address where bug reports for this package should be sent. */ 7 | #undef PACKAGE_BUGREPORT 8 | 9 | /* Define to the full name of this package. */ 10 | #undef PACKAGE_NAME 11 | 12 | /* Define to the full name and version of this package. */ 13 | #undef PACKAGE_STRING 14 | 15 | /* Define to the one symbol short name of this package. */ 16 | #undef PACKAGE_TARNAME 17 | 18 | /* Define to the home page for this package. */ 19 | #undef PACKAGE_URL 20 | 21 | /* Define to the version of this package. */ 22 | #undef PACKAGE_VERSION 23 | 24 | /* Version number of package */ 25 | #undef VERSION 26 | -------------------------------------------------------------------------------- /lib/configure.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2000 Matt Newville 2 | # 3 | # This file is free software; the author gives unlimited permission 4 | # to copy and/or distribute it, with or without modifications, as 5 | # long as this notice is preserved. 6 | # 7 | AC_INIT(XDIFile Library, 0.1.0, newville@cars.uchicago.edu) 8 | AM_INIT_AUTOMAKE(xdilib, 0.1.0) 9 | AC_PROG_CC(gcc cc ) 10 | AC_PROG_CPP(gcc cc) 11 | AM_CONFIG_HEADER(config.h) 12 | AC_ISC_POSIX 13 | AC_PROG_RANLIB 14 | AC_OUTPUT([Makefile]) 15 | -------------------------------------------------------------------------------- /lib/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | true 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | chmodcmd="" 122 | else 123 | instcmd=mkdir 124 | fi 125 | else 126 | 127 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 128 | # might cause directories to be created, which would be especially bad 129 | # if $src (and thus $dsttmp) contains '*'. 130 | 131 | if [ -f $src -o -d $src ] 132 | then 133 | true 134 | else 135 | echo "install: $src does not exist" 136 | exit 1 137 | fi 138 | 139 | if [ x"$dst" = x ] 140 | then 141 | echo "install: no destination specified" 142 | exit 1 143 | else 144 | true 145 | fi 146 | 147 | # If destination is a directory, append the input filename; if your system 148 | # does not like double slashes in filenames, you may need to add some logic 149 | 150 | if [ -d $dst ] 151 | then 152 | dst="$dst"/`basename $src` 153 | else 154 | true 155 | fi 156 | fi 157 | 158 | ## this sed command emulates the dirname command 159 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 160 | 161 | # Make sure that the destination directory exists. 162 | # this part is taken from Noah Friedman's mkinstalldirs script 163 | 164 | # Skip lots of stat calls in the usual case. 165 | if [ ! -d "$dstdir" ]; then 166 | defaultIFS=' 167 | ' 168 | IFS="${IFS-${defaultIFS}}" 169 | 170 | oIFS="${IFS}" 171 | # Some sh's can't handle IFS=/ for some reason. 172 | IFS='%' 173 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 174 | IFS="${oIFS}" 175 | 176 | pathcomp='' 177 | 178 | while [ $# -ne 0 ] ; do 179 | pathcomp="${pathcomp}${1}" 180 | shift 181 | 182 | if [ ! -d "${pathcomp}" ] ; 183 | then 184 | $mkdirprog "${pathcomp}" 185 | else 186 | true 187 | fi 188 | 189 | pathcomp="${pathcomp}/" 190 | done 191 | fi 192 | 193 | if [ x"$dir_arg" != x ] 194 | then 195 | $doit $instcmd $dst && 196 | 197 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 198 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 199 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 200 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 201 | else 202 | 203 | # If we're going to rename the final executable, determine the name now. 204 | 205 | if [ x"$transformarg" = x ] 206 | then 207 | dstfile=`basename $dst` 208 | else 209 | dstfile=`basename $dst $transformbasename | 210 | sed $transformarg`$transformbasename 211 | fi 212 | 213 | # don't allow the sed command to completely eliminate the filename 214 | 215 | if [ x"$dstfile" = x ] 216 | then 217 | dstfile=`basename $dst` 218 | else 219 | true 220 | fi 221 | 222 | # Make a temp file name in the proper directory. 223 | 224 | dsttmp=$dstdir/#inst.$$# 225 | 226 | # Move or copy the file name to the temp name 227 | 228 | $doit $instcmd $src $dsttmp && 229 | 230 | trap "rm -f ${dsttmp}" 0 && 231 | 232 | # and set any options; do chmod last to preserve setuid bits 233 | 234 | # If any of these fail, we abort the whole thing. If we want to 235 | # ignore errors from any of these, just make sure not to ignore 236 | # errors from the above "$doit $instcmd $src $dsttmp" command. 237 | 238 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 239 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 240 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 241 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 242 | 243 | # Now rename the file to the real destination. 244 | 245 | $doit $rmcmd -f $dstdir/$dstfile && 246 | $doit $mvcmd $dsttmp $dstdir/$dstfile 247 | 248 | fi && 249 | 250 | 251 | exit 0 252 | -------------------------------------------------------------------------------- /lib/reconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2001,2003 Matt Newville 4 | # 5 | # Purpose: rerun autoconf and automake after playing with 6 | # configure.in and other primitive build instruction 7 | # files. 8 | # This requires a full set of autotools to be installed, and only 9 | # needs to be run for development, not for building and installation. 10 | # 11 | # This file is free software; as a special exception the author gives 12 | # unlimited permission to copy and/or distribute it, with or without 13 | # modifications, as long as this notice is preserved. 14 | # 15 | # This program is distributed in the hope that it will be useful, but 16 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 17 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | # 19 | # 20 | rm -f config.cache acconfig.h config.h 21 | 22 | aclocal # don't run this, as it blows away the TERMCAP_LIB check 23 | autoconf 24 | autoheader 25 | # acconfig 26 | # automake -a 27 | echo " ready for configure" 28 | exit 29 | -------------------------------------------------------------------------------- /lib/slre.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2013 Sergey Lyubka 3 | * Copyright (c) 2013 Cesanta Software Limited 4 | * All rights reserved 5 | * 6 | * This library is dual-licensed: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License version 2 as 8 | * published by the Free Software Foundation. For the terms of this 9 | * license, see . 10 | * 11 | * You are free to use this library under the terms of the GNU General 12 | * Public License, but WITHOUT ANY WARRANTY; without even the implied 13 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | * See the GNU General Public License for more details. 15 | * 16 | * Alternatively, you can license this library under a commercial 17 | * license, as set out in . 18 | */ 19 | 20 | /* 21 | * This is a regular expression library that implements a subset of Perl RE. 22 | * Please refer to README.md for a detailed reference. 23 | */ 24 | 25 | #ifndef SLRE_HEADER_DEFINED 26 | #define SLRE_HEADER_DEFINED 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | struct slre_cap { 33 | const char *ptr; 34 | int len; 35 | }; 36 | 37 | 38 | int slre_match(const char *regexp, const char *buf, int buf_len, 39 | struct slre_cap *caps, int num_caps, int flags); 40 | 41 | /* Possible flags for slre_match() */ 42 | enum { SLRE_IGNORE_CASE = 1 }; 43 | 44 | 45 | /* slre_match() failure codes */ 46 | #define SLRE_NO_MATCH -1 47 | #define SLRE_UNEXPECTED_QUANTIFIER -2 48 | #define SLRE_UNBALANCED_BRACKETS -3 49 | #define SLRE_INTERNAL_ERROR -4 50 | #define SLRE_INVALID_CHARACTER_SET -5 51 | #define SLRE_INVALID_METACHARACTER -6 52 | #define SLRE_CAPS_ARRAY_TOO_SMALL -7 53 | #define SLRE_TOO_MANY_BRANCHES -8 54 | #define SLRE_TOO_MANY_BRACKETS -9 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* SLRE_HEADER_DEFINED */ 61 | -------------------------------------------------------------------------------- /lib/strutil.c: -------------------------------------------------------------------------------- 1 | /* read XDI file in C */ 2 | 3 | /* This file is free and unencumbered software released into the public domain. */ 4 | /* */ 5 | /* Anyone is free to copy, modify, publish, use, compile, sell, or */ 6 | /* distribute this software, either in source code form or as a compiled */ 7 | /* binary, for any purpose, commercial or non-commercial, and by any */ 8 | /* means. */ 9 | /* */ 10 | /* In jurisdictions that recognize copyright laws, the author or authors */ 11 | /* of this software dedicate any and all copyright interest in the */ 12 | /* software to the public domain. */ 13 | /* */ 14 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ 15 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ 16 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ 17 | /* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR */ 18 | /* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, */ 19 | /* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */ 20 | /* OTHER DEALINGS IN THE SOFTWARE. */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "strutil.h" 29 | 30 | char *strtrim(char *str) { 31 | /* trim leading and ending whitespace from a string */ 32 | char *end; 33 | 34 | /* removing leading whitespace */ 35 | while (isspace(*str)) {str++;} 36 | 37 | if (*str == 0) return str; 38 | 39 | /* find then trim ending whitespace */ 40 | end = str + strlen(str) - 1; 41 | while (end > str && isspace(*end)) {end--;} 42 | 43 | /* put null at new end of string */ 44 | *(end+1) = 0; 45 | return str; 46 | } 47 | 48 | /*-------------------------------------------------------*/ 49 | /* read array of text lines from an open data file */ 50 | int readlines(char *filename, char **textlines) { 51 | /* returns number of lines read, textlines should be pre-declared 52 | as char *text[MAX] */ 53 | 54 | FILE *finp; 55 | char *thisline; 56 | char *text; 57 | long file_length, index, i, ilen; 58 | int is_newline; 59 | char *orig_text, *orig_thisline; 60 | 61 | finp = fopen(filename, "r"); 62 | if (finp == NULL) { 63 | printf("Error opening %s: %s\n", filename, strerror(errno)); 64 | return -errno; 65 | } 66 | 67 | fseek(finp, 0L, SEEK_END); 68 | file_length = ftell(finp); 69 | rewind(finp); 70 | 71 | text = calloc(file_length + 1, sizeof(char)); 72 | thisline = calloc(MAX_LINE_LENGTH, sizeof(char)); 73 | /* need to save a pointers to the beginning of the original strings so they can be freed at the end of this function */ 74 | orig_text = text; 75 | orig_thisline = thisline; 76 | 77 | if (text == NULL ) { 78 | printf("\nnot enough memory to read file.\n"); 79 | return -errno; 80 | } 81 | 82 | fread(text, file_length, 1, finp); 83 | fclose(finp); 84 | 85 | ilen = -1; 86 | while (*text) { 87 | index = 0; 88 | is_newline = 0; 89 | while (*text) { 90 | if (!is_newline) { 91 | if (*text == 13 || *text == 10) { 92 | is_newline = 1; 93 | } 94 | } else if (*text != 13 && *text != 10) { 95 | break; 96 | } 97 | thisline[index++] = *text++; 98 | } 99 | thisline[index] = '\0'; 100 | thisline = strtrim(thisline); 101 | ++ilen; 102 | textlines[ilen]= calloc(strlen(thisline) + 1, sizeof(char)); 103 | strcpy(textlines[ilen], thisline); 104 | if (ilen >= MAX_LINES) { 105 | printf("\nfile has too many lines. Limit is %d %d\n " , MAX_LINES, EFBIG); 106 | return -EFBIG; 107 | } 108 | } 109 | /* free strings */ 110 | text = orig_text; 111 | thisline = orig_thisline; 112 | free(text); 113 | free(thisline); 114 | return ilen; 115 | } 116 | 117 | int make_words(char *inp, char **out, int maxwords) { 118 | int i, nwords; 119 | nwords = 0; 120 | for (i = 0; i < maxwords; i++) { 121 | /* skip leading whitespace */ 122 | while (isspace(*inp)) {inp++; } 123 | 124 | if (*inp != '\0') { 125 | out[nwords++] = inp; 126 | } else { 127 | out[nwords] = 0; 128 | break; 129 | } 130 | while (*inp != '\0' && !isspace(*inp)) { inp++; } 131 | /* terminate arg: */ 132 | if (*inp != '\0' && i < maxwords-1) {*inp++ = '\0'; } 133 | } 134 | return nwords; 135 | } 136 | /* split input string on delim, returning either 1 or 2 words to out */ 137 | int split_on(char *inp, char *delim, char **out) { 138 | int i, nwords; 139 | nwords = 0; 140 | inp[strcspn(inp, CRLF)] = '\0'; 141 | for (i = 0; i < 2; i++) { 142 | /* skip leading whitespace */ 143 | while (isspace(*inp)) {inp++; } 144 | if (*inp != '\0') { 145 | out[nwords++] = inp; 146 | } else { 147 | out[nwords] = 0; 148 | break; 149 | } 150 | while (*inp != '\0' && *inp != *delim) { 151 | inp++; 152 | } 153 | /* terminate arg: */ 154 | if (*inp != '\0' && i < 1){ *inp++ = '\0'; } 155 | } 156 | return nwords; 157 | } 158 | 159 | -------------------------------------------------------------------------------- /lib/strutil.h: -------------------------------------------------------------------------------- 1 | /* This file is free and unencumbered software released into the public domain. */ 2 | /* */ 3 | /* Anyone is free to copy, modify, publish, use, compile, sell, or */ 4 | /* distribute this software, either in source code form or as a compiled */ 5 | /* binary, for any purpose, commercial or non-commercial, and by any */ 6 | /* means. */ 7 | /* */ 8 | /* In jurisdictions that recognize copyright laws, the author or authors */ 9 | /* of this software dedicate any and all copyright interest in the */ 10 | /* software to the public domain. */ 11 | /* */ 12 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ 13 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ 14 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ 15 | /* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR */ 16 | /* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, */ 17 | /* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */ 18 | /* OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #define CR "\n" 21 | #define CRLF "\n\r" 22 | 23 | #define MAX_WORD_LENGTH 8192 /* Max length of an interpretable word */ 24 | #define MAX_LINE_LENGTH 8192 /* Max chars in a line */ 25 | #define MAX_LINES 16384 /* Max number of lines */ 26 | #define MAX_WORDS 128 27 | 28 | /* Read function */ 29 | int readlines(char *filename, char **lines); 30 | int make_words(char *inp, char **out, int maxwords); 31 | int split_on(char *inp, char *delim, char **out) ; 32 | 33 | #define COPY_STRING(dest,src) dest=calloc(strlen(src)+1, sizeof(char));\ 34 | strcpy(dest, src); 35 | 36 | 37 | -------------------------------------------------------------------------------- /lib/test_valgrind.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | BEGIN { 4 | eval "use File::Which;"; 5 | if ($@) { 6 | print " 7 | This test script requires the perl module File::Which. 8 | See https://metacpan.org/pod/File::Which or 9 | install from the command line with 'cpanp i File::Which' 10 | 11 | "; 12 | exit; 13 | }; 14 | }; 15 | 16 | use strict; 17 | use warnings; 18 | use File::Which qw(which); 19 | use Term::ANSIColor; 20 | use Test::More tests => 205; 21 | 22 | my $found = which('valgrind'); 23 | if (not defined($found)) { 24 | die "\nValgrind is required for these tests, but seems not to be installed on your computer.\n\n"; 25 | }; 26 | ok($found, "valgrind is in the execution path"); 27 | 28 | my ($valgrind, $command, $x, $n); 29 | my %valgrind = (leaks => "valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all", 30 | bounds => "valgrind --tool=exp-sgcheck", ); 31 | my @good_data = (qw(co_metal_rt.xdi cu_metal_10K.xdi cu_metal_rt.xdi 32 | fe2o3_rt.xdi fe3c_rt.xdi fe_metal_rt.xdi 33 | fen_rt.xdi feo_rt1.xdi ni_metal_rt.xdi 34 | nonxafs_1d.xdi nonxafs_2d.xdi pt_metal_rt.xdi 35 | se_na2so4_rt.xdi se_znse_rt.xdi zn_znse_rt.xdi )); 36 | 37 | ## good data 38 | message('leaks', 'good'); 39 | foreach my $file (@good_data) { 40 | $command = $valgrind{leaks} . " ./xdi_reader ../data/$file 2>&1"; 41 | $x = `$command`; 42 | ok(($x =~ m{All heap blocks were freed}), "all blocks freed: $file"); 43 | ok(($x =~ m{0 errors}), "no errors: $file"); 44 | ok((not $?), "$file return value is 0"); 45 | }; 46 | 47 | message('bounds', 'good'); 48 | foreach my $file (@good_data) { 49 | $command = $valgrind{bounds} . " ./xdi_reader ../data/$file 2>&1"; 50 | $x = `$command`; 51 | ok(($x =~ m{0 errors}), "no errors: $file"); 52 | }; 53 | 54 | ## see baddata/BadFile.txt for explanations of return values 55 | my %return = ('00' => 0, '01' => 1, '02' => 0, '03' => 0, '04' => 0, '05' => 0, 56 | '06' => 0, '07' => 0, '08' => 0, '09' => 0, '10' => 0, '11' => 0, 57 | '12' => 0, '13' => 1, '14' => 1, '15' => 1, '16' => 1, '17' => 1, 58 | '18' => 1, '19' => 1, '20' => 1, '21' => 1, '22' => 1, '23' => 0, 59 | '24' => 1, '25' => 0, '26' => 0, '27' => 0, '28' => 0, '29' => 0, 60 | '30' => 0, '31' => 0, '32' => 0, '33' => 0, '34' => 0, '35' => 0); 61 | 62 | ## bad data 63 | message('leaks', 'bad'); 64 | foreach my $i (0 .. 35) { 65 | $n = sprintf("%2.2d", $i); 66 | $command = $valgrind{leaks} . " ./xdi_reader ../baddata/bad_$n.xdi 2>&1"; 67 | $x = `$command`; 68 | ok(($x =~ m{All heap blocks were freed}), "all blocks freed: bad_$n.xdi"); 69 | ok(($x =~ m{0 errors}), "no errors: bad_$n.xdi"); 70 | ok((not ($? xor $return{$n})), "bad_$n.xdi return value is $?"); 71 | }; 72 | 73 | message('bounds', 'bad'); 74 | foreach my $i (0 .. 35) { 75 | $n = sprintf("%2.2d", $i); 76 | $command = $valgrind{bounds} . " ./xdi_reader ../baddata/bad_$n.xdi 2>&1"; 77 | $x = `$command`; 78 | ok(($x =~ m{0 errors}), "no errors: bad_$n.xdi"); 79 | }; 80 | 81 | 82 | ## write a helpful message about what set of tests is being performed 83 | sub message { 84 | my ($test, $data) = @_; 85 | my %tests = (leaks => 'Testing for memory leaks', 86 | bounds => 'Bounds checking',); 87 | print colored(['green'], "$tests{$test}, $data data.", "\n"); 88 | print colored(['yellow'], 'Command is: "', $valgrind{$test}, " ./xdi_reader \"\n"); 89 | }; 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /lib/writetest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "strutil.h" 6 | #include "xdifile.h" 7 | 8 | 9 | void show_syntax(void) { 10 | /* show command line syntax */ 11 | printf("\nSyntax: writetest infile outfile\n"); 12 | } 13 | 14 | int main(int argc, char **argv) { 15 | XDIFile *xdifile; 16 | long ret, i; 17 | 18 | /* require 2 arguments! */ 19 | if (argc < 3) { 20 | show_syntax(); 21 | return 1; 22 | } 23 | 24 | 25 | /* read xdifile */ 26 | xdifile = malloc(sizeof(XDIFile)); 27 | ret = XDI_readfile(argv[1], xdifile); 28 | XDI_writefile(xdifile, argv[2]); 29 | } 30 | -------------------------------------------------------------------------------- /lib/xdi_reader.c: -------------------------------------------------------------------------------- 1 | /* read XDI file in C */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "strutil.h" 8 | #include "xdifile.h" 9 | 10 | #ifndef min 11 | #define min( a, b ) ( ((a) < (b)) ? (a) : (b) ) 12 | #endif 13 | 14 | void show_syntax(void) { 15 | /* show command line syntax */ 16 | printf("\nSyntax: xdi_reader filename\n"); 17 | } 18 | 19 | /*-------------------------------------------------------*/ 20 | int main(int argc, char **argv) { 21 | XDIFile *xdifile; 22 | long file_length, ilen, index, i, j, ret; 23 | long ncol, nrows, nheader, nwords, ndict, nout; 24 | int is_newline, fnlen, k; 25 | double *tdat; 26 | 27 | /* require 2 arguments! */ 28 | if (argc < 2) { 29 | show_syntax(); 30 | return 1; 31 | } 32 | 33 | /* read xdifile */ 34 | xdifile = malloc(sizeof(XDIFile)); 35 | ret = XDI_readfile(argv[1], xdifile); 36 | 37 | /* react to a terminal error */ 38 | if (ret < 0) { 39 | printf("Error reading XDI file '%s':\n %s\t(error code = %ld)\n", 40 | argv[1], xdifile->error_message, ret); 41 | XDI_cleanup(xdifile, ret); 42 | free(xdifile); 43 | return 1; 44 | } 45 | 46 | /* react to a warning */ 47 | if (ret > 0) { 48 | printf("Warning reading XDI file '%s':\n %s\t(warning code = %ld)\n\n", 49 | argv[1], xdifile->error_message, ret); 50 | } 51 | 52 | /* print some basic information about the file to the screen */ 53 | printf("#------\n# XDI FILE Read %s VERSIONS: |%s|%s|\n" , 54 | xdifile->filename, xdifile->xdi_version, xdifile->extra_version); 55 | printf("# Elem/Edge: %s|%s|\n", xdifile->element, xdifile->edge); 56 | printf("# User Comments:\n%s\n", xdifile->comments); 57 | 58 | /* print all the metadata to the screen, validate each item */ 59 | printf("# Metadata(%ld entries):\n", xdifile->nmetadata); 60 | printf(" --- \n"); 61 | for (i=0; i < xdifile->nmetadata; i++) { 62 | printf(" %s / %s => %s\n", 63 | xdifile->meta_families[i], 64 | xdifile->meta_keywords[i], 65 | xdifile->meta_values[i]); 66 | 67 | j = XDI_validate_item(xdifile, xdifile->meta_families[i], xdifile->meta_keywords[i], xdifile->meta_values[i]); 68 | if (j!=0) { 69 | printf("-- Warning for %s.%s: %s\t(warning code = %ld)\n\t%s\n", 70 | xdifile->meta_families[i], xdifile->meta_keywords[i], xdifile->meta_values[i], j, xdifile->error_message); 71 | } 72 | } 73 | 74 | /* do the test for REQUIRED metadata */ 75 | j = XDI_required_metadata(xdifile); 76 | printf("\n# check for required metadata -- (requirement code %ld):\n%s\n", j, xdifile->error_message); 77 | 78 | /* do the test for RECOMMENDED metadata */ 79 | j = XDI_recommended_metadata(xdifile); 80 | printf("\n# check for recommended metadata -- (recommendation code %ld):\n%s\n", j, xdifile->error_message); 81 | 82 | /* print the data table to the screen */ 83 | nout = min(4, xdifile->npts - 2); 84 | printf("# Arrays Index, Name, Values: (%ld points total): \n", xdifile->npts); 85 | tdat = (double *)calloc(xdifile->npts, sizeof(double)); 86 | for (j = 0; j < xdifile->narrays; j++ ) { 87 | ret = XDI_get_array_name(xdifile,xdifile->array_labels[j], tdat); 88 | printf(" %ld %9s: ", j, xdifile->array_labels[j]); 89 | for (k=0; k < nout; k++) { printf("%.8g, ", tdat[k]); } 90 | /* printf("\n"); */ 91 | printf("..., %.8g, %.8g\n", tdat[xdifile->npts-2], tdat[xdifile->npts-1]); 92 | } 93 | 94 | if ((strlen(xdifile->outer_label) > 0)&& xdifile->nouter > 1) { 95 | printf("OUTER Array (2D data): %ld, %s\n", xdifile->nouter, xdifile->outer_label); 96 | for (j = 0; j < 5; j++) { /*xdifile->nouter; j++) {*/ 97 | printf(" %ld/%g, " , xdifile->outer_breakpts[j], xdifile->outer_array[j]); 98 | } 99 | printf(" ..., "); 100 | nout = xdifile->nouter; 101 | for (j = nout-4; j < nout; j++) { 102 | printf(" %ld/%g, " , xdifile->outer_breakpts[j], xdifile->outer_array[j]); 103 | } 104 | printf("\n"); 105 | } 106 | 107 | /* free memory before leaving */ 108 | free(tdat); 109 | XDI_cleanup(xdifile, 0); 110 | free(xdifile); 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /specification/README.md: -------------------------------------------------------------------------------- 1 | XDI Specification Documents 2 | =========================== 3 | 4 | * [XDI Specification](spec.md): The XAS Data Interchange specification [(PDF file)](xdi_spec.pdf) 5 | 6 | * [Dictionary of Metadata](dictionary.md): The XDI dictionary [(PDF file)](xdi_dictionary.pdf) 7 | 8 | * [XDI background](background.md): Background on what XDI can be used for [(PDF file)](xdi_background.pdf) 9 | 10 | ## Generating PDF versions of these documents 11 | 12 | The following software is used to convert the markdown source files 13 | into nice-lookingt PDF files: 14 | 15 | 1. [Pandoc](http://johnmacfarlane.net/pandoc/): convert markdown into LaTeX. 16 | 1. [sed](http://www.gnu.org/software/sed/): apply several customizations to the LaTeX files 17 | 1. [pdflatex](https://www.tug.org/texlive/): compile the LaTeX files into PDF 18 | 19 | The file [maketex.sh](maketex.sh) is a Bash shell script which 20 | automates the first two steps. 21 | 22 | The file [xdi.sty](xdi.sty) is a LeTeX style file which controls the 23 | appearance of the PDF output 24 | 25 | **To make the XDI Specification document:** 26 | 27 | ~> ./maketex.sh spec 28 | ~> pdflatex xdi_spec.tex 29 | ~> pdflatex xdi_spec.tex 30 | 31 | Running the shell script generates the latex file. You then run 32 | pdflatex twice to get all the internal references correct. 33 | 34 | This makes a PDF file called `xdi_spec.pdf`. 35 | 36 | **To make the XDI Dictionary of Metadata document:** 37 | 38 | ~> ./maketex.sh dictionary 39 | ~> pdflatex xdi_dictionary.tex 40 | ~> pdflatex xdi_dictionary.tex 41 | 42 | This makes a PDF file called `xdi_dictionary.pdf`. 43 | 44 | **To make the XDI Background document:** 45 | 46 | ~> ./maketex.sh background 47 | ~> pdflatex xdi_background.tex 48 | ~> pdflatex xdi_background.tex 49 | 50 | This makes a PDF file called `xdi_background.pdf`. 51 | 52 | -------------------------------------------------------------------------------- /specification/background.md: -------------------------------------------------------------------------------- 1 | Use cases for the XAS Data Interchange format 2 | ============================================= 3 | 4 | # Conventional XAS 5 | 6 | In a conventional XAS experiment, we measure a sample somewhere 7 | between 2 and 10,000 times, possibly requiring dead-time or other 8 | corrections. Some data processing is required to correct, calibrate, 9 | and/or align the data. Those scans are then merged into a single 10 | spectrum. 11 | 12 | ![The merge of several dozen scans at the Cd K edge on a sample dilute in Cd.](images/convxas.png) 13 | 14 | XDI is about how we express the merged spectrum. In some case, XDI 15 | may also be a suitable format for the individual XAS measurements, as 16 | well. 17 | 18 | # XRF imaging experiments 19 | 20 | In an imaging experiments the heterogeneity of our samples is 21 | measured. XAS can be measured on particular spots. In this example 22 | (Tappero et al, New Phytologist 175:4, 641-654, (2007) 23 | [doi:10.1111/j.1469-8137.2007.02134.x](http://dx.doi.org/10.1111/j.1469-8137.2007.02134.x)), 24 | the Co and Ca distribution in leaf of a metal accumulating plant is 25 | shown. Co micro-XAS spectra are measured at two spots on the leaf. 26 | 27 | ![Co K edge micro-XAS measured at two spots on a leaf.](images/xrfxas.png) 28 | 29 | XDI is about how we express the micro-XAS spectrum extracted from 30 | the imaging experiment. 31 | 32 | # Difraction anomalous fine structure (DAFS) 33 | 34 | An anomalous scattering experiments yields energy-dependent scattering 35 | intensities. Here we see DAFS data measured (Ravel et al. PRB 60, 36 | 778-785 (1999) 37 | [doi:10.1103/PhysRevB.60.778](http://dx.doi.org/10.1103/PhysRevB.60.778)) 38 | near the Ti K and Ba L3 edges on BaTiO3. From these data, mu(E) or 39 | chi(k) spectra are extracted and interpreted as position-selective 40 | EXAFS. 41 | 42 | ![A DAFS measurement on BaTiO3 and the chi(k) spectrum extracted from it.](images/dafs.png) 43 | 44 | XDI is about how we express the mu(E) or chi(k) spectrum extracted from 45 | the anomalous diffraction measurement. 46 | 47 | 48 | # Non-resonant inelastic scattering 49 | 50 | A NIXS experiment can used to measure a XANES spectrum in an X-ray 51 | energy loss channel. Here we see a XANES-like spectrum for graphite 52 | in the X-ray Raman channel, superposed over the Comptopn 53 | scattering. (Bergmann, et al. Chem. Phys. Lett. 369 184 (2003) 54 | [doi:10.1016/S0009-2614(02)02003-1](http://dx.doi.org/10.1016/S0009-2614(02)02003-1)) 55 | 56 | ![NIXS data measured on graphite and the XANES spectrum extracted from it.](images/nixs.png) 57 | 58 | XDI is about how we express the mu(E) spectrum extracted from the 59 | non-resonant inelastic scattering measurement. 60 | -------------------------------------------------------------------------------- /specification/images/convxas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/images/convxas.png -------------------------------------------------------------------------------- /specification/images/dafs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/images/dafs.png -------------------------------------------------------------------------------- /specification/images/nixs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/images/nixs.png -------------------------------------------------------------------------------- /specification/images/xrfxas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/images/xrfxas.png -------------------------------------------------------------------------------- /specification/maketex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | file="spec" 4 | if [ $1 ]; then 5 | file=$1 6 | fi 7 | 8 | ## convert markdown to latex 9 | echo "converting $1" 10 | echo -n "markdown to latex ... " 11 | pandoc --no-wrap -f markdown -t latex $file.md > temp1.tex 12 | 13 | ## used starred sectioning on the first page 14 | echo -n "fixing first section, TOC, linenumbering ... " 15 | if [ "$file" = "spec" ]; then 16 | sed -i 's/section{XAS Data/section*{XAS Data/' temp1.tex 17 | sed -i 's/subsection{XDI Working Group/\subsection*{XDI Working Group/' temp1.tex 18 | sed -i '/section.Intro/i \\\tableofcontents\\thispagestyle{empty}\\newpage\\linenumbers\\linenumbersep=25pt\n\n~\n' temp1.tex 19 | elif [ "$file" = "background" ]; then 20 | echo -n "image size ... " 21 | sed -i 's/\\section{Use cases/~\n\n\\section*{Use cases/' temp1.tex 22 | sed -i '/section.Conve/i \\\linenumbers\\linenumbersep=25pt\n' temp1.tex 23 | sed -i 's/includegraphics/includegraphics[height=100px]/' temp1.tex 24 | elif [ "$file" = "dictionary" ]; then 25 | sed -i 's/section{Dictionary of/section*{Dictionary of/' temp1.tex 26 | sed -i 's/subsection{XDI Working Group/\subsection*{XDI Working Group/' temp1.tex 27 | sed -i '/section.Overview/i \\\tableofcontents\\thispagestyle{empty}\\newpage\\linenumbers\\linenumbersep=25pt\n\n~\n' temp1.tex 28 | else 29 | echo "$file not valid" 30 | exit 31 | fi 32 | 33 | sed -i 's/\\hyperref\[\([^]]*\)\]{[^}]*}/Sec.~\\ref{\1}/g' temp1.tex 34 | 35 | echo -n "xdi and xditt commands ..." 36 | ## use the \xdi macro 37 | sed -i 's/XDI\([ \.]\)/{\\xdi}\1/g' temp1.tex 38 | ## use the xditt "font" 39 | sed -i 's/texttt/xditt/g' temp1.tex 40 | 41 | sed -i 's/mu(E)/$\\mu(E)$/g' temp1.tex 42 | sed -i 's/chi(k)/$\\chi(k)$/g' temp1.tex 43 | 44 | ## clean up 45 | inner="_inner" 46 | mv temp1.tex $file$inner.tex 47 | echo "done" 48 | -------------------------------------------------------------------------------- /specification/xdi.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This file defines the appearence of the XDI specification and the 3 | %% Dictionary of Metadata 4 | %% 5 | \usepackage{bera} % font selection 6 | \usepackage[utf8]{inputenc} % read Armando's name correctly! 7 | 8 | %\usepackage{amsmath, amssymb} % AMS mathematics 9 | \usepackage{graphicx} % figures 10 | 11 | \usepackage{color} 12 | \usepackage{fancybox} % shadow and oval boxes 13 | 14 | % hyperlinks 15 | \definecolor{redish}{rgb}{0.40,0.00,0.20} 16 | \usepackage[colorlinks=true, linkcolor=redish, urlcolor=blue]{hyperref} 17 | 18 | %\usepackage{highlight} % notes to self -- this is highly non-standard 19 | % and should be commented out for 20 | % general use 21 | 22 | \usepackage{lineno} % line numbering 23 | 24 | \usepackage{tocloft} % fine control over the table of contents 25 | \setlength\cftparskip{-1pt} 26 | \setlength{\cftsubsecnumwidth}{3em} % allow a bit more space after the 27 | % subsection number in the TOC 28 | \setcounter{tocdepth}{2} 29 | 30 | \usepackage{longtable} % longtable and booktabs used to 31 | \usepackage{booktabs} % handle the big table of column names in 32 | % the dictionary 33 | 34 | 35 | \usepackage{fullpage} %page size 36 | \setlength{\parindent}{0pt} 37 | \setlength{\parskip}{1.25ex plus2mm minus1mm} 38 | 39 | %% typset "XDI" and XDI version number 40 | \newcommand{\sltt}[1]{\textit{\texttt{#1}}} 41 | \newcommand{\xdi}{\sltt{XDI}} 42 | \newcommand{\xdiversion}{1.0} 43 | 44 | %% typeset monospace font within a small, gray box 45 | \setlength{\fboxsep}{2pt} 46 | \setlength{\fboxrule}{1pt} 47 | \definecolor{dark-gray}{gray}{0.75} 48 | \definecolor{light-gray}{gray}{0.95} 49 | \newcommand{\xditt}[1]{\fcolorbox{dark-gray}{light-gray}{\small\texttt{#1}}} 50 | 51 | 52 | %% \newcommand{\mcomm}[2]{\marginpar{\quad\includegraphics[width=1.0cm]{exclamation.jpg}\\% 53 | %% See p.~\pageref{#2}\\\textit{#1}}} 54 | 55 | \newenvironment{Boxedminipage}{\begin{Sbox}\begin{minipage}}% 56 | {\end{minipage}\end{Sbox}\shadowbox{\TheSbox}} 57 | 58 | \newcommand{\DMD}{\href{https://github.com/XraySpectroscopy/XAS-Data-Interchange/wiki/Dictionary-of-metadata} 59 | {\textsf{Dictionary of Metadata}}} 60 | 61 | 62 | \newcommand{\Summary}{{\xdi}} 63 | \setlength{\headsep}{2ex} 64 | \usepackage{lastpage} 65 | \usepackage{fancyhdr} 66 | \pagestyle{fancy} 67 | \lhead{} 68 | \chead{} 69 | \rhead{\Summary} 70 | \lfoot{} 71 | \cfoot{} 72 | \rfoot{\thepage \hspace{1pt} / \pageref*{LastPage}} 73 | \renewcommand{\headrulewidth}{2pt} 74 | -------------------------------------------------------------------------------- /specification/xdi_background.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/xdi_background.pdf -------------------------------------------------------------------------------- /specification/xdi_background.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper]{article} 2 | \usepackage{xdi} 3 | \renewcommand{\Summary}{{\xdi} Background} 4 | 5 | \begin{document} 6 | \input{background_inner.tex} 7 | \end{document} 8 | 9 | %%% Local Variables: 10 | %%% mode: latex 11 | %%% TeX-master: t 12 | %%% TeX-parse-self: t 13 | %%% TeX-auto-save: t 14 | %%% TeX-auto-untabify: t 15 | %%% TeX-PDF-mode: t 16 | %%% End: 17 | -------------------------------------------------------------------------------- /specification/xdi_dictionary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/xdi_dictionary.pdf -------------------------------------------------------------------------------- /specification/xdi_dictionary.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper]{article} 2 | \usepackage{xdi} 3 | \renewcommand{\Summary}{Dictionary of Metadata, version \xdiversion} 4 | 5 | \begin{document} 6 | \input{dictionary_inner.tex} 7 | \end{document} 8 | 9 | %%% Local Variables: 10 | %%% mode: latex 11 | %%% TeX-master: t 12 | %%% TeX-parse-self: t 13 | %%% TeX-auto-save: t 14 | %%% TeX-auto-untabify: t 15 | %%% TeX-PDF-mode: t 16 | %%% End: 17 | -------------------------------------------------------------------------------- /specification/xdi_spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XraySpectroscopy/XAS-Data-Interchange/ed21ad5aa3a066f569e13e607679b2542fc93fa7/specification/xdi_spec.pdf -------------------------------------------------------------------------------- /specification/xdi_spec.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper]{article} 2 | \usepackage{xdi} 3 | \renewcommand{\Summary}{{\xdi} Specification \xdiversion} 4 | 5 | \begin{document} 6 | \input{spec_inner.tex} 7 | \end{document} 8 | 9 | %%% Local Variables: 10 | %%% mode: latex 11 | %%% TeX-master: t 12 | %%% TeX-parse-self: t 13 | %%% TeX-auto-save: t 14 | %%% TeX-auto-untabify: t 15 | %%% TeX-PDF-mode: t 16 | %%% End: 17 | --------------------------------------------------------------------------------