-
Notifications
You must be signed in to change notification settings - Fork 2
/
sht_file.in.hpp
2246 lines (1949 loc) · 96.4 KB
/
sht_file.in.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (c) 2019, De Graef Group, Carnegie Mellon University *
* All rights reserved. *
* *
* Author William C. Lenthe *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, this *
* list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, *
* this list of conditions and the following disclaimer in the documentation *
* and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" *
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE *
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL *
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* This file is configured from the following template file:
* @CMAKE_CURRENT_SOURCE_DIR@/sht_file.hpp.in
*
* To fix compile errors in this file you need to edit the original file and NOT
* this file.
*/
#ifndef _SHT_FILE_H_
#define _SHT_FILE_H_
#include <vector>
#include <iostream>
#include <memory>
#include <type_traits>
#include <complex>
namespace sht {
static const char VersionString[9] = "@SHT_FILE_VERS@";
static const int8_t VERSION_MAJOR = 1;
static const int8_t VERSION_MINOR = 1;
//@brief: all user defined types need methods to hash, sanity check, and read/write from a file
struct CompoundData : std::vector<char> {
//@brief: sanity check the contents of this data block (throw if not)
virtual void sanityCheck() const {;}
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
virtual uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
virtual std::ostream& write(std::ostream& os) const {return os.write(std::vector<char>::data(), std::vector<char>::size());}
//@brief : read data from an istream
//@param is : istream to read from
//@param swp: does the input stream need to be byte swapped (is the endedness mismatched)
//@return : is
virtual std::istream& read(std::istream& is, const bool swp) {return is.read (std::vector<char>::data(), std::vector<char>::size());}
//@brief: byte swap data
virtual void byteSwap() = 0;
//@brief : access a block of data as a given type
//@param n: offset to access at
template <typename T> typename std::remove_pointer<T>::type const * nthByteAs(const size_t n, typename std::enable_if< std::is_pointer<T>::value >::type* = 0) const {return T (std::vector<char>::data() + n) ; }
template <typename T> typename std::remove_pointer<T>::type * nthByteAs(const size_t n, typename std::enable_if< std::is_pointer<T>::value >::type* = 0) {return T (std::vector<char>::data() + n) ; }
template <typename T> T const & nthByteAs(const size_t n, typename std::enable_if<!std::is_pointer<T>::value >::type* = 0) const {return ( (T const *)(std::vector<char>::data() + n) )[0]; }
template <typename T> T & nthByteAs(const size_t n, typename std::enable_if<!std::is_pointer<T>::value >::type* = 0) {return ( (T *)(std::vector<char>::data() + n) )[0]; }
//@brief : expose size based constructor
//@param n: length of data in bytes
CompoundData(const size_t n = 0) : std::vector<char>(n, 0) {}
};
enum class Modality : int8_t {
Unknown = 0x00,
EBSD = 0x01,//start of SEM techniques
ECP = 0x02,
TKD = 0x03,
PED = 0x11,//start of TEM techniques
Laue = 0x21,//start of X-Ray techniques
};
enum class Vendor : int8_t {
Unknown = 0x00,
EMsoft = 0x01,
};
//@brief: abstract base class for vendor defined simulation data types
struct SimulationData : public CompoundData {
//@brief : expose size based constructor
//@param n: length of data in bytes
SimulationData(const size_t n = 0) : CompoundData(n) {}
//@brief: default destructor (for unique_ptr)
virtual ~SimulationData() = default;
//@brief : check if this datatype supports a given modality
//@param m: modality to check support for
//@return : true if the data type supports m, false otherwise
virtual bool forModality(const Modality& m) const = 0;
//@brief : get the vendor this data type is associated with
//@return: vendor
virtual Vendor getVendor() const = 0;
//@brief : factory method to build known vendor specific simulation meta data types
//@param mod: modality
//@param ven: vendor
//@return : unique pointer allocated with vendor specific type (or NULL if known suitable type is known)
static std::unique_ptr<SimulationData> Factory(const Modality mod, const Vendor ven);
};
//@file and target experiment info
struct FileHeader : public CompoundData {
std::string doi ;//utf8 doi storage (padded up to 8 byte multiple)
std::string notes ;//utf8 notes storage (padded up to 8 byte multiple)
//@brief: constructor sets size and magic bytes
FileHeader();
//File and Version Identification
//@brief : access magic bytes
//@return: pointer to start of magic bytes (4x char)
char const * magicBytes() const {return CompoundData::nthByteAs<char const*>(0);}
char * magicBytes() {return CompoundData::nthByteAs<char *>(0);}
//@brief : access file version
//@return: pointer to start of file version (2x int8_t, {major, minor})
int8_t const * fileVersion() const {return CompoundData::nthByteAs<int8_t const*>(4);}
int8_t * fileVersion() {return CompoundData::nthByteAs<int8_t *>(4);}
//@brief : access reserved bytes
//@return: pointer to start of reserved bytes (2x int8_t)
int8_t const * resBytes() const {return CompoundData::nthByteAs<int8_t const*>(6);}
int8_t * resBytes() {return CompoundData::nthByteAs<int8_t *>(6);}
//@brief : access software version
//@return: pointer to start of software version (8x char)
char const * softwareVersion() const {return CompoundData::nthByteAs<char const*>(8);}
char * softwareVersion() {return CompoundData::nthByteAs<char *>(8);}
// Experimental Conditions Spherical Function was Simulated for (modality dependent)
//@brief : access diffraction modality
//@return: modality type this file is intended for
const Modality& modality() const {return CompoundData::nthByteAs<Modality>(16);}
Modality& modality() {return CompoundData::nthByteAs<Modality>(16);}
//@brief : access reserved bytes
//@return: pointer to start of reserved bytes (3x int8_t)
int8_t const * resBytes2() const {return CompoundData::nthByteAs<int8_t const*>(17);}
int8_t * resBytes2() {return CompoundData::nthByteAs<int8_t *>(17);}
//@brief : access beam energy
//@return: beam energy in keV
const float& beamEnergy() const {return CompoundData::nthByteAs<float>(20);}
float& beamEnergy() {return CompoundData::nthByteAs<float>(20);}
//@brief : access primary angle
//@return: primary angle in degrees
const float& primaryAngle() const {return CompoundData::nthByteAs<float>(24);}
float& primaryAngle() {return CompoundData::nthByteAs<float>(24);}
//@brief : access secondary angle
//@return: secondary angle in degrees
const float& secondaryAngle() const {return CompoundData::nthByteAs<float>(28);}
float& secondaryAngle() {return CompoundData::nthByteAs<float>(28);}
//@brief : access reserved experimenatal paramter
//@return: reserved experimenatal paramter
const float& reservedParam() const {return CompoundData::nthByteAs<float>(32);}
float& reservedParam() {return CompoundData::nthByteAs<float>(32);}
//Metadata
//@brief : access doi string length
//@return: doi string length in bytes
const int16_t& doiLen() const {return CompoundData::nthByteAs<int16_t>(36);}
int16_t& doiLen() {return CompoundData::nthByteAs<int16_t>(36);}
//@brief : access note string length
//@return: note string length in bytes
const int16_t& noteLen() const {return CompoundData::nthByteAs<int16_t>(38);}
int16_t& noteLen() {return CompoundData::nthByteAs<int16_t>(38);}
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
std::ostream& write(std::ostream& os) const;
//@brief : read data from an istream
//@param is : istream to read from
//@param swp: does the input stream need to be byte swapped (is the endedness mismatched)
//@return : is
std::istream& read(std::istream& is, const bool swp);
//@brief : read data from an istream
//@param is: istream to read from
//@return : is
std::istream& read(std::istream& is) {return read(is, false);}//swp is a dummy parameter in this case since it is detected from the magic bytes
//@brief: byte swap data
void byteSwap();
//@brief : check if the file is big/little endian using magic bytes
//@return: true if big endian, false if little
bool fileBig() const;
//@brief : check if the the system is big/little endian
//@return: true if big endian, false if little
static bool SysBig();
//@brief : check if the the system endedness is different from the file endedness
//@return: true if mismatched, false if matching
bool endianMismatch() const {return fileBig() != SysBig();}
//@brief : set the DOI string
//@param str: new DOI string
void setDoi(std::string str);
//@brief : set the notes string
//@param str: new notes string
void setNotes(std::string str);
};
//@brief: sub type for CrystalData
struct AtomData : public CompoundData {
//@brief: constructor sets size
AtomData() : CompoundData(32) {}
//@brief: default destructor (required to silence warnings virtual function warnings)
virtual ~AtomData() = default;
//@brief : access x position
//@return: x position in 24ths of a
const float& x() const {return CompoundData::nthByteAs<float>(0);}
float& x() {return CompoundData::nthByteAs<float>(0);}
//@brief : access y position
//@return: y position in 24ths of b
const float& y() const {return CompoundData::nthByteAs<float>(4);}
float& y() {return CompoundData::nthByteAs<float>(4);}
//@brief : access z position
//@return: z position in 24ths of c
const float& z() const {return CompoundData::nthByteAs<float>(8);}
float& z() {return CompoundData::nthByteAs<float>(8);}
//@brief : access occupancy
//@return: occupancy [0,1]
const float& occ() const {return CompoundData::nthByteAs<float>(12);}
float& occ() {return CompoundData::nthByteAs<float>(12);}
//@brief : access charge
//@return: charge in atomic units
const float& charge() const {return CompoundData::nthByteAs<float>(16);}
float& charge() {return CompoundData::nthByteAs<float>(16);}
//@brief : access Debye-Waller factor
//@return: Debye-Waller factor in nm^2
const float& debWal() const {return CompoundData::nthByteAs<float>(20);}
float& debWal() {return CompoundData::nthByteAs<float>(20);}
//@brief : access reserved float parameter
//@return: reserved float paramete
const float& resFp() const {return CompoundData::nthByteAs<float>(24);}
float& resFp() {return CompoundData::nthByteAs<float>(24);}
//@brief : access atomic number
//@return: atomic number
const int8_t& atZ() const {return CompoundData::nthByteAs<int8_t>(28);}
int8_t& atZ() {return CompoundData::nthByteAs<int8_t>(28);}
//@brief : access reserved bytes
//@return: pointer to start of reserved bytes (3x int8_t)
int8_t const * resBytes() const {return CompoundData::nthByteAs<int8_t const*>(29);}
int8_t * resBytes() {return CompoundData::nthByteAs<int8_t *>(29);}
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief: byte swap data
void byteSwap();
};
//@brief: crystal structure definition
struct CrystalData : public CompoundData {
//Space Group Axis Choice Enumeration
enum class Axis : int8_t {
Orth_ABC = 0x01, Mono_B = 0x01, Default = 0x01,
Orth_BAC = 0x02, Mono_nB = 0x02,
Orth_CAB = 0x03, Mono_C = 0x03,
Orth_CBA = 0x04, Mono_nC = 0x04,
Orth_BCA = 0x05, Mono_A = 0x05,
Orth_ACB = 0x06, Mono_nA = 0x06,
};
//Space Group Cell Choice Enumeration
enum class Cell : int8_t {
Mono_1 = 0x01, Trig_Hex = 0x01, Default = 0x01,
Mono_2 = 0x02, Tet_CF = 0x02,
Mono_3 = 0x03, Trig_Rhm = 0x03, TrigHex_H = 0x03,
};
std::vector<AtomData> atoms;//actual atoms
std::string form ;//formula
std::string name ;//phase/material name
std::string symb ;//structure symbol
std::string refs ;//reference(s), doi(s) preferred, bibtex key as fallback
std::string note ;//additional notes
//@brief: constructor sets size
CrystalData() : CompoundData(72) {}
//@brief: default destructor (required to silence warnings virtual function warnings)
virtual ~CrystalData() = default;
//@brief : access space group number
//@return: space group number
const uint8_t& sgNum() const {return CompoundData::nthByteAs<uint8_t>(0);}
uint8_t& sgNum() {return CompoundData::nthByteAs<uint8_t>(0);}
//@brief : access international tables origin choice
//@return: international tables origin choice
const int8_t& sgSet() const {return CompoundData::nthByteAs<int8_t>(1);}
int8_t& sgSet() {return CompoundData::nthByteAs<int8_t>(1);}
//@brief : access space group axis choice
//@return: space group axis choice
const Axis& sgAxis() const {return CompoundData::nthByteAs<Axis>(2);}
Axis& sgAxis() {return CompoundData::nthByteAs<Axis>(2);}
//@brief : access space group cell choice
//@return: space group cell choice
const Cell& sgCell() const {return CompoundData::nthByteAs<Cell>(3);}
Cell& sgCell() {return CompoundData::nthByteAs<Cell>(3);}
//@brief : access x origin shift relative to intl. tables origin
//@return: x origin shift in 24ths of a
const float& oriX() const {return CompoundData::nthByteAs<float>(4);}
float& oriX() {return CompoundData::nthByteAs<float>(4);}
//@brief : access y origin shift relative to intl. tables origin
//@return: y origin shift in 24ths of b
const float& oriY() const {return CompoundData::nthByteAs<float>(8);}
float& oriY() {return CompoundData::nthByteAs<float>(8);}
//@brief : access z origin shift relative to intl. tables origin
//@return: z origin shift in 24ths of c
const float& oriZ() const {return CompoundData::nthByteAs<float>(12);}
float& oriZ() {return CompoundData::nthByteAs<float>(12);}
//@brief : lattice parameters in nm/degrees
//@return: lattice parameters {a, b, c, alpha, beta, gamma}
float const * lat() const {return CompoundData::nthByteAs<float const*>(16);}
float * lat() {return CompoundData::nthByteAs<float *>(16);}
//@brief : rotation applied to spherical signal {sense from material data}
//@return: rotation as {w,x,y,z} quaternion {pijk from material data}
float const * rot() const {return CompoundData::nthByteAs<float const*>(40);}
float * rot() {return CompoundData::nthByteAs<float *>(40);}
//@brief : access weighting for signal averaging
//@return: weighting for signal averaging
const float& weight() const {return CompoundData::nthByteAs<float>(56);}
float& weight() {return CompoundData::nthByteAs<float>(56);}
//@brief : access number of atoms
//@return: number of atoms
const int16_t& numAtoms() const {return CompoundData::nthByteAs<int16_t>(60);}
int16_t& numAtoms() {return CompoundData::nthByteAs<int16_t>(60);}
//@brief : access formula string length
//@return: formula string length in bytes
const int16_t& formulaLen() const {return CompoundData::nthByteAs<int16_t>(62);}
int16_t& formulaLen() {return CompoundData::nthByteAs<int16_t>(62);}
//@brief : access maerial/phase name string length
//@return: maerial/phase name string length in bytes
const int16_t& matNameLen() const {return CompoundData::nthByteAs<int16_t>(64);}
int16_t& matNameLen() {return CompoundData::nthByteAs<int16_t>(64);}
//@brief : access structure symbol string length
//@return: structure symbol string length in bytes
const int16_t& structSymLen() const {return CompoundData::nthByteAs<int16_t>(66);}
int16_t& structSymLen() {return CompoundData::nthByteAs<int16_t>(66);}
//@brief : access structure symbol string length
//@return: structure symbol string length in bytes
const int16_t& refsLen() const {return CompoundData::nthByteAs<int16_t>(68);}
int16_t& refsLen() {return CompoundData::nthByteAs<int16_t>(68);}
//@brief : access structure symbol string length
//@return: structure symbol string length in bytes
const int16_t& noteLen() const {return CompoundData::nthByteAs<int16_t>(70);}
int16_t& noteLen() {return CompoundData::nthByteAs<int16_t>(70);}
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
std::ostream& write(std::ostream& os) const;
//@brief : read data from an istream
//@param is : istream to read from
//@param swp: does the input stream need to be byte swapped (is the endedness mismatched)
//@return : is
std::istream& read(std::istream& is, const bool swp);
//@brief: byte swap data
void byteSwap();
//@brief : set the formula string
//@param str: new formula string
void setFormula(std::string str);
//@brief : set the material/phase name string
//@param str: new material/phase name string
void setName(std::string str);
//@brief : set the structure symbol string
//@param str: new structure symbol string
void setStructSym(std::string str);
//@brief : set the references string
//@param str: new references string
void setRefs(std::string str);
//@brief : set the note string
//@param str: new note string
void setNote(std::string str);
};
//@brief: crystal structure definition
struct MasterPatternData : public CompoundData {
std::vector< CrystalData > xtals;//actual crystal definitions
std::vector< std::unique_ptr<SimulationData> > simul;//simulation meta data
//@brief: constructor sets size
MasterPatternData() : CompoundData(8) {}
//@brief : access number of crystals averaged
//@return: number of crystals averaged
const int8_t& numXtal() const {return CompoundData::nthByteAs<int8_t>(0);}
int8_t& numXtal() {return CompoundData::nthByteAs<int8_t>(0);}
//@brief : access effective space group number
//@return: effective space group number
const uint8_t& sgEff() const {return CompoundData::nthByteAs<uint8_t>(1);}
uint8_t& sgEff() {return CompoundData::nthByteAs<uint8_t>(1);}
//@brief : access quaternion pijk (+/-1) for crystal rotations
//@return: \hat{i} * \hat{j}
const int8_t& pijk() const {return CompoundData::nthByteAs<int8_t>(2);}
int8_t& pijk() {return CompoundData::nthByteAs<int8_t>(2);}
//@brief : access rotation sense (active or passive)
//@return: 97 (ascii 'a') for active, 112 (ascii 'p') for passive
const int8_t& rotSense() const {return CompoundData::nthByteAs<int8_t>(3);}
int8_t& rotSense() {return CompoundData::nthByteAs<int8_t>(3);}
//@brief : access simulated modality
//@return: modality type
const Modality& modality() const {return CompoundData::nthByteAs<Modality>(4);}
Modality& modality() {return CompoundData::nthByteAs<Modality>(4);}
//@brief : access simulation vendor
//@return: vendor type
const Vendor& vendor() const {return CompoundData::nthByteAs<Vendor>(5);}
Vendor& vendor() {return CompoundData::nthByteAs<Vendor>(5);}
//@brief : access size of simulation meta data
//@return: size of simulation meta data (single entry, total size is simMetaSize() * numXtal
const int16_t& simMetaSize() const {return CompoundData::nthByteAs<int16_t>(6);}
int16_t& simMetaSize() {return CompoundData::nthByteAs<int16_t>(6);}
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
std::ostream& write(std::ostream& os) const;
//@brief : read data from an istream
//@param is : istream to read from
//@param swp: does the input stream need to be byte swapped (is the endedness mismatched)
//@return : is
std::istream& read(std::istream& is, const bool swp);
//@brief: byte swap data
void byteSwap();
};
//@brief: actual spherical harmonics storage
struct HarmonicsData : public CompoundData {
std::vector<double> alm;//actual harmonics
//@brief: constructor sets size
HarmonicsData() : CompoundData(8) {}
//@brief : access bandwidth
//@return: bandwidth
const int16_t& bw() const {return CompoundData::nthByteAs<int16_t>(0);}
int16_t& bw() {return CompoundData::nthByteAs<int16_t>(0);}
//@brief : access z rotational order used for compression
//@return: z rotational order used for compression
const int8_t& zRot() const {return CompoundData::nthByteAs<int8_t>(2);}
int8_t& zRot() {return CompoundData::nthByteAs<int8_t>(2);}
//@brief : access compression flags
//@return: mirror / inversion symmetry compression flags
//@note : flags are 4 element bitmask
// 0x01 - set if there is inversion symmetry
// 0x02 - set if there is a mirror plane at the equator
// 0x04 - set if there is a mirror plane with +y normal (normal to equator through phi = 0)
// 0x08 - set if there is a mirror plane normal to equator through phi = 90 / zRot() e.g. m11, -42m, or, 3m1
const int8_t& cmpFlg() const {return CompoundData::nthByteAs<int8_t>(3);}
int8_t& cmpFlg() {return CompoundData::nthByteAs<int8_t>(3);}
//@brief : access number of stored doubles
//@return: number of stored doubles
const int32_t& doubCnt() const {return CompoundData::nthByteAs<int32_t>(4);}
int32_t& doubCnt() {return CompoundData::nthByteAs<int32_t>(4);}
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
std::ostream& write(std::ostream& os) const;
//@brief : read data from an istream
//@param is : istream to read from
//@param swp: does the input stream need to be byte swapped (is the endedness mismatched)
//@return : is
std::istream& read(std::istream& is, const bool swp);
//@brief: byte swap data
void byteSwap();
//@brief : compute the number of non-zero spherical harmonic transform coefficients
//@param b: bandwidth to compute for
//@param n: z rotational order
//@param f: compression flag
//@return : the number of harmonic coefficients (# doubles)
static uint32_t NumHarm(const int16_t b, const int8_t n, const int8_t f);
//@brief : compress spherical harmonics
//@param in : harmonics to compress with m, l at in[m * bw + l]
//@param out: location to write compressed coefficients
//@param b : bandwidth
//@param n : z rotational order
//@param f : compression flag
template <typename Real>
static void PackHarm(std::complex<Real> const * in, Real * out, const int16_t b, const int8_t n, const int8_t f);
template <typename Real>
void packHarm(std::complex<Real> const * in, Real * out) {return PackHarm(in, out, bw(), zRot(), cmpFlg());}
//@brief : decompress spherical harmonics
//@param in : compressed coefficients to unpack
//@param out: location to write uncompressed harmoincs harmonics with m, l at out[m * bw + l]
//@param b : bandwidth
//@param n : z rotational order
//@param f : compression flag
template <typename Real>
static void UnpackHarm(Real const * in, std::complex<Real> * out, const int16_t b, const int8_t n, const int8_t f);
template <typename Real>
void unpackHarm(Real const * in, std::complex<Real> * out) {return UnpackHarm(in, out, bw(), zRot(), cmpFlg());}
//@brief : get the z rotational order for a given space group
//@param sg: space group number
//@return : z rotational order
//@note : assumes standard settings (monoclinic unique axis b, orthorhombic axis choice abc)
static int8_t SpaceGroupRot(const uint8_t sg);
//@brief : get the compression flags for a given space group
//@param sg: space group number
//@return : compression bitmask
//@note : assumes standard settings (monoclinic unique axis b, orthorhombic axis choice abc)
static int8_t SpaceGroupCmp(const uint8_t sg);
};
//@brief: harmonics master pattern binary file v1.0
struct File {
FileHeader header ;
MasterPatternData mpData ;
HarmonicsData harmonics;
uint32_t crcHash ;
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
//@brief : compute the CRC-32C hash of this data block
//@param crc: initial hash value
//@return : new hash value
uint32_t computeHash(uint32_t crc) const;
//@brief : write data to an ostream
//@param os: ostream to write to
//@return : os
std::ostream& write(std::ostream& os) const;
//@brief : read data from an istream
//@param is: istream to read from
//@return : is
std::istream& read (std::istream& is);
//@brief : create an file without any master pattern data from EMsoft style data
//@param iprm: integer parameters {sgn, mod, bw}
// sgn - effective space group number of spherical function
// mod - modality (see enumeration, EBSD == 1)
// bw - bandwidth
//@param fprm: float {keV, sig, tht, res} e.g. {20.0, 70.0, 0.0, 0.0} for typical EBSD
// keV - beam energy in keV
// sig - primary tilt angle
// tht - secondary tilt angle
// res - reserved parameter
//@param doi : file DOI string (null terminated)
//@param note: file level notes (null terminated)
//@param alm : actual harmonics (uncompressed format)
//@return : error code (void return function throws instead)
void initFileEMsoft (int32_t const * iprm, float const * fprm, char const * doi, char const * note, double const * alm);
int initFileEMsoftRet(int32_t const * iprm, float const * fprm, char const * doi, char const * note, double const * alm);
//@brief : add master pattern data to a file
//@param iprm: integer paramters {sgn, sgs, nat, nel, elm, nsx, npx, grd}
// crystal data
// sgn - space group number
// sgs - space group setting
// nat - number of atoms
// simulation data
// nel - number of electrons
// elm - electron multiplier
// nsx - numsx (monte carlo grid size)
// npx - npx (master pattern grid size)
// grd - lattitude grid type
//@param fprm: floating point parameters {a, b, c, alp, bet, gam, sgs, sge, sst, omg, kev, emn, esz, dmx, dmn, thk, c1, c2, c3, ddd, dmi}
// crystal data
// a - lattice constant a in nm
// b - lattice constant b in nm
// c - lattice constant c in nm
// alp - lattice constant alpha in degrees
// bet - lattice constant beta in degrees
// gam - lattice constant gamma in degrees
// simulation data
// sgs - sigma start
// sge - sigma end
// sst - sigma step
// omg - omega
// kev - keV
// emn - eHistMin
// esz - eBinSize
// dmx - depthMax
// dmn - depthMin
// thk - thickness
// c1 - c1
// c2 - c2
// c3 - c3
// ddd - sigDbDiff
// dmi - dMin
//@param aTy : atom types (nAt atomic numbers)
//@param aCd : atom coordinates (nAt * 5 floats {x, y, z, occupancy, Debye-Waller in nm^2})
//@param vers: EMsoft version string (8 characters, null termination not required)
//@param cprm: string parameters as one concatenated sequence will null seperators (+ final null terminator)
// {frm, nam, syb, ref}
// frm - formula string (null terimated)
// nam - material phase/name string (null terminated)
// syb - structure symbol string (null terminated)
// ref - reference string (null terminated)
// nte - note string (null terminated)
//@return : error code (void return function throws instead)
void addDataEMsoft (int32_t const * iprm, float const * fprm, int32_t const * aTy, float const * aCd, char const * vers, char const * cprm);
int addDataEMsoftRet(int32_t const * iprm, float const * fprm, int32_t const * aTy, float const * aCd, char const * vers, char const * cprm);
};
}
////////////////////////////////////////////////////////////////////////////////
// SimulationData Types //
////////////////////////////////////////////////////////////////////////////////
namespace sht {
//@brief: class to encapsulate simulation data from an EMsoft electron diffraction simulation
struct EMsoftED : public SimulationData {
//@brief: constructor sets size
EMsoftED() : SimulationData(88) {}
//@brief : access emsoft version
//@return: pointer to start of emsoft version (8x char)
char const * emsoftVersion() const {return CompoundData::nthByteAs<char const*>(0);}
char * emsoftVersion() {return CompoundData::nthByteAs<char *>(0);}
//@return: start angle in degrees (or sig for full mode)
const float& sigStart() const {return CompoundData::nthByteAs<float>(8);}
float& sigStart() {return CompoundData::nthByteAs<float>(8);}
//@return: end angle in degrees (or NAN for full mode)
const float& sigEnd() const {return CompoundData::nthByteAs<float>(12);}
float& sigEnd() {return CompoundData::nthByteAs<float>(12);}
//@return: angle step size in degrees (or NAN for full mode)
const float& sigStep() const {return CompoundData::nthByteAs<float>(16);}
float& sigStep() {return CompoundData::nthByteAs<float>(16);}
//@return: secondary tilt angle in degrees
const float& omega() const {return CompoundData::nthByteAs<float>(20);}
float& omega() {return CompoundData::nthByteAs<float>(20);}
//@return: incident beam energy in keV
const float& keV() const {return CompoundData::nthByteAs<float>(24);}
float& keV() {return CompoundData::nthByteAs<float>(24);}
//@return: minimum energy to consider in keV
const float& eHistMin() const {return CompoundData::nthByteAs<float>(28);}
float& eHistMin() {return CompoundData::nthByteAs<float>(28);}
//@return: energy bin size in keV
const float& eBinSize() const {return CompoundData::nthByteAs<float>(32);}
float& eBinSize() {return CompoundData::nthByteAs<float>(32);}
//@return: maximum depth to consider for statistics in nm
const float& depthMax() const {return CompoundData::nthByteAs<float>(36);}
float& depthMax() {return CompoundData::nthByteAs<float>(36);}
//@return: depth step size in nm
const float& depthStep() const {return CompoundData::nthByteAs<float>(40);}
float& depthStep() {return CompoundData::nthByteAs<float>(40);}
//@return: foil thickness in nm (INF for non-foil)
const float& thickness() const {return CompoundData::nthByteAs<float>(44);}
float& thickness() {return CompoundData::nthByteAs<float>(44);}
//@return: number of electrons
const int64_t& totNumEl() const {return CompoundData::nthByteAs<int64_t>(48);}
int64_t& totNumEl() {return CompoundData::nthByteAs<int64_t>(48);}
//@return: monte carlo grid size in pixels
const int16_t& numSx() const {return CompoundData::nthByteAs<int16_t>(56);}
int16_t& numSx() {return CompoundData::nthByteAs<int16_t>(56);}
//@return: pointer to start of reserved bytes (2x int8_t)
int8_t const * resBytes1() const {return CompoundData::nthByteAs<int8_t const*>(58);}
int8_t * resBytes1() {return CompoundData::nthByteAs<int8_t *>(58);}
//@return: strong beam cutoff
const float& c1() const {return CompoundData::nthByteAs<float>(60);}
float& c1() {return CompoundData::nthByteAs<float>(60);}
//@return: weak beam cutoff
const float& c2() const {return CompoundData::nthByteAs<float>(64);}
float& c2() {return CompoundData::nthByteAs<float>(64);}
//@return: complete cutoff
const float& c3() const {return CompoundData::nthByteAs<float>(68);}
float& c3() {return CompoundData::nthByteAs<float>(68);}
//@return: double diffraction max excitation error in nm^-1
const float& sigDbDiff() const {return CompoundData::nthByteAs<float>(72);}
float& sigDbDiff() {return CompoundData::nthByteAs<float>(72);}
//@return: minimum d spacing to consider in nm
const float& dMin() const {return CompoundData::nthByteAs<float>(76);}
float& dMin() {return CompoundData::nthByteAs<float>(76);}
//@return: EBSD grid half size in pixels
const int16_t& numPx() const {return CompoundData::nthByteAs<int16_t>(80);}
int16_t& numPx() {return CompoundData::nthByteAs<int16_t>(80);}
//@return: grid flag (1/2 for square lambert/legendre)
const int8_t& latGridType() const {return CompoundData::nthByteAs<int8_t>(82);}
int8_t& latGridType() {return CompoundData::nthByteAs<int8_t>(82);}
//@return: pointer to start of reserved bytes (5x int8_t)
int8_t const * resBytes2() const {return CompoundData::nthByteAs<int8_t const*>(83);}
int8_t * resBytes2() {return CompoundData::nthByteAs<int8_t *>(83);}
//@brief : check if this datatype supports a given modality
//@param m: modality to check support for
//@return : true if the data type supports m, false otherwise
bool forModality(const Modality& m) const;
//@brief : get the vendor this data type is associated with
//@return: vendor
Vendor getVendor() const {return Vendor::EMsoft;}
//@brief: byte swap data
void byteSwap();
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
};
//@brief: class to encapsulate simulation data from an EMsoft x-ray diffraction simulation
struct EMsoftXD : public SimulationData {
//@brief: constructor sets size
EMsoftXD() : SimulationData(32) {}
//@brief : access emsoft version
//@return: pointer to start of emsoft version (8x char)
char const * emsoftVersion() const {return CompoundData::nthByteAs<char const*>(0);}
char * emsoftVersion() {return CompoundData::nthByteAs<char *>(0);}
//@return: minimum wave length in nm
const float& lambdaMin() const {return CompoundData::nthByteAs<float>(8);}
float& lambdaMin() {return CompoundData::nthByteAs<float>(8);}
//@return: maximnum wave length in nm
const float& lambdaMax() const {return CompoundData::nthByteAs<float>(12);}
float& lambdaMax() {return CompoundData::nthByteAs<float>(12);}
//@return: von Mises-Fisher distribution concentration
const float& kappaVMF() const {return CompoundData::nthByteAs<float>(16);}
float& kappaVMF() {return CompoundData::nthByteAs<float>(16);}
//@return: intensity truncation factor
const float& intFactor() const {return CompoundData::nthByteAs<float>(20);}
float& intFactor() {return CompoundData::nthByteAs<float>(20);}
//@return: grid half size in pixels
const int16_t& numPx() const {return CompoundData::nthByteAs<int16_t>(24);}
int16_t& numPx() {return CompoundData::nthByteAs<int16_t>(24);}
//@return: sampling patch size
const int8_t& patchW() const {return CompoundData::nthByteAs<int8_t>(26);}
int8_t& patchW() {return CompoundData::nthByteAs<int8_t>(26);}
//@return: pointer to start of reserved bytes (5x int8_t)
int8_t const * resBytes() const {return CompoundData::nthByteAs<int8_t const*>(27);}
int8_t * resBytes() {return CompoundData::nthByteAs<int8_t *>(27);}
//@brief : check if this datatype supports a given modality
//@param m: modality to check support for
//@return : true if the data type supports m, false otherwise
bool forModality(const Modality& m) const;
//@brief : get the vendor this data type is associated with
//@return: vendor
Vendor getVendor() const {return Vendor::EMsoft;}
//@brief: byte swap data
void byteSwap();
//@brief: sanity check the contents of this data block (throw if not)
void sanityCheck() const;
};
}
////////////////////////////////////////////////////////////////////////////////
// Implementations //
////////////////////////////////////////////////////////////////////////////////
#include <limits>
#include <cmath>
#include <fstream>
static_assert(sizeof(char) == sizeof(int8_t) , "char must be 8 bits" );
static_assert(std::numeric_limits<float >::is_iec559, "float must be IEEE 754");
static_assert(std::numeric_limits<double>::is_iec559, "double must be IEEE 754");
namespace sht {
namespace detail {
uint16_t byteSwap(const uint16_t& v) {return ((v<< 8)& 0xFF00 ) | ((v>> 8)& 0x00FF ) ;}
uint32_t byteSwap(const uint32_t& v) {return ((v<<24)&0xFF000000) | ((v<< 8)&0x00FF0000) | ((v>> 8)&0x0000FF00) | ((v>>24)&0x000000FF);}
uint64_t byteSwap(const uint64_t& v) {
return ((v<<56)&0xFF00000000000000) ||
((v<<40)&0x00FF000000000000) ||
((v<<24)&0x0000FF0000000000) ||
((v<< 8)&0x000000FF00000000) ||
((v<< 8)&0x00000000FF000000) ||
((v<<24)&0x0000000000FF0000) ||
((v<<40)&0x000000000000FF00) ||
((v>>56)&0x00000000000000FF);
}
int16_t byteSwap(const int16_t& v) {return (int16_t)byteSwap((uint16_t)v);}
int32_t byteSwap(const int32_t& v) {return (int32_t)byteSwap((uint32_t)v);}
float byteSwap(const float & v) {return (float )byteSwap((uint32_t)v);}
double byteSwap(const double & v) {return (double )byteSwap((uint64_t)v);}
int64_t byteSwap(const int64_t& v) {return (int64_t)byteSwap((uint64_t)v);}
//@brief : compute the crc-32c checksum of data
//@param data : data to compute checksum of
//@param bytes: length of data in bytes
//@param crc : previous checksum value
//@return : new checksum value
//@note : this is relatively inefficient but nice and compact, if performance is a concern there are hardware accelerated versions
uint32_t crc32c(unsigned char const * data, size_t bytes, uint32_t crc = 0x00000000) {
/* on the fly table calculation
static bool once = true;
static uint32_t LUT[256];//lookup table for CRC calculation
// static const uint32_t Poly = 0xedb88320;//reversed polynomial [normal is 0x04C11DB7] (this is CRC-32 (what Gzip and PNG use))
static const uint32_t Poly = 0x1edc6f41;//normal polynomial [reversed is 0x1EDC6F41] (this is CRC-32C (what SSE4 instructions implement))
if(once) {//the table hasn't been built yet
once = false;//this isn't thread safe
for(size_t i = 0; i < 256; i++) {//loop over table entries building
LUT[i] = i;//seed with i
for(size_t j = 0; j < 8; j++) {//do CRC calculation
const bool xr = 0x00000001 == (LUT[i] & 0x00000001);
LUT[i] >>= 1;
if(xr) LUT[i] ^= Poly;
}
}
}
*/
//precomputed LUT for normal CRC-32C (0x1edc6f41)
static const uint32_t LUT[256] = {
0x00000000, 0x0a5f4d75, 0x14be9aea, 0x1ee1d79f, 0x14c5eb57, 0x1e9aa622, 0x007b71bd, 0x0a243cc8,
0x1433082d, 0x1e6c4558, 0x008d92c7, 0x0ad2dfb2, 0x00f6e37a, 0x0aa9ae0f, 0x14487990, 0x1e1734e5,
0x15deced9, 0x1f8183ac, 0x01605433, 0x0b3f1946, 0x011b258e, 0x0b4468fb, 0x15a5bf64, 0x1ffaf211,
0x01edc6f4, 0x0bb28b81, 0x15535c1e, 0x1f0c116b, 0x15282da3, 0x1f7760d6, 0x0196b749, 0x0bc9fa3c,
0x16054331, 0x1c5a0e44, 0x02bbd9db, 0x08e494ae, 0x02c0a866, 0x089fe513, 0x167e328c, 0x1c217ff9,
0x02364b1c, 0x08690669, 0x1688d1f6, 0x1cd79c83, 0x16f3a04b, 0x1caced3e, 0x024d3aa1, 0x081277d4,
0x03db8de8, 0x0984c09d, 0x17651702, 0x1d3a5a77, 0x171e66bf, 0x1d412bca, 0x03a0fc55, 0x09ffb120,
0x17e885c5, 0x1db7c8b0, 0x03561f2f, 0x0909525a, 0x032d6e92, 0x097223e7, 0x1793f478, 0x1dccb90d,
0x11b258e1, 0x1bed1594, 0x050cc20b, 0x0f538f7e, 0x0577b3b6, 0x0f28fec3, 0x11c9295c, 0x1b966429,
0x058150cc, 0x0fde1db9, 0x113fca26, 0x1b608753, 0x1144bb9b, 0x1b1bf6ee, 0x05fa2171, 0x0fa56c04,
0x046c9638, 0x0e33db4d, 0x10d20cd2, 0x1a8d41a7, 0x10a97d6f, 0x1af6301a, 0x0417e785, 0x0e48aaf0,
0x105f9e15, 0x1a00d360, 0x04e104ff, 0x0ebe498a, 0x049a7542, 0x0ec53837, 0x1024efa8, 0x1a7ba2dd,
0x07b71bd0, 0x0de856a5, 0x1309813a, 0x1956cc4f, 0x1372f087, 0x192dbdf2, 0x07cc6a6d, 0x0d932718,
0x138413fd, 0x19db5e88, 0x073a8917, 0x0d65c462, 0x0741f8aa, 0x0d1eb5df, 0x13ff6240, 0x19a02f35,
0x1269d509, 0x1836987c, 0x06d74fe3, 0x0c880296, 0x06ac3e5e, 0x0cf3732b, 0x1212a4b4, 0x184de9c1,
0x065add24, 0x0c059051, 0x12e447ce, 0x18bb0abb, 0x129f3673, 0x18c07b06, 0x0621ac99, 0x0c7ee1ec,
0x1edc6f41, 0x14832234, 0x0a62f5ab, 0x003db8de, 0x0a198416, 0x0046c963, 0x1ea71efc, 0x14f85389,
0x0aef676c, 0x00b02a19, 0x1e51fd86, 0x140eb0f3, 0x1e2a8c3b, 0x1475c14e, 0x0a9416d1, 0x00cb5ba4,
0x0b02a198, 0x015deced, 0x1fbc3b72, 0x15e37607, 0x1fc74acf, 0x159807ba, 0x0b79d025, 0x01269d50,
0x1f31a9b5, 0x156ee4c0, 0x0b8f335f, 0x01d07e2a, 0x0bf442e2, 0x01ab0f97, 0x1f4ad808, 0x1515957d,
0x08d92c70, 0x02866105, 0x1c67b69a, 0x1638fbef, 0x1c1cc727, 0x16438a52, 0x08a25dcd, 0x02fd10b8,
0x1cea245d, 0x16b56928, 0x0854beb7, 0x020bf3c2, 0x082fcf0a, 0x0270827f, 0x1c9155e0, 0x16ce1895,
0x1d07e2a9, 0x1758afdc, 0x09b97843, 0x03e63536, 0x09c209fe, 0x039d448b, 0x1d7c9314, 0x1723de61,
0x0934ea84, 0x036ba7f1, 0x1d8a706e, 0x17d53d1b, 0x1df101d3, 0x17ae4ca6, 0x094f9b39, 0x0310d64c,
0x0f6e37a0, 0x05317ad5, 0x1bd0ad4a, 0x118fe03f, 0x1babdcf7, 0x11f49182, 0x0f15461d, 0x054a0b68,
0x1b5d3f8d, 0x110272f8, 0x0fe3a567, 0x05bce812, 0x0f98d4da, 0x05c799af, 0x1b264e30, 0x11790345,
0x1ab0f979, 0x10efb40c, 0x0e0e6393, 0x04512ee6, 0x0e75122e, 0x042a5f5b, 0x1acb88c4, 0x1094c5b1,
0x0e83f154, 0x04dcbc21, 0x1a3d6bbe, 0x106226cb, 0x1a461a03, 0x10195776, 0x0ef880e9, 0x04a7cd9c,
0x196b7491, 0x133439e4, 0x0dd5ee7b, 0x078aa30e, 0x0dae9fc6, 0x07f1d2b3, 0x1910052c, 0x134f4859,
0x0d587cbc, 0x070731c9, 0x19e6e656, 0x13b9ab23, 0x199d97eb, 0x13c2da9e, 0x0d230d01, 0x077c4074,
0x0cb5ba48, 0x06eaf73d, 0x180b20a2, 0x12546dd7, 0x1870511f, 0x122f1c6a, 0x0ccecbf5, 0x06918680,
0x1886b265, 0x12d9ff10, 0x0c38288f, 0x066765fa, 0x0c435932, 0x061c1447, 0x18fdc3d8, 0x12a28ead,
};