[cctbxbb] Adding columns to new *unmerged* MTZ object

Graeme.Winter at diamond.ac.uk Graeme.Winter at diamond.ac.uk
Wed Feb 12 02:43:48 PST 2014


In related news….

Should

  void
  object::adjust_column_array_sizes(int new_nref)
  {
    CMtz::MTZ* p = ptr();
    if (!p->refs_in_memory) return;
    if (new_nref > p->nref) {
      reserve(new_nref);
      for(int i=0;i<p->nxtal;i++) {
        for(int j=0;j<p->xtal[i]->nset;j++) {
          for(int k=0;k<p->xtal[i]->set[j]->ncol;k++) {
            CMtz::MTZCOL* col_k = p->xtal[i]->set[j]->col[k];
            int old_size = column_array_size(col_k);
            if (new_nref > old_size) {
              ccp4array_resize(col_k->ref, new_nref);
              for(int iref=old_size;iref<new_nref;iref++) {
                *(reinterpret_cast<union float_uint_uchar*>(
                  &col_k->ref[iref])) = not_a_number_value_;
              }
            }
          }
        }
      }
    }
  }

assign nref? otherwise repeated calling of this will keep on re-allocating the arrays

Thanks Graeme


On 12 Feb 2014, at 10:40, Graeme Winter <graeme.winter at diamond.ac.uk> wrote:

> All,
> 
> By adding 
> 
>  m_out.adjust_column_array_sizes(len(mi))
> 
> to the bpl  wrapper and defining 
> 
>  m_out.set_n_reflections(len(mi))
> 
> in the object.h and bpl wrapper I can do what I want…
> 
> I will add some tests and some warnings that this may make nonsense of the values… however before committing any comments on the interface? or behaviour?
> 
> Thanks Graeme
> 
> 
> 
> On 12 Feb 2014, at 09:11, <Graeme.Winter at diamond.ac.uk> <Graeme.Winter at diamond.ac.uk> wrote:
> 
>> Hi Folks,
>> 
>> I am trying to create a new MTZ file containing unmerged and it seems to be less simple than I would think - set_reals() on a column requires a set of Miller indices and values and does a lookup internally (which I don’t want for unmerged values) and set_values() requires that the array is already the right size - when it starts off as size 0 and I have no idea how to make enough room in there from the Python API…
>> 
>> Any clues? I have done quite a chunk of grepping around to try and figure this one out and have run out of ideas…
>> 
>> Thanks Graeme_______________________________________________
>> cctbxbb mailing list
>> cctbxbb at phenix-online.org
>> http://phenix-online.org/mailman/listinfo/cctbxbb
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2017 bytes
Desc: not available
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20140212/970b729c/attachment.p7s>


More information about the cctbxbb mailing list