Deleting batch from mtz batch header via iotbx.mtz
Hi Folks, Is there a way to delete a batch from an mtz file batch header? Been trying to do this and it looks like it is impossible - though you can add batches. Clearly there is the worry that the subsequent batch column may then refer to a missing batch, however... it would be handy to be able to do this (providing that the reflections were also removed elsewhere in the calling code) Thanks, Graeme Dr. Graeme Winter Senior Software Scientist Diamond Light Source +44 1235 778091 (work) +44 7786 662784 (work mobile) -- 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
Hi Graeme, Is there a way to delete a batch from an mtz file batch header? Been trying
to do this and it looks like it is impossible – though you can add batches.
****
** **
Clearly there is the worry that the subsequent batch column may then refer to a missing batch, however…
Yes, I didn't wrap the entire CMTZ API (parts I wasn't sure are safe). My idea was that you simply make a new iotbx.mtz.object and copy only the batches you want. Patches welcome to add the delete support. Ralf
Hi Ralf, I tried creating a new mtz object and copying the batches in there, which worked just fine (though a copy constructor would not go amiss!) however I hit a blocker when I tried to add the reflections to the new mtz object as o.n_reflections() was 0 and (as far as I can see) cannot be changed from the Python API. Would it be possible to export this: /*! \brief Allocates memory for new_nref and fill all new data slots with "not-a-number" bit patterns. */ /*! Not available in Python. */ void adjust_column_array_sizes(int new_nref); To the Python API? I have not figured out yet where this should be done. Thanks, Graeme ________________________________ From: [email protected] [[email protected]] on behalf of Ralf Grosse-Kunstleve [[email protected]] Sent: 09 September 2011 19:36 To: cctbx mailing list Subject: Re: [cctbxbb] Deleting batch from mtz batch header via iotbx.mtz Hi Graeme, Is there a way to delete a batch from an mtz file batch header? Been trying to do this and it looks like it is impossible – though you can add batches. Clearly there is the worry that the subsequent batch column may then refer to a missing batch, however… Yes, I didn't wrap the entire CMTZ API (parts I wasn't sure are safe). My idea was that you simply make a new iotbx.mtz.object and copy only the batches you want. Patches welcome to add the delete support. Ralf -- 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
Hi Graeme,
object_bpl.cpp
in this case. -- In a meeting right now and up against a deadline... can you
figure it out from here?
Ralf
On Tue, Sep 27, 2011 at 1:31 AM,
Hi Ralf,
I tried creating a new mtz object and copying the batches in there, which worked just fine (though a copy constructor would not go amiss!) however I hit a blocker when I tried to add the reflections to the new mtz object as o.n_reflections() was 0 and (as far as I can see) cannot be changed from the Python API.
Would it be possible to export this:
/*! \brief Allocates memory for new_nref and fill all new data slots with "not-a-number" bit patterns. */ /*! Not available in Python. */ void adjust_column_array_sizes(int new_nref);
To the Python API? I have not figured out yet where this should be done.
Thanks,
Graeme
________________________________ From: [email protected] [[email protected]] on behalf of Ralf Grosse-Kunstleve [[email protected]] Sent: 09 September 2011 19:36 To: cctbx mailing list Subject: Re: [cctbxbb] Deleting batch from mtz batch header via iotbx.mtz
Hi Graeme,
Is there a way to delete a batch from an mtz file batch header? Been trying to do this and it looks like it is impossible – though you can add batches.
Clearly there is the worry that the subsequent batch column may then refer to a missing batch, however…
Yes, I didn't wrap the entire CMTZ API (parts I wasn't sure are safe). My idea was that you simply make a new iotbx.mtz.object and copy only the batches you want. Patches welcome to add the delete support.
Ralf
-- 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
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi Ralf,
OK, let's see what I can do with this - looks like this is the "bridge" I was looking for...
Assume I will figure it out! If I get really stuck I will get back to you, otherwise will send patch.
Thanks,
Graeme
From: [email protected] [mailto:[email protected]] On Behalf Of Ralf Grosse-Kunstleve
Sent: 27 September 2011 11:58
To: cctbx mailing list
Subject: Re: [cctbxbb] Deleting batch from mtz batch header via iotbx.mtz
Hi Graeme,
object_bpl.cpp
in this case. -- In a meeting right now and up against a deadline... can you figure it out from here?
Ralf
On Tue, Sep 27, 2011 at 1:31 AM,
Hi Ralf,
So I did this but it appears that it does not update the number of reflections anyway - I will need to find a different mechanism for this.
On a more positive note, making the change to object_bpl was trivial.
(investigations continue)
Thanks & best wishes,
Graeme
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: 27 September 2011 12:00
To: [email protected]
Subject: Re: [cctbxbb] Deleting batch from mtz batch header via iotbx.mtz
Hi Ralf,
OK, let's see what I can do with this - looks like this is the "bridge" I was looking for...
Assume I will figure it out! If I get really stuck I will get back to you, otherwise will send patch.
Thanks,
Graeme
From: [email protected] [mailto:[email protected]] On Behalf Of Ralf Grosse-Kunstleve
Sent: 27 September 2011 11:58
To: cctbx mailing list
Subject: Re: [cctbxbb] Deleting batch from mtz batch header via iotbx.mtz
Hi Graeme,
object_bpl.cpp
in this case. -- In a meeting right now and up against a deadline... can you figure it out from here?
Ralf
On Tue, Sep 27, 2011 at 1:31 AM,
participants (2)
-
Graeme.Winter@Diamond.ac.uk
-
Ralf Grosse-Kunstleve