Skip to content

DiffractionGrating

Bases: OpticalAperture_Type

Represents the XML element DiffractionGrating.

A Diffraction Grating is an optical component with a periodic structure that splits and diffracts light into several beams travelling in different directions.

fromBase(base) staticmethod

Cast a NBOBaseClass to a CMOS.

Parameters:

Name Type Description Default
base NBOBaseClass

The base class to cast

required

Returns:

Type Description
DiffractionGrating

The casted element, or nullptr if the cast fails

getTypeName()

Returns the class type name.

Returns:

Type Description
string

The class type name

getXMLName()

Returns the XML element name corresponding to this class.

Returns:

Type Description
string

The XML element name

getNBOType()

Returns the NBO Type corresponding to this class.

Returns:

Type Description
int

The NBO Type value

getChildren()

Returns a list of all classes derived from this class.

Returns:

Type Description
List[NBOBaseClass]

The list of derived classes

getSubElements()

Returns a list of all child elements contained in this class.

Returns:

Type Description
List[NBOBaseClass]

The list of child classes

fromJsonFile(path, validate=True)

Populates this object from a JSON file.

Parameters:

Name Type Description Default
path string

The path to the JSON file

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

fromJsonString(json_string, validate=True)

Populates this object from a JSON string.

Parameters:

Name Type Description Default
json_string string

The JSON content as a string

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

fromXmlFile(path, validate=True)

Populates this object from a XML file.

Parameters:

Name Type Description Default
path string

The path to the XML file

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

fromXmlString(xml_string, validate=True)

Populates this object from a XML string.

Parameters:

Name Type Description Default
xml_string string

The XML content as a string

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

toXmlFile(filename, validate=True)

Serializes this object to an XML file.

Parameters:

Name Type Description Default
filename string

The path to the output XML file

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

toXmlString(validate=True)

Serializes this object to an XML string.

Parameters:

Name Type Description Default
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

Returns:

Type Description
string

A string containing the XML representation of this object

setPeriod(value, validate=True)

Sets the value of the Period attribute.

This field records the spacing between the centers of two adjacent slits (d).

Parameters:

Name Type Description Default
value float

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getPeriod()

Returns the value of the Period attribute.

This field records the spacing between the centers of two adjacent slits (d).

Returns:

Type Description
float

The value of the attribute

resetPeriod()

Resets the Period attribute to an unset state.

This field records the spacing between the centers of two adjacent slits (d).

hasPeriod()

Checks whether the Period attribute is present.

This field records the spacing between the centers of two adjacent slits (d).

Returns:

Type Description
boolean

true if the attribute has been set, false otherwise

setPeriodUnit(value, validate=True)

Sets the value of the PeriodUnit attribute.

No description available in the XSD standard.

Parameters:

Name Type Description Default
value UnitsLength_Type

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getPeriodUnit()

Returns the value of the PeriodUnit attribute.

No description available in the XSD standard.

Returns:

Type Description
UnitsLength_Type

The value of the attribute

resetPeriodUnit()

Resets the PeriodUnit attribute to an unset state.

No description available in the XSD standard.

hasPeriodUnit()

Checks whether the optional PeriodUnit attribute is present.

No description available in the XSD standard.

Returns:

Type Description
boolean

true if the optional attribute has been set, false otherwise

setSpatialFrequency(value, validate=True)

Sets the value of the SpatialFrequency attribute.

This field records the number of slits (or lines) per unit length (1/d). Typically it is measured in terms of number of slits per millimiter.

Parameters:

Name Type Description Default
value float

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getSpatialFrequency()

Returns the value of the SpatialFrequency attribute.

This field records the number of slits (or lines) per unit length (1/d). Typically it is measured in terms of number of slits per millimiter.

Returns:

Type Description
float

The value of the attribute

resetSpatialFrequency()

Resets the SpatialFrequency attribute to an unset state.

This field records the number of slits (or lines) per unit length (1/d). Typically it is measured in terms of number of slits per millimiter.

hasSpatialFrequency()

Checks whether the SpatialFrequency attribute is present.

This field records the number of slits (or lines) per unit length (1/d). Typically it is measured in terms of number of slits per millimiter.

Returns:

Type Description
boolean

true if the attribute has been set, false otherwise

setTransmittive(value, validate=True)

Sets the value of the Transmittive attribute.

This field records whether the periodic fine structure of this Diffraction Grating is Transmissive (True) and therefore refracts light, or is Reflective (False) and therefore reflects it.

Parameters:

Name Type Description Default
value boolean

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getTransmittive()

Returns the value of the Transmittive attribute.

This field records whether the periodic fine structure of this Diffraction Grating is Transmissive (True) and therefore refracts light, or is Reflective (False) and therefore reflects it.

Returns:

Type Description
boolean

The value of the attribute

resetTransmittive()

Resets the Transmittive attribute to an unset state.

This field records whether the periodic fine structure of this Diffraction Grating is Transmissive (True) and therefore refracts light, or is Reflective (False) and therefore reflects it.

hasTransmittive()

Checks whether the Transmittive attribute is present.

This field records whether the periodic fine structure of this Diffraction Grating is Transmissive (True) and therefore refracts light, or is Reflective (False) and therefore reflects it.

Returns:

Type Description
boolean

true if the attribute has been set, false otherwise

setModulationMode(value, validate=True)

Sets the value of the ModulationMode attribute.

This field indicates what aspect of the light beam is modulated by this device.

Parameters:

Name Type Description Default
value ModulationModeList_Type

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getModulationMode()

Returns the value of the ModulationMode attribute.

This field indicates what aspect of the light beam is modulated by this device.

Returns:

Type Description
ModulationModeList_Type

The value of the attribute

resetModulationMode()

Resets the ModulationMode attribute to an unset state.

This field indicates what aspect of the light beam is modulated by this device.

hasModulationMode()

Checks whether the optional ModulationMode attribute is present.

This field indicates what aspect of the light beam is modulated by this device.

Returns:

Type Description
boolean

true if the optional attribute has been set, false otherwise

setRonchi(value, validate=True)

Sets the value of the Ronchi attribute.

This field records whether this Diffraction Grating has a square wave profile, as defined by Ronchi (True) or a sine wave profile (False).

Parameters:

Name Type Description Default
value boolean

The value to set

required
validate (boolean, optional)

If true, validates constraints on value. Default is true.

True

getRonchi()

Returns the value of the Ronchi attribute.

This field records whether this Diffraction Grating has a square wave profile, as defined by Ronchi (True) or a sine wave profile (False).

Returns:

Type Description
boolean

The value of the attribute

resetRonchi()

Resets the Ronchi attribute to an unset state.

This field records whether this Diffraction Grating has a square wave profile, as defined by Ronchi (True) or a sine wave profile (False).

hasRonchi()

Checks whether the Ronchi attribute is present.

This field records whether this Diffraction Grating has a square wave profile, as defined by Ronchi (True) or a sine wave profile (False).

Returns:

Type Description
boolean

true if the attribute has been set, false otherwise