Re: [ccp4bb] How do I read a CCP4 map header?

2012-07-02 Thread David Waterman
Hi Alex Out of the possible issues I suggested earlier I suspect most strongly you have sizeof(long) != 4. But Ian is indeed right to promote the canonical answer. Avoid such mess by using the API ;-) -- David On 2 July 2012 15:48, Ian Tickle wrote: > Hi Alex > > Wouldn't you be better off u

Re: [ccp4bb] How do I read a CCP4 map header?

2012-07-02 Thread Ian Tickle
Hi Alex Wouldn't you be better off using the API (http://www.ccp4.ac.uk/dist/html/C_library/cmaplib_8h.html): that way your program will have a good chance of still working in another 10 years' time! Cheers -- Ian On 2 July 2012 14:41, Soares, Alexei wrote: > Hello, Alex here. > > Ten years ag

Re: [ccp4bb] How do I read a CCP4 map header?

2012-07-02 Thread David Waterman
Hi Alex, The map header is binary, not text, which explains the junk you saw in your terminal. One thing to be careful of is where the map file came from. The map format doesn't specify the byte order written to disk, so your reading routine has to identify whether it was written by a little- or b

[ccp4bb] How do I read a CCP4 map header?

2012-07-02 Thread Soares, Alexei
Hello, Alex here. Ten years ago, I read CCP4 maps this way, but it no longer works ... can anyone tell me why? Note that map1 is an integer so that multiple headers can be read. Also, supposedly the map header is text, but a simple "head -1" dumps lots of digital garbage from the map header.