use of ffx.crystal.HKL in project ffx by mjschnie.
the class FormFactorTest method testCarbonfrho.
@Test
public void testCarbonfrho() {
HKL hkl = new HKL(1, 1, 1);
assertEquals("carbon (1 1 1) structure factor should be correct", 2.3986e-26, carbonFormFactor.f(hkl), 1e-30);
double[] xyz = { 1.0, 1.0, 1.0 };
assertEquals("carbon (1 1 1) electron density should be correct", 0.081937, carbonFormFactor.rho(0.0, 1.0, xyz), 0.000001);
}
use of ffx.crystal.HKL in project ffx by mjschnie.
the class CIFFilterTest method testCIFFilter2DRM.
@Test
public void testCIFFilter2DRM() {
String filename = "ffx/xray/structures/2DRM.cif";
ClassLoader cl = this.getClass().getClassLoader();
File cifFile = new File(cl.getResource(filename).getPath());
// load any properties associated with it
CompositeConfiguration properties = Keyword.loadProperties(cifFile);
CIFFilter cifFilter = new CIFFilter();
ReflectionList reflectionList = cifFilter.getReflectionList(cifFile);
assertNull(" Reflection list should be null", reflectionList);
Crystal crystal = new Crystal(29.969, 37.861, 44.506, 90.28, 90.11, 90.64, "P1");
Resolution resolution = new Resolution(1.30);
reflectionList = new ReflectionList(crystal, resolution);
DiffractionRefinementData refinementData = new DiffractionRefinementData(properties, reflectionList);
assertTrue(" CIF data not read correctly", cifFilter.readFile(cifFile, reflectionList, refinementData, properties));
HKL hkl = reflectionList.getHKL(-21, -6, 7);
assertEquals("-21 -6 7 F", 18.6, refinementData.getF(hkl.index()), 0.01);
assertEquals("-21 -6 7 sigF", 3.6, refinementData.getSigF(hkl.index()), 0.01);
assertEquals("-21 -6 7 freeR value", 0, refinementData.freer[hkl.index()]);
hkl = reflectionList.getHKL(-21, -6, 8);
assertEquals("-21 -6 7 F", 20.2, refinementData.getF(hkl.index()), 0.01);
assertEquals("-21 -6 7 sigF", 5.0, refinementData.getSigF(hkl.index()), 0.01);
assertEquals("-21 -6 7 freeR value", 1, refinementData.freer[hkl.index()]);
}
Aggregations