[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ccp4bb]: Big Endian vs Little Endian for CCP4 Map Files
*** For details on how to be removed from this list visit the ***
*** CCP4 home page http://www.ccp4.ac.uk ***
On Sun, 27 Oct 2002, Ashwin.Padmanabhan wrote:
> Am facing a problem as with reading the map file generated by the FFT
> program. Neither my code or the Swiss PDB viewer is able to read the CCP4
> map format generated by the FFT program. Apparently the Map file generated
> is of the Little Endian format while my code or Swiss PDB expect Big Endian
> formats. Is there a field in the CCP4 file which tells me whether the file
> is in Little Endian or Big Endian. I have come across both kinds. Any
> suggestions as to how to address this problem??
Yes, there is a field in the file header which specifies Big-endian vs.
Little-endian. I take it "your code" does not use the CCP4 subroutine
libraries to read the map file? Endian recognition should be automatic.
You can read about this in $CDOC/libfft.doc and find the subroutines in
$CLIBS/maplib.f
One solution would be to run a genuine CCP4 program on the map file on the
target machine, to force output to the appropriate endian-ness. Something
like MAPMASK or EXTEND might do it. A CCP4 program reading a map should
recognize and read the Endian-ness of the input map, and should write the
output map in the native mode of the machine you're running on.
cheers,
=======================================================================
"Being a true scientist, Ralph wanted to make his own dangerous experiments."
- Hugo Gernsback
=======================================================================
David J. Schuller
modern man in a post-modern world
MacCHESS, Cornell University
djs63@cornell.edu