--- clipper-2.1.20130601/clipper/cif/cif_data_io.cpp 2012-03-07 03:59:51.000000000 -0800 +++ clipper-2.1-fixup/clipper/cif/cif_data_io.cpp 2012-07-16 07:18:48.000000000 -0700 @@ -66,8 +66,7 @@ { mode = NONE; - // Argh, bug. It's things like this that make me dislike object - // oriented programming - "Magic happens behind your back". The + // The // problem was that we were trying to import into f_phi_i in // close_read() when f_phi_i had not been initialised by calling // import_hkl_data for it (because it comes from a function that @@ -80,7 +79,11 @@ f_sigf_i = NULL; f_phi_i = NULL; rfree_i = NULL; - + d_sigd_i = NULL; + ABCD_i = NULL; + I_sigI_i = NULL; + f_sigf_ano_i = NULL; + // set these when we find them.... clipper_cell_set_flag = 0; clipper_reso_set_flag = 0; @@ -184,9 +187,13 @@ Message::message( Message_fatal( "CIFfile: no file open for read" ) ); // make sure the data list is sized - if ( f_sigf_i != NULL ) f_sigf_i->update(); - if ( f_phi_i != NULL ) f_phi_i->update(); - if ( rfree_i != NULL ) rfree_i->update(); + if ( f_sigf_i != NULL ) f_sigf_i->update(); + if ( f_phi_i != NULL ) f_phi_i->update(); + if ( rfree_i != NULL ) rfree_i->update(); + if ( d_sigd_i != NULL ) d_sigd_i->update(); + if ( ABCD_i != NULL ) ABCD_i->update(); + if ( I_sigI_i != NULL ) I_sigI_i->update(); + if ( f_sigf_ano_i != NULL ) f_sigf_ano_i->update(); int ret_val = 0; int n_calc_data = 0; @@ -288,29 +295,32 @@ } // RFree flag - char *s = mmCIFLoop->GetString("status", j, ierr_rfree_flag); - if (! ierr_rfree_flag) { - x1[0] = -1; - if (s) { - // std::cout << "read status :" << s << ":" << std::endl; - if (strncmp(s, "o", 1)) { - x1[0] = 1; - } else { - if (strncmp(s, "f", 1)) { - x1[0] = 0; + if (rfree_i) { + char *s = mmCIFLoop->GetString("status", j, ierr_rfree_flag); + if (! ierr_rfree_flag) { + x1[0] = -1; + if (s) { + // std::cout << "read status :" << s << ":" << std::endl; + // could be also "x"; not observed, just listed + if (! strncmp(s, "o", 1)) { + x1[0] = 1; + } else { + if (! strncmp(s, "f", 1)) { + x1[0] = 0; + } } } + // + // Every output reflection gets one of these, even if + // it is set to -1. Is that the correct thing to do? + // I have looked at over 200 recent sf mmCIFs and if + // the contain conventional data then they all have + // the status flag. + // + // However, SFS from EM data do not + // + rfree_i->data_import( HKL(h,k,l), x1); } - // - // Every output reflection gets one of these, even if - // it is set to -1. Is that the correct thing to do? - // I have looked at over 200 recent sf mmCIFs and if - // the contain conventional data then they all have - // the status flag. - // - // However, SFS from EM data do not - // - rfree_i->data_import( HKL(h,k,l), x1); }