Dear Eike,
I use the following sed commands to edit CBF headers. In this case for merged CBFs to generate 1° frames for viewing (and sometimes processing):
sed -n '1,/_array_data.data/{/_array_data.data/q;s/Angle_increment 0.2000 /Angle_increment 1.0000 /;p}' $inp > $out
sed -n '/_array_data.data/,$'p $mrg >> $out
rm $inp
In the first line, only the part up to array_data (the ascii part) is considered for the edit. In the second line, the binary part from array_data onwards is copied. $inp is the input CBF, $out the output CBF. I use the sh shell, but have no idea whether this matters. So far, the resulting files are correctly read by all programs tested.
Best,
Herman
-----Ursprüngliche Nachricht-----
Von: CCP4 bulletin board [mailto:[log in to unmask]] Im Auftrag von Schulz, Eike-Christian
Gesendet: Sonntag, 10. Juli 2016 11:45
An: [log in to unmask]
Betreff: [ccp4bb] edit CBF file header
Dear all,
I am looking for a tool, which allows me to edit the header of CBF-files. In a large set of files (~175K) the beam-centre is put incorrectly and I would prefer a fairly automated way. I know that XDS et al. can correct for this but my problem is posed differently. I was considering a regular expression script but I suppose this would not work with the binary files … ?
Thanks a lot for your advice
Best regards
Eike
|