CIF import/export parent class for clipper objects. More...
#include <cif_data_io.h>
Public Member Functions | |
CIFfile () | |
Constructor: does nothing. | |
~CIFfile () | |
Destructor: close any file that was left open. | |
void | open_read (const String filename_in) |
Open a file for read access. | |
void | close_read () |
Close a file after reading. | |
const Spacegroup & | spacegroup () const |
get file spacegroup | |
const Cell & | cell () const |
get file cell | |
const Resolution & | resolution () const |
get file resolution | |
const HKL_sampling & | hkl_sampling () const |
get file HKL sampling | |
Resolution | resolution (const Cell &cell) const |
get file resolution | |
void | import_hkl_info (HKL_info &target) |
read the reflection list from the PHS file | |
void | import_hkl_data (HKL_data_base &cdata) |
mark a hkl_data for import from PHS file | |
bool | contains_phases_p () const |
contains phases predicate |
CIF import/export parent class for clipper objects.
This is the import class which can be linked to an cif data file and be used to transfer data into a Clipper data structure. It is currently a read-only class.
clipper::CIFfile::CIFfile | ( | ) |
Constructor: does nothing.
Constructing an CIFfile does nothing except flag the object as not attached to any file for either input or output
clipper::CIFfile::~CIFfile | ( | ) |
Destructor: close any file that was left open.
Close any files which were left open. This is particularly important since to access the CIF file efficiently, data reads and writes are deferred until the file is closed.
References close_read().
void clipper::CIFfile::open_read | ( | const String | filename_in | ) |
Open a file for read access.
The file is opened for reading. This CIFfile object will remain attached to this file until it is closed. Until that occurs, no other file may be opened with this object, however another CIFfile object could be used to access another file.
filename_in | The input filename or pathname. |
References clipper::message, and resolution().
void clipper::CIFfile::close_read | ( | ) |
Close a file after reading.
Close the file after reading. This command also actually fills in the data in any HKL_data structures which have been marked for import.
Note that we attempt to read in calculated structure factors too. These rely on the tags "F_calc" or "F_calc_au" and "phase_calc".
http://pdb.rutgers.edu/mmcif/dictionaries/cif_mm.dic/Categories/refln.html
It is quite usual then for the HKL_data vector of type F_sigF to have a different size to the HKL_data for the F_phi's (often this will be zero). I hope that this will not be a problem.
We test for f_phi_i being non-null before we import data into it - CIFfiles can be used with or without reading calculated phases.
Note to self: how about we make a function of a CIFfile that says whether or not it contains phases...
Note to self: this text need to be properly marked up in doxygen format.
References clipper::Util::d2rad(), clipper::HKL_data_base::data_import(), clipper::HKL_data_base::is_null(), clipper::message, and clipper::HKL_data_base::update().
Referenced by ~CIFfile().
const Spacegroup & clipper::CIFfile::spacegroup | ( | ) | const |
get file spacegroup
Get the spacegroup from the MTZ file.
const Cell & clipper::CIFfile::cell | ( | ) | const |
get file cell
Get the base cell from the MTZ file.
const Resolution & clipper::CIFfile::resolution | ( | ) | const |
get file resolution
Get the resolution limit from the MTZ file.
Referenced by open_read().
const HKL_sampling & clipper::CIFfile::hkl_sampling | ( | ) | const |
Resolution clipper::CIFfile::resolution | ( | const Cell & | cell | ) | const |
get file resolution
Get the resolution limit from the CIF file. Since a CIF file does not contain cell information, a Cell object must be supplied, which will be used to determine the resultion. The result is the resolution determined by the most extreme reflection in the file.
References clipper::HKL::invresolsq(), clipper::Util::max(), and clipper::message.
void clipper::CIFfile::import_hkl_info | ( | HKL_info & | target | ) |
read the reflection list from the PHS file
Import the list of reflection HKLs from an CIF file into an HKL_info object. At the start of the routine try to determine the space group, cell and resolution. If the resolution limit was found and if the resolution limit of the HKL_info object is lower than the limit of the file, any excess reflections will be rejected, as will any systematic absences or duplicates. If the resolution is not found then the resolution will be determined from the input hkl data and target will be init()ed before returning from this function.
target | The HKL_info object to be initialised. |
References clipper::HKL_info::add_hkl_list(), clipper::HKL_info::cell(), clipper::HKL_info::init(), clipper::Resolution::init(), clipper::HKL::invresolsq(), clipper::Resolution::invresolsq_limit(), clipper::Resolution::limit(), clipper::message, and clipper::HKL_info::resolution().
void clipper::CIFfile::import_hkl_data | ( | HKL_data_base & | cdata | ) |
mark a hkl_data for import from PHS file
Import data from an CIF file into an HKL_data object.
This routine does not actually read any data, but rather marks the data to be read when the file is closed.
The data to be read (F_sigF or Phi_fom) will be selected based on the type of the HKL_data object.
cdata | The HKL_data object into which data is to be imported. |
References clipper::HKL_data_base::init(), clipper::HKL_data_base::is_null(), clipper::message, clipper::datatypes::F_phi< dtype >::type(), clipper::datatypes::F_sigF< dtype >::type(), and clipper::HKL_data_base::type().