-
Notifications
You must be signed in to change notification settings - Fork 206
/
nt_mdt.ksy
789 lines (751 loc) · 18.8 KB
/
nt_mdt.ksy
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
meta:
id: nt_mdt
title: NT-MDT data
application:
- Nova
- Image Analysis
- NanoEducator
- Gwyddion
- Callisto
file-extension: mdt
license: GPL-3.0-or-later
endian: le
doc: |
A native file format of NT-MDT scientific software. Usually contains
any of:
* [Scanning probe](https://en.wikipedia.org/wiki/Scanning_probe_microscopy) microscopy scans and spectra
* [Raman spectra](https://en.wikipedia.org/wiki/Raman_spectroscopy)
* results of their analysis
Some examples of mdt files can be downloaded at:
* <https://www.ntmdt-si.ru/resources/scan-gallery>
* <http://callistosoft.narod.ru/Resources/Mdt.zip>
doc-ref: https://svn.code.sf.net/p/gwyddion/code/trunk/gwyddion/modules/file/nt-mdt.c
seq:
- id: signature
contents: [0x01, 0xb0, 0x93, 0xff]
- id: size
type: u4
doc: File size (w/o header)
- id: reserved0
size: 4
- id: last_frame
type: u2
- id: reserved1
size: 18
- id: wrond_doc
size: 1
doc: "documentation specifies 32 bytes long header, but zeroth frame starts at 33th byte in reality"
- id: frames
size: size
type: framez
types:
uuid:
seq:
- id: data
type: u1
repeat: expr
repeat-expr: 16
framez:
seq:
- id: frames
type: frame
repeat: expr
repeat-expr: '_root.last_frame+1'
title:
seq:
- id: title_len
type: u4
- id: title
type: str
encoding: cp1251
size: title_len
xml:
seq:
- id: xml_len
type: u4
- id: xml
type: str
encoding: UTF-16LE
size: xml_len
version:
seq:
- id: minor
type: u1
- id: major
type: u1
frame:
seq:
- id: size
type: u4
doc: "h_sz"
- id: main
type: frame_main
size: size - 4
enums:
frame_type:
0: scanned
1: spectroscopy
3: text
105: old_mda
106: mda
107: palette
190: curves_new
201: curves
types:
date_time:
seq:
- id: date
type: date
- id: time
type: time
types:
date:
seq:
- id: year
type: u2
doc: "h_yea"
- id: month
type: u2
doc: "h_mon"
- id: day
type: u2
doc: "h_day"
time:
seq:
- id: hour
type: u2
doc: "h_h"
- id: min
type: u2
doc: "h_m"
- id: sec
type: u2
doc: "h_s"
frame_main:
seq:
- id: type
type: u2
enum: frame_type
doc: "h_what"
- id: version
type: version
- id: date_time
type: date_time
- id: var_size
type: u2
doc: "h_am, v6 and older only"
- id: frame_data
-orig-id: dataframe
size-eos: true
type:
switch-on: type
cases:
'frame_type::scanned': fd_scanned
'frame_type::mda': fd_meta_data
'frame_type::spectroscopy': fd_spectroscopy
'frame_type::curves': fd_spectroscopy
'frame_type::curves_new': fd_curves_new
doc: ""
dots:
seq:
- id: fm_ndots
type: u2
- id: coord_header
-orig-id: coordheader
type: dots_header
if: fm_ndots > 0
- id: coordinates
type: dots_data
repeat: expr
repeat-expr: fm_ndots
- id: data
type: data_linez(_index)
repeat: expr
repeat-expr: fm_ndots
types:
dots_header:
seq:
- id: header_size
-orig-id: headersize
type: s4
- id: header
size: header_size
type: header_
types:
header_:
seq:
- id: coord_size
-orig-id: coordsize
type: s4
- id: version
type: s4
- id: xyunits
type: s2
enum: unit
dots_data:
seq:
- id: coord_x
type: f4
- id: coord_y
type: f4
- id: forward_size
type: s4
- id: backward_size
type: s4
data_linez:
params:
- id: index
type: u2
seq:
- id: forward
type: s2
repeat: expr
repeat-expr: _parent.coordinates[index].forward_size
- id: backward
type: s2
repeat: expr
repeat-expr: _parent.coordinates[index].backward_size
axis_scale:
seq:
- id: offset
type: f4
doc: "x_scale->offset = gwy_get_gfloat_le(&p);# r0 (physical units)"
- id: step
type: f4
doc: >
x_scale->step = gwy_get_gfloat_le(&p);
r (physical units)
x_scale->step = fabs(x_scale->step);
if (!x_scale->step) {
g_warning("x_scale.step == 0, changing to 1");
x_scale->step = 1.0;
}
- id: unit
type: s2 # x_scale->unit = (gint16)gwy_get_guint16_le(&p);
enum: unit
doc: "U"
fd_curves_new:
seq:
- id: block_count
type: u4
- id: blocks_headers
type: block_descr
repeat: expr
repeat-expr: block_count
- id: blocks_names
type: str
encoding: UTF-8
size: blocks_headers[_index].name_len
repeat: expr
repeat-expr: block_count
- id: blocks_data
size: blocks_headers[_index].len
repeat: expr
repeat-expr: block_count
types:
block_descr:
seq:
- id: name_len
type: u4
- id: len
type: u4
fd_spectroscopy:
seq:
- id: vars
type: vars
size: _parent.var_size
- id: fm_mode
type: u2
- id: fm_xres
type: u2
- id: fm_yres
type: u2
- id: dots
type: dots
- id: data
type: s2
repeat: expr
repeat-expr: fm_xres*fm_yres
- id: title
type: title
- id: xml
type: xml
types:
vars:
seq:
- id: x_scale
type: axis_scale
- id: y_scale
type: axis_scale
- id: z_scale
type: axis_scale
- id: sp_mode
type: u2
- id: sp_filter
type: u2
- id: u_begin
type: f4
- id: u_end
type: f4
- id: z_up
type: s2
- id: z_down
type: s2
- id: sp_averaging
type: u2
- id: sp_repeat
type: u1 # bool
- id: sp_back
type: u1 # bool
- id: sp_4nx
type: s2
- id: sp_osc
type: u1 # bool
- id: sp_n4
type: u1
- id: sp_4x0
type: f4
- id: sp_4xr
type: f4
- id: sp_4u
type: s2
- id: sp_4i
type: s2
- id: sp_nx
type: s2
fd_meta_data:
seq:
- id: head_size
type: u4
- id: tot_len
type: u4
- id: guids
type: uuid
repeat: expr
repeat-expr: 2
- id: frame_status
size: 4
- id: name_size
type: u4
- id: comm_size
type: u4
- id: view_info_size
type: u4
- id: spec_size
type: u4
- id: source_info_size
type: u4
- id: var_size
type: u4
- id: data_offset
type: u4
- id: data_size
type: u4
- id: title
type: str
size: name_size
encoding: UTF-8
- id: xml
type: str
size: comm_size
encoding: UTF-8
- id: struct_len
type: u4
- id: array_size
type: u8
- id: cell_size
type: u4
- id: n_dimensions
type: u4
- id: n_mesurands
type: u4
- id: dimensions
type: calibration
repeat: expr
repeat-expr: n_dimensions
- id: mesurands
type: calibration
repeat: expr
repeat-expr: n_mesurands
instances:
image:
pos: data_offset
type: image
size: data_size
types:
image:
seq:
- id: image
type: vec
repeat: eos
types:
vec:
seq:
- id: items
type:
switch-on: _parent._parent.mesurands[_index].data_type
cases:
"data_type::uint8": u1
"data_type::uint16": u2
"data_type::uint32": u4
"data_type::uint64": u8
"data_type::int8": s1
"data_type::int16": s2
"data_type::int32": s4
"data_type::int64": s8
"data_type::float32": f4
"data_type::float64": f8
#"data_type::float48": s8
#"data_type::float80": s8
#"data_type::floatfix": s8
repeat: expr
repeat-expr: _parent._parent.n_mesurands
calibration:
seq:
- id: len_tot
type: u4
- id: len_struct
type: u4
- id: len_name
type: u4
- id: len_comment
type: u4
- id: len_unit
type: u4
- id: si_unit
type: u8
- id: accuracy
type: f8
- id: function_id_and_dimensions
type: u8
- id: bias
type: f8
- id: scale
type: f8
- id: min_index
type: u8
- id: max_index
type: u8
- id: data_type
type: s4
enum: data_type
- id: len_author
type: u4
- id: name
type: str
encoding: utf-8
size: len_name
- id: comment
type: str
encoding: utf-8
size: len_comment
- id: unit
type: str
encoding: utf-8
size: len_unit
- id: author
type: str
encoding: utf-8
size: len_author
instances:
count:
-orig-id: nx, ny and nz
value: max_index - min_index + 1
fd_scanned:
seq:
- id: vars
type: vars
size: _parent.var_size
- id: orig_format
type: u4
doc: "s_oem"
if: false
- id: tune
type: u4
enum: lift_mode
doc: "z_tune"
if: false
- id: feedback_gain
type: f8
doc: "s_fbg"
if: false
- id: dac_scale
type: s4
doc: "s_s"
if: false
- id: overscan
type: s4
doc: "s_xov (in %)"
if: false
#Frame mode stuff
- id: fm_mode
type: u2
doc: "m_mode"
- id: fm_xres
type: u2
doc: "m_nx"
- id: fm_yres
type: u2
doc: "m_ny"
- id: dots
type: dots
- id: image
type: s2
repeat: expr
repeat-expr: fm_xres * fm_yres
#Stuff after data
- id: title
type: title
- id: xml
type: xml
types:
vars:
seq:
- id: x_scale
type: axis_scale
- id: y_scale
type: axis_scale
- id: z_scale
type: axis_scale
- id: channel_index
type: u1
enum: adc_mode
doc: "s_mode"
- id: mode
type: u1
enum: mode
doc: "s_dev"
- id: xres
type: u2
doc: "s_nx"
- id: yres
type: u2
doc: "s_ny"
- id: ndacq
type: u2
doc: "Step (DAC)"
- id: step_length
type: f4
doc: "s_rs in Angstrom's (Angstrom*gwy_get_gfloat_le(&p))"
- id: adt
type: u2
doc: "s_adt"
- id: adc_gain_amp_log10
type: u1
doc: "s_adc_a"
- id: adc_index
type: u1
doc: "ADC index"
#XXX: Some fields have different meaning in different versions
- id: input_signal_or_version
type: u1
doc: "MDTInputSignal smp_in; s_smp_in (for signal) s_8xx (for version)"
- id: substr_plane_order_or_pass_num
type: u1
doc: "s_spl or z_03"
- id: scan_dir
type: scan_dir
doc: "s_xy TODO: interpretation"
- id: power_of_2
type: u1
doc: "s_2n (bool)"
- id: velocity
type: f4 # frame->velocity = Angstrom*gwy_get_gfloat_le(&p);
doc: "s_vel (Angstrom/second)"
- id: setpoint
type: f4 # frame->setpoint = Nano*gwy_get_gfloat_le(&p);
doc: "s_i0"
- id: bias_voltage
type: f4 # frame->bias_voltage = gwy_get_gfloat_le(&p);
doc: "s_ut"
- id: draw
type: u1
doc: "s_draw (bool)"
- id: reserved
type: u1
- id: xoff
type: s4
doc: "s_x00 (in DAC quants)"
- id: yoff
type: s4
doc: "s_y00 (in DAC quants)"
- id: nl_corr
type: u1
doc: "s_cor (bool)"
dot:
seq:
- id: x
type: s2
- id: y
type: s2
scan_dir:
seq:
- id: unkn
type: b4
- id: double_pass
type: b1
- id: bottom
type: b1
doc: "Bottom - 1 Top - 0"
- id: left
type: b1
doc: "Left - 1 Right - 0"
- id: horizontal
type: b1
doc: "Horizontal - 1 Vertical - 0"
enums:
mode:
0: stm
1: afm
2: unknown2
3: unknown3
4: unknown4
input_signal:
0: extension_slot
1: bias_v
2: ground
lift_mode:
0: step
1: fine
2: slope
enums:
spm_technique:
0: contact_mode
1: semicontact_mode
2: tunnel_current
3: snom
data_type:
0: unknown0
'-1': int8
1: uint8
'-2': int16
2: uint16
'-4': int32
4: uint32
'-8': int64
8: uint64
'-5892': float32
'-9990': float48
'-13320': float64
'-16138': float80
'-65544': floatfix
xml_scan_location:
0: hlt
1: hlb
2: hrt
3: hrb
4: vlt
5: vlb
6: vrt
7: vrb
xml_param_type:
0: none
1: laser_wavelength
2: units
0xff: data_array
spm_mode:
0: constant_force
1: contact_constant_height
2: contact_error
3: lateral_force
4: force_modulation
5: spreading_resistance_imaging
6: semicontact_topography
7: semicontact_error
8: phase_contrast
9: ac_magnetic_force
10: dc_magnetic_force
11: electrostatic_force
12: capacitance_contrast
13: kelvin_probe
14: constant_current
15: barrier_height
16: constant_height
17: afam
18: contact_efm
19: shear_force_topography
20: sfom
21: contact_capacitance
22: snom_transmission
23: snom_reflection
24: snom_all
25: snom
adc_mode:
0xFF: off
0: height
1: dfl
2: lateral_f
3: bias_v
4: current
5: fb_out
6: mag
7: mag_sin #MAG*Sin
8: mag_cos #MAG*Cos
9: rms
10: calc_mag
11: phase1
12: phase2
13: calc_phase
14: ex1
15: ex2
16: hv_x
17: hv_y
18: snap_back
consts:
32: file_header_size
22: frame_header_size
8: frame_mode_size
30: axis_scales_size
77: scan_vars_min_size
38: spectro_vars_min_size
unit:
-10: raman_shift
-9: reserved0
-8: reserved1
-7: reserved2
-6: reserved3
-5: meter
-4: centi_meter
-3: milli_meter
-2: micro_meter
-1: nano_meter
0: angstrom
1: nano_ampere
2: volt
3: none
4: kilo_hertz
5: degrees
6: percent
7: celsius_degree # -orig-id: celsium_degree
8: volt_high
9: second
10: milli_second
11: micro_second
12: nano_second
13: counts
14: pixels
15: reserved_sfom0
16: reserved_sfom1
17: reserved_sfom2
18: reserved_sfom3
19: reserved_sfom4
20: ampere2
21: milli_ampere
22: micro_ampere
23: nano_ampere2
24: pico_ampere
25: volt2
26: milli_volt
27: micro_volt
28: nano_volt
29: pico_volt
30: newton
31: milli_newton
32: micro_newton
33: nano_newton
34: pico_newton
35: reserved_dos0
36: reserved_dos1
37: reserved_dos2
38: reserved_dos3
39: reserved_dos4