prysm.io#
File readers for various commercial instruments.
- prysm.io.read_mtfmapper_sfr_single(file, pixel_pitch=None)#
Read an MTF Mapper SFR (MTF) file generated by the -f flag with –single-roi.
Notes
This reads a “raw_sfr_values.txt” file, not an “edge_sfr_values.txt” file.
- prysm.io.read_zygo_datx(file)#
Read a zygo datx file.
- Parameters:
file (path_like) – location of a file
- Returns:
dictionary with keys phase, intensity, meta
- Return type:
- Raises:
ImportError – h5py unavailable, required dependency for this
- prysm.io.read_zygo_dat(file, multi_intensity_action='first')#
Read the contents of a zygo binary (.dat) file.
- prysm.io.read_zygo_metadata(file_contents)#
Parse metadata from the contents of a binary Zygo file.
- prysm.io.write_zygo_dat(file, phase, dx, wavelength=0.6328, intensity=None)#
Write a Zygo .DAT interferogram file.
- Parameters:
file (path_like) – filename
phase (ndarray) – array of phase values, nm
dx (ndarray) – inter-sample spacing, mm
wavelength (float, optional) – wavelength of light, um
intensity (ndarray, optional) – intensity data
- prysm.io.write_zygo_ascii(file, phase, dx, wavelength=0.6328, intensity=None)#
Write a Zygo ASCII interferogram file.
- Parameters:
file (path_like) – filename
phase (ndarray) – array of phase values, nm
dx (ndarray) – inter-sample spacing, mm
wavelength (float, optional) – wavelength of light, um
intensity (ndarray, optional) – intensity data
- prysm.io.read_sigfit_zernikes(file)#
Read Zernikes from a SigFit OUTCOF3 file.
- Parameters:
file (str or Path_like) – path to a file
- Returns:
type | Noll (“Zemax Standard”) or Fringe Zernikes
normed | if True, the terms are orthonormalized and have unit standard deviation, else unit amplitude
wavelength | wavelength of light in microns
rnorm | normalization radius, mm
coefs | Zernike mode coefficients, microns
- Return type:
dict with keys of surface IDs, which have values of dicts with keys of
- prysm.io.read_sigfit_rigidbody(file)#
Read rigid body perturbation data from a SigFit sum1.csv file.
- Parameters:
file (str or path_like) – location of a sigfit sum1.csv file
- Returns:
all values in mm
- Return type:
dict with keys of surface IDs, which have values of dicts with keys of dx, dy, dz, rx, ry, rz, dR
- prysm.io.write_codev_gridint(array, filename, comment='CV GRD generated by prysm', typ='SUR', nnb=False)#
Write a Code V INT file in grid sag format.
- Parameters:
array (ndarray) – array of floats to write if typ is either SUR or WFR, units of nm
filename (str) – filename to save to
comment (str) – up to 80 character comment
typ (str, {'SUR', 'WFR', 'FIL'}) –
- whether the file represents
SUR surface figure WFR wavefront error FIL intensity apodization
nnb (bool, optional) –
whether Nearest Neighbor interpolation is used.
When nnb=False, Code V will use bilinear interpolation between points when ray tracing. This can cause failure when ray-tracing when there are high slopes near where the chief ray would intersect the surface. When nnb=False, first order implications due to the interferogram are more accurate, such as pupil positions.
When nnb=True, nearest neighbor interpolation between points is used when ray tracing. This avoids potential failure modes due to issues finding the chief ray path through the system, but requires higher resolution grid int files be provided to well-represent the deformation.
- prysm.io.write_codev_zfr_int(coefs, filename, comment='CV ZFR generated by prysm', SUR=True)#
Write a Code V INT file of ZFR coefficients.
- prysm.io.read_codev_gridint(file)#
Read a Code V INT file containing grid data.
- prysm.io.read_codev_psf(fn, sep=',')#
Read a Code V PSF output.
- prysm.io.read_codev_bsp(fn, sep=',')#
Read a Code V BSP output.