Hi Anthony,
You can achieve this easily using the cctbx. I assume that your 3D grid of
floating points is a numpy array - if so you will have to convert this to a
cctbx "flex" array as shown in the simple example below. The cctbx can also has
the functionality to write out xplor maps - if needed I can dig out an example
for this too:
import numpy
from scitbx.array_family import flex
from iotbx.ccp4_map import write_ccp4_map
from cctbx import sgtbx
from cctbx import uctbx
a = numpy.random.rand(10,10,10)
b = flex.double(a.astype(numpy.float64))
write_ccp4_map(
file_name="random.map",
unit_cell=uctbx.unit_cell((1,1,1,90,90,90)),
space_group=sgtbx.space_group_info("P1").group(),
gridding_first=(0,0,0),
gridding_last=tuple(b.all()),
map_data=b,
labels=flex.std_string(["iotbx.ccp4_map.tst"]))
Cheers,
Richard
On 8 Oct 2013, at 10:32, Anthony Bradley
<[email protected]<mailto:[email protected]>>
wrote:
Hi all,
I would like to write CCP4 or .xplor maps of a potential field I have derived
myself.
I am using python and have a 3D grid of floating points. I would like to write
these out as a ccp4 or .xplor map.
Does anybody have any suggestions of functions that might be able to help me
with this?
Best wishes,
Anthony
--
This e-mail and any attachments may contain confidential, copyright and or
privileged material, and are for the use of the intended addressee only. If you
are not the intended addressee or an authorised recipient of the addressee
please notify us of receipt by returning the e-mail and do not use, copy,
retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not
necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments
are free from viruses and we cannot accept liability for any damage which you
may sustain as a result of software viruses which may be transmitted in or with
the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and
Wales with its registered office at Diamond House, Harwell Science and
Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom