scientific 5.0 KB

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