Search in sources :

Example 26 with HKL

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);
}
Also used : HKL(ffx.crystal.HKL) Test(org.junit.Test)

Example 27 with HKL

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()]);
}
Also used : CompositeConfiguration(org.apache.commons.configuration.CompositeConfiguration) HKL(ffx.crystal.HKL) DiffractionRefinementData(ffx.xray.DiffractionRefinementData) ReflectionList(ffx.crystal.ReflectionList) File(java.io.File) Crystal(ffx.crystal.Crystal) Resolution(ffx.crystal.Resolution) Test(org.junit.Test)

Aggregations

HKL (ffx.crystal.HKL)27 ComplexNumber (ffx.numerics.ComplexNumber)8 IOException (java.io.IOException)6 Test (org.junit.Test)6 ReflectionSpline (ffx.crystal.ReflectionSpline)5 ReflectionList (ffx.crystal.ReflectionList)4 BufferedReader (java.io.BufferedReader)4 File (java.io.File)4 FileReader (java.io.FileReader)4 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)4 Crystal (ffx.crystal.Crystal)3 Resolution (ffx.crystal.Resolution)3 ByteBuffer (java.nio.ByteBuffer)3 ByteOrder (java.nio.ByteOrder)3 ParallelTeam (edu.rit.pj.ParallelTeam)2 SymOp (ffx.crystal.SymOp)2 ForceFieldEnergy (ffx.potential.ForceFieldEnergy)2 MolecularAssembly (ffx.potential.MolecularAssembly)2 Atom (ffx.potential.bonded.Atom)2 DiffractionRefinementData (ffx.xray.DiffractionRefinementData)2