Class MSRdr

  • All Implemented Interfaces:
    MSInterface
    Direct Known Subclasses:
    MSCifParser

    public class MSRdr
    extends Object
    implements MSInterface
    generalized modulated structure reader class for CIF and Jana -- includes Fourier, Crenel, Sawtooth; displacement, occupancy, and Uij -- handles up to 6 modulation wave vectors -- commensurate and incommensurate, including composites -- not handling _cell_commen_t_section_1
    Author:
    Bob Hanson hansonr@stolaf.edu
    • Field Detail

      • modDim

        protected int modDim
      • modAxes

        protected String modAxes
      • modAverage

        protected boolean modAverage
      • isCommensurate

        protected boolean isCommensurate
      • commensurateSection1

        protected int commensurateSection1
      • modPack

        private boolean modPack
      • modVib

        private boolean modVib
      • modType

        private String modType
      • modCell

        private String modCell
      • modDebug

        private boolean modDebug
      • modSelected

        private int modSelected
      • modLast

        private boolean modLast
      • sigma

        private javajs.util.Matrix sigma
      • htModulation

        private Map<String,​double[]> htModulation
      • iopLast

        private int iopLast
      • gammaE

        private javajs.util.M3 gammaE
      • nOps

        private int nOps
      • haveOccupancy

        private boolean haveOccupancy
      • atoms

        private Atom[] atoms
      • ac

        private int ac
      • haveAtomMods

        private boolean haveAtomMods
      • modCoord

        private boolean modCoord
      • finalized

        private boolean finalized
      • legendres

        private javajs.util.Lst<String> legendres
      • atModel

        private String atModel
      • modMatrices

        private javajs.util.Matrix[] modMatrices
      • qlist100

        private double[] qlist100
      • qs

        private javajs.util.P3[] qs
      • modCount

        private int modCount
      • modTUV

        private javajs.util.T3 modTUV
      • minXYZ0

        private javajs.util.P3 minXYZ0
      • maxXYZ0

        private javajs.util.P3 maxXYZ0
    • Constructor Detail

      • MSRdr

        public MSRdr()
    • Method Detail

      • getSigma

        javajs.util.Matrix getSigma()
      • setSubsystemOptions

        private void setSubsystemOptions()
      • setModDim

        protected void setModDim​(int ndim)
      • addModulation

        public void addModulation​(Map<String,​double[]> map,
                                  String id,
                                  double[] pt,
                                  int iModel)
        Types include O (occupation) D (displacement) U (anisotropy) M (magnetic moment) _coefs_ indicates this is a wave description
        Specified by:
        addModulation in interface MSInterface
        Parameters:
        map -
        id -
        pt -
        iModel -
      • finalizeModulation

        public void finalizeModulation()
        Create a script that will run to turn modulation on and to display only atoms with modulated occupancy ≥ 0.5.
        Specified by:
        finalizeModulation in interface MSInterface
      • checkKey

        private String checkKey​(String key,
                                boolean checkQ)
        Filter keys only for this model.
        Parameters:
        key -
        checkQ -
        Returns:
        trimmed key without model part or null
      • getMod

        public double[] getMod​(String key)
        Modulation data keys are keyed by model number as well as type using [at]n, where n is the model number, starting with 0.
        Specified by:
        getMod in interface MSInterface
        Parameters:
        key -
        Returns:
        modulation data
      • setModulationForStructure

        private void setModulationForStructure​(int iModel,
                                               boolean isPost)
                                        throws Exception
        Called when structure creation is complete and all modulation data has been collected.
        Parameters:
        iModel -
        isPost -
        Throws:
        Exception
      • initModForStructure

        private void initModForStructure​(int iModel)
                                  throws Exception
        Throws:
        Exception
      • fixLegendre

        private void fixLegendre()
      • fixDouble

        private void fixDouble​(double[] pt)
      • calculateQCoefs

        private double[] calculateQCoefs​(double[] p)
        determine simple linear combination assuming simple -3 to 3 no more than two dimensions.
        Parameters:
        p -
        Returns:
        {i j k}
      • approxInt

        private int approxInt​(float fn)
      • toP3

        private javajs.util.P3 toP3​(double[] x)
      • addAtomModulation

        private void addAtomModulation​(String atomName,
                                       char axis,
                                       char type,
                                       double[] params,
                                       String utens,
                                       double[] qcoefs)
        Create a list of modulations for each atom type (atom name).
        Parameters:
        atomName -
        axis -
        type -
        params -
        utens -
        qcoefs -
      • addUStr

        private void addUStr​(Atom atom,
                             String id,
                             float val)
      • modulateAtom

        private void modulateAtom​(Atom a)
        The displacement will be set as the atom vibration vector; the string buffer will be appended with the t value for a given unit cell. Modulation generally involves x4 = q.r + t. Here we arbitrarily set t = modT = 0, but modT could be a FILTER option MODT=n. There would need to be one modT per dimension or modU, modV.
        Parameters:
        a -
      • getAtomR0

        private javajs.util.P3 getAtomR0​(Atom atom)
      • setSubsystem

        private void setSubsystem​(String code,
                                  Subsystem system)
      • getMatrices

        private javajs.util.Matrix[] getMatrices​(Atom a)
      • setMinMax0

        public void setMinMax0​(javajs.util.P3 minXYZ,
                               javajs.util.P3 maxXYZ)
        Specified by:
        setMinMax0 in interface MSInterface
      • expandMinMax

        private void expandMinMax​(javajs.util.P3 pt,
                                  SymmetryInterface sym,
                                  javajs.util.P3 minXYZ,
                                  javajs.util.P3 maxXYZ)
      • trimAtomSet

        private void trimAtomSet()