Browse Source

cif2bcif tweak

David Sehnal 6 years ago
parent
commit
2c50dc76ba
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/apps/cif2bcif/field-classifier.ts

+ 3 - 0
src/apps/cif2bcif/field-classifier.ts

@@ -146,6 +146,9 @@ namespace FloatClassifier {
     }
 
     export function classify(data: number[], name: string) {
+        // if a vector/matrix, do not reduce precision
+        if (name.indexOf('[') > 0) return { encoder: E.by(E.byteArray), typedArray: Float64Array };
+
         let dc = 10;
         for (let i = 0, n = data.length; i < n; i++) dc = Math.max(dc, digitCount(data[i]));