# Class MSRdr

java.lang.Object
org.jmol.adapter.readers.cif.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, Legendre; 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 Summary

Fields
Modifier and Type
Field
Description
`protected int`
`commensurateSection1`
`protected AtomSetCollectionReader`
`cr`
`protected boolean`
`isCommensurate`
`protected boolean`
`modAverage`
`protected String`
`modAxes`
`protected int`
`modDim`

## Constructor Summary

Constructors
Constructor
Description
`MSRdr()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`addLatticeVector(Lst<float[]> lattvecs, String data)`
`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
`void`
`addSubsystem(String code, Matrix w)`
`void`
`finalizeModulation()`
Create a script that will run to turn modulation on and to display only atoms with modulated occupancy >= 0.5.
`XtalSymmetry.FileSymmetry`
`getAtomSymmetry(Atom a, XtalSymmetry.FileSymmetry defaultSymmetry)`
When applying symmetry, this method allows us to use a set of symmetry operators unique to this particular atom -- or in this case, to its subsystem.
`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.
`char`
`getModType(String key)`
`Map<String,double[]>`
`getModulationMap()`
`double[]`
`getQCoefs(String key)`
`XtalSymmetry.FileSymmetry`
`getSymmetryFromCode(String code)`
`int`
`initialize(AtomSetCollectionReader r, int modDim)`
`void`
`setMinMax0(P3 minXYZ, P3 maxXYZ)`
`protected void`
`setModDim(int ndim)`
`void`
`setModulation(boolean isPost, XtalSymmetry.FileSymmetry symmetry)`
Both the Jana reader and the CIF reader will call this to set the modulation for a given model.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### cr

protected AtomSetCollectionReader cr

### modDim

protected int modDim

### modAxes

protected String modAxes

### modAverage

protected boolean modAverage

### isCommensurate

protected boolean isCommensurate

### commensurateSection1

protected int commensurateSection1

## Constructor Details

### MSRdr

public MSRdr()

## Method Details

### initialize

public int initialize(AtomSetCollectionReader r, int modDim) throws Exception

Specified by:
  `initialize` in interface `MSInterface`
Throws:
  `Exception`

### 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` -

### setModulation

public void setModulation(boolean isPost, XtalSymmetry.FileSymmetry symmetry) throws Exception
Both the Jana reader and the CIF reader will call this to set the modulation for a given model.

Specified by:
  `setModulation` in interface `MSInterface`
Throws:
  `Exception`

### 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`

### 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

### getModulationMap

public Map<String,double[]> getModulationMap()

Specified by:
  `getModulationMap` in interface `MSInterface`

### getQCoefs

public double[] getQCoefs(String key)

Specified by:
  `getQCoefs` in interface `MSInterface`

### getModType

public char getModType(String key)

Specified by:
  `getModType` in interface `MSInterface`

### addSubsystem

public void addSubsystem(String code, Matrix w)

Specified by:
  `addSubsystem` in interface `MSInterface`

### getAtomSymmetry

public XtalSymmetry.FileSymmetry getAtomSymmetry(Atom a, XtalSymmetry.FileSymmetry defaultSymmetry)
When applying symmetry, this method allows us to use a set of symmetry operators unique to this particular atom -- or in this case, to its subsystem.

Specified by:
  `getAtomSymmetry` in interface `MSInterface`

### setMinMax0

public void setMinMax0(P3 minXYZ, P3 maxXYZ)

Specified by:
  `setMinMax0` in interface `MSInterface`

### getSymmetryFromCode

public XtalSymmetry.FileSymmetry getSymmetryFromCode(String code)

Specified by:
  `getSymmetryFromCode` in interface `MSInterface`

### addLatticeVector

public boolean addLatticeVector(Lst<float[]> lattvecs, String data) throws Exception

Specified by:
  `addLatticeVector` in interface `MSInterface`
Throws:
  `Exception`