xref: /freebsd/contrib/file/magic/Magdir/scientific (revision 898496ee)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*898496eeSXin LI# $File: scientific,v 1.14 2023/04/29 17:28:09 christos Exp $
4b6cee71dSXin LI# scientific:  file(1) magic for scientific formats
5b6cee71dSXin LI#
6b6cee71dSXin LI# From: Joe Krahn <krahn@niehs.nih.gov>
7b6cee71dSXin LI
8b6cee71dSXin LI########################################################
9b6cee71dSXin LI# CCP4 data and plot files:
10b6cee71dSXin LI0	string		MTZ\040		MTZ reflection file
11b6cee71dSXin LI
12b6cee71dSXin LI92	string		PLOT%%84	Plot84 plotting file
13b6cee71dSXin LI>52	byte		1		, Little-endian
14b6cee71dSXin LI>55	byte		1		, Big-endian
15b6cee71dSXin LI
16b6cee71dSXin LI########################################################
17b6cee71dSXin LI# Electron density MAP/MASK formats
18b6cee71dSXin LI
19b6cee71dSXin LI0	string		EZD_MAP	NEWEZD Electron Density Map
20b6cee71dSXin LI109	string		MAP\040(  Old EZD Electron Density Map
21b6cee71dSXin LI
22b6cee71dSXin LI0	string/c	:-)\040Origin	BRIX Electron Density Map
23b6cee71dSXin LI>170	string		>0	, Sigma:%.12s
24b6cee71dSXin LI#>4	string		>0	%.178s
25b6cee71dSXin LI#>4	addr		x	%.178s
26b6cee71dSXin LI
27b6cee71dSXin LI7	string		18\040!NTITLE	XPLOR ASCII Electron Density Map
28b6cee71dSXin LI9	string		\040!NTITLE\012\040REMARK	CNS ASCII electron density map
29b6cee71dSXin LI
30b6cee71dSXin LI208	string		MAP\040	CCP4 Electron Density Map
31b6cee71dSXin LI# Assumes same stamp for float and double (normal case)
32b6cee71dSXin LI>212	byte		17	\b, Big-endian
33b6cee71dSXin LI>212	byte		34	\b, VAX format
34b6cee71dSXin LI>212	byte		68	\b, Little-endian
35b6cee71dSXin LI>212	byte		85	\b, Convex native
36b6cee71dSXin LI
37b6cee71dSXin LI############################################################
38b6cee71dSXin LI# X-Ray Area Detector images
39b6cee71dSXin LI0	string	R-AXIS4\ \ \ 	R-Axis Area Detector Image:
40b6cee71dSXin LI>796	lelong	<20		Little-endian, IP #%d,
41b6cee71dSXin LI>>768	lelong	>0		Size=%dx
42b6cee71dSXin LI>>772	lelong	>0		\b%d
43b6cee71dSXin LI>796	belong	<20		Big-endian, IP #%d,
44b6cee71dSXin LI>>768	belong	>0		Size=%dx
45b6cee71dSXin LI>>772	belong	>0		\b%d
46b6cee71dSXin LI
47b6cee71dSXin LI0	string	RAXIS\ \ \ \ \ 	R-Axis Area Detector Image, Win32:
48b6cee71dSXin LI>796	lelong	<20		Little-endian, IP #%d,
49b6cee71dSXin LI>>768	lelong	>0		Size=%dx
50b6cee71dSXin LI>>772	lelong	>0		\b%d
51b6cee71dSXin LI>796	belong	<20		Big-endian, IP #%d,
52b6cee71dSXin LI>>768	belong	>0		Size=%dx
53b6cee71dSXin LI>>772	belong	>0		\b%d
54b6cee71dSXin LI
55b6cee71dSXin LI
56b6cee71dSXin LI1028	string	MMX\000\000\000\000\000\000\000\000\000\000\000\000\000	MAR Area Detector Image,
57b6cee71dSXin LI>1072	ulong	>1		Compressed(%d),
58b6cee71dSXin LI>1100	ulong	>1		%d headers,
59b6cee71dSXin LI>1104	ulong	>0		%d x
60b6cee71dSXin LI>1108	ulong	>0		%d,
61b6cee71dSXin LI>1120	ulong	>0		%d bits/pixel
62b6cee71dSXin LI
63b6cee71dSXin LI# Type: GEDCOM genealogical (family history) data
64b6cee71dSXin LI# From: Giuseppe Bilotta
65*898496eeSXin LI# Update:	Joerg Jenderek
66*898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/GEDCOM
67*898496eeSXin LI#		https://en.wikipedia.org/wiki/GEDCOM
68*898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/g/
69*898496eeSXin LI#		ged.trid.xml ged-utf8.trid.xml ged-utf16.trid.xml
70*898496eeSXin LI# Note:		called "GEDCOM Family History" by TrID and "Genealogical Data Communication (GEDCOM) Format" by DROID via PUID fmt/851
71b6cee71dSXin LI0       search/1/c	0\ HEAD         GEDCOM genealogy text
72*898496eeSXin LI#!:mime	text/plain
73*898496eeSXin LI#!:mime	application/x-gedcom
74*898496eeSXin LI# https://www.iana.org/assignments/media-types/text/vnd.familysearch.gedcom
75*898496eeSXin LI!:mime	text/vnd.familysearch.gedcom
76*898496eeSXin LI!:ext	ged
77*898496eeSXin LI# no gedcom sample found and ged suffix also used for other formats
78*898496eeSXin LI#!:ext	ged/gedcom
79b6cee71dSXin LI>&0     search		1\ GEDC
80b6cee71dSXin LI>>&0    search		2\ VERS         version
81*898496eeSXin LI# 4 5.0 5.3 5.4 5.5 5.5.1 5.5.5 5.6 7.0 or no version
82b6cee71dSXin LI>>>&1   string		>\0		%s
83b6cee71dSXin LI# From: Phil Endecott <phil05@chezphil.org>
84*898496eeSXin LI# 0\040HEAD as UTF-16 big endian without BOM
85*898496eeSXin LI0	string	\000\060\000\040\000\110\000\105\000\101\000\104		GEDCOM genealogy text
86*898496eeSXin LI!:mime	text/vnd.familysearch.gedcom
87*898496eeSXin LI!:ext	ged
88*898496eeSXin LI# look for VERS tag encoded as UTF-16 big endian
89*898496eeSXin LI>12		search/0x65	V\0E\0R\0S					version
90*898496eeSXin LI# version like: 5.5.1
91*898496eeSXin LI>>&2		bestring16	x						%s
92*898496eeSXin LI>>0		string		x						\b, UTF-16 (without BOM) big-endian text
93*898496eeSXin LI# 0\040HEAD as UTF-16 little endian without BOM
94*898496eeSXin LI0	string	\060\000\040\000\110\000\105\000\101\000\104\000		GEDCOM genealogy text
95*898496eeSXin LI!:mime	text/vnd.familysearch.gedcom
96*898496eeSXin LI!:ext	ged
97*898496eeSXin LI# look for VERS tag encoded as UTF-16 lttle endian
98*898496eeSXin LI>12		search/0x65	V\0E\0R\0S					version
99*898496eeSXin LI# version like: 5.5.1
100*898496eeSXin LI>>&3		lestring16	x						%s
101*898496eeSXin LI>>2		string		x						\b, UTF-16 (without BOM) little-endian text
102*898496eeSXin LI# Note:		UTF-16 with BOM variants already described above by first test as "GEDCOM genealogy text"
103*898496eeSXin LI# 0\040HEAD as UTF-16 big endian with BOM
104*898496eeSXin LI#0	string	\376\377\000\060\000\040\000\110\000\105\000\101\000\104	GEDCOM data
105*898496eeSXin LI# 0\040HEAD as UTF-16 little endian with BOM
106*898496eeSXin LI#0	string	\377\376\060\000\040\000\110\000\105\000\101\000\104\000	GEDCOM data
107b6cee71dSXin LI
108b6cee71dSXin LI# PDB: Protein Data Bank files
109b6cee71dSXin LI# Adam Buchbinder <adam.buchbinder@gmail.com>
110b6cee71dSXin LI#
11148c779cdSXin LI# https://www.wwpdb.org/documentation/format32/sect2.html
11248c779cdSXin LI# https://www.ch.ic.ac.uk/chemime/
113b6cee71dSXin LI#
114b6cee71dSXin LI# The PDB file format is fixed-field, 80 columns. From the spec:
115b6cee71dSXin LI#
116b6cee71dSXin LI# COLS        DATA
117b6cee71dSXin LI#  1 -  6      "HEADER"
118b6cee71dSXin LI#  11 - 50     String(40)
119b6cee71dSXin LI#  51 - 59     Date
120b6cee71dSXin LI#  63 - 66     IDcode
121b6cee71dSXin LI#
122b6cee71dSXin LI# Thus, positions 7-10, 60-62 and 67-80 are spaces. The Date must be in the
123b6cee71dSXin LI# format DD-MMM-YY, e.g., 01-JAN-70, and the IDcode consists of numbers and
124b6cee71dSXin LI# uppercase letters. However, examples have been seen without the date string,
125b6cee71dSXin LI# e.g., the example on the chemime site.
12640427ccaSGordon Tetlow0	string	HEADER\ \ \ \040
127b6cee71dSXin LI>&0	regex/1l	\^.{40}
128b6cee71dSXin LI>>&0	regex/1l	[0-9]{2}-[A-Z]{3}-[0-9]{2}\ {3}
129b6cee71dSXin LI>>>&0	regex/1ls	[A-Z0-9]{4}.{14}$
130b6cee71dSXin LI>>>>&0	regex/1l	[A-Z0-9]{4}	Protein Data Bank data, ID Code %s
131b6cee71dSXin LI!:mime	chemical/x-pdb
132b6cee71dSXin LI>>>>0	regex/1l	[0-9]{2}-[A-Z]{3}-[0-9]{2}	\b, %s
133b6cee71dSXin LI
134b6cee71dSXin LI# Type:	GDSII Stream file
135b6cee71dSXin LI0	belong	0x00060002	GDSII Stream file
136b6cee71dSXin LI>4	byte	0x00
137b6cee71dSXin LI>>5	byte	x		version %d.0
138b6cee71dSXin LI>4	byte	>0x00		version %d
139b6cee71dSXin LI>>5	byte	x		\b.%d
1409ce06829SXin LI
1419ce06829SXin LI# Type: LXT (interLaced eXtensible Trace)
1429ce06829SXin LI# chrysn <chrysn@fsfe.org>
1439ce06829SXin LI0	beshort	0x0138	interLaced eXtensible Trace (LXT) file
1449ce06829SXin LI>2	beshort	>0	(Version %u)
145