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