Reading and writing

Read and write NeXus files in the ellipsometry standard. NeXus is a format originating from large beam line facitilies and is adapted for other smaller labratory experiments to supply an agreed standard for data sharing. For now only reading is supported but in the future there will also be a writer to store the whole optical model and fit inside the NeXus file.

class elli.importer.nexus.NexusGroupNames(entry='entry', sample='sample', instrument='instrument')[source]

Contains nexus group names to read from the nexus file

property full_instrument_path

Get the full instrument path with prepended entry name, e.g. entry/instrument

property full_sample_path

Get the full sample path with prepended entry name, e.g. entry/sample

elli.importer.nexus.read_nexus_materials(filename)[source]

Read the optical materials from a nexus file.

Parameters:

filename (str) – The nexus filename.

elli.importer.nexus.read_nexus_psi_delta(nxs_filename, group_names=None)[source]

Read a NeXus file containing Psi and Delta data.

Parameters:

nxs_filename (str) – The filename of the NeXus file.

Raises:

ValueError – Is raised when the data is not stored as psi / delta value.

Returns:

Psi/Delta DataFrame. The index is a multiindex consisting of the angle of incidents as first column and the wavelength as second column.

Return type:

pd.DataFrame

elli.importer.nexus.read_nexus_rho(nxs_filename)[source]

Reads rho value from NeXus datafile. Currently, this works only with psi / delta representation in the NeXus file.

Raises:

ValueError – Is raised when the data is not stored as psi / delta value.

Returns:

DataFrame containing the measured data as imaginary rho value. The index is a multiindex consisting of the angle of incidents as first column and the wavelength as second column.

Return type:

pd.DataFrame

A helper class to load data from SpectraRay ASCII Files. It only supplies a rudimentary loading of standard psi/delta values and misses some other features.

elli.importer.spectraray.read_spectraray_mmatrix(fname, sep='\\s+', decimal='.')[source]

Read a mueller matrix spectraray ascii file. Only reads the first entry and does not support reading multiple angles. For multiple angles you have to save the data in multiple files.

Parameters:
  • fname (str) – Filename of the measurement ascii file.

  • sep (str, optional) – Data separator in the datafile. Defaults to “s+”.

  • decimal (str, optional) – Decimal separator in the datafile. Defaults to “.”.

Returns:

DataFrame containing the psi/delta data in the format to be further processes inside pyElli.

Return type:

pd.DataFrame

elli.importer.spectraray.read_spectraray_psi_delta(fname, sep='\\s+', decimal='.')[source]

Read a psi/delta spectraray ascii file.

Parameters:
  • fname (str) – Filename of the measurement ascii file.

  • sep (str, optional) – Data separator in the datafile. Defaults to “s+”.

  • decimal (str, optional) – Decimal separator in the datafile. Defaults to “.”.

Returns:

DataFrame containing the psi/delta data in the format to be further processes inside pyElli.

Return type:

pd.DataFrame

elli.importer.spectraray.read_spectraray_rho(fname, sep='\\s+', decimal='.')[source]

Read a psi/delta spectraray ascii file and converts it to rho values.

Parameters:
  • fname (str) – Filename of the measurement ascii file.

  • sep (str, optional) – Data separator in the datafile. Defaults to “s+”.

  • decimal (str, optional) – Decimal separator in the datafile. Defaults to “.”.

Returns:

DataFrame containing the rho data in the format to be further processes inside pyElli.

Return type:

pd.DataFrame

A helper class to load data from Woollam ASCII Files. It supports loading of standard psi/delta values.

elli.importer.woollam.read_woollam_psi_delta(fname)[source]

Read a psi/delta woollam ascii file.

Parameters:

fname (str) – Filename of the measurement ascii file.

Returns:

DataFrame containing the psi/delta data in the format to be further processes inside pyElli.

Return type:

pd.DataFrame

elli.importer.woollam.read_woollam_rho(fname)[source]

Read a psi/delta woollam ascii file and converts it to rho values.

Parameters:

fname (str) – Filename of the measurement ascii file.

Returns:

DataFrame containing the rho data in the format to be further processes inside pyElli.

Return type:

pd.DataFrame

elli.importer.woollam.scale_to_nm(unit, dataframe)[source]

Scales the wavelength axis of the given dataframe from the provided unit to nm.

Parameters:
  • unit (str) – The unit string. Should be pint compatible.

  • dataframe (pd.DataFrame) – The dataframe which axis should be scaled.

Returns:

The dataframe with scaled wavelength axis.

Return type:

pd.DataFrame