Skip to content

reading ccp4 maps with extended header #8

@wojdyr

Description

@wojdyr

the code assumes that the data start after 1024-byte header, but ccp4 map may have also "extended header" of the length determined by:

NSYMBT size of extended header (which follows main header) in bytes

Coot (File > Export Map) writes ccp4 map with such a header.
Here is quick and dirty fix that works assuming that NSYMBT is divisible by 4.

--- a/js/xtal.js
+++ b/js/xtal.js
@@ -287,7 +287,7 @@ function Map () {
     ];
     this.data = new GridArray(this.n_real, this.n_grid, this.origin);
     var i_crs = [0,0,0];
-    var idx = 256;
+    var idx = 256 + mapdata[23]/4;
     var section_size = n_crs[0] * n_crs[1];
     var array_buffer = new ArrayBuffer(4);
     var intData = new Int32Array(array_buffer);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions