v1.3.0 #87
Replies: 1 comment
-
ZOSPy 1.3.0 comes with a new, experimental interface for analyses, which aims to make creating new analysis wrappers significantly easier. Using the old interface, this is how you run a Zernike Standard Coefficients analysis: import zospy as zp
zos = zp.ZOS()
oss = zos.connect()
# Create optical system
zernike_standard_coefficients = zp.analyses.wavefront.zernike_standard_coefficients(
oss, sampling="32x32", maximum_term=37
) This returns a dictionary with Pandas Series and DataFrames, and you have to interactively figure out how these are structured. Not all analyses use the same result structure. This is what the same analysis looks like with the new interface: import zospy as zp
zos = zp.ZOS()
oss = zos.connect()
# Create optical system
zernike_standard_coefficients = zp.analyses.new.wavefront.ZernikeStandardCoefficients(
sampling="32x32", maximum_term=37
).run(oss) But this interface is more flexible: # Alternatively, create the analysis first and run it separately:
analysis = zp.analyses.new.wavefront.ZernikeStandardCoefficients(sampling="32x32", maximum_term=37)
zernike_standard_coefficients = analysis.run(oss)
# Or create a settings object first and then the analysis:
settings = zp.analyses.new.wavefront.ZernikeStandardCoefficientsSettings(sampling="32x32", maximum_term=37)
zernike_standard_coefficients = zp.analyses.new.wavefront.ZernikeStandardCoefficients(settings=settings).run(oss)
# Or create the analysis, adjust a setting and then run it:
analysis = zp.analyses.new.wavefront.ZernikeStandardCoefficients(settings=settings)
analysis.settings.wavelength = 2
zernike_standard_coefficients = analysis.run(oss) This returns a As you can see, the interface is now object-oriented, but we tried to mostly retain the ergonomics of the old interface. We would like to get feedback on this new interface before we release it. Please let us know what you think about it, and if there's something you don't like about it. @Omnistic @andibarg @noahrbn as you contributed to ZOSPy in the past, we would like to hear your opinion on these points:
Thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
This release adds support for retrieving images from the system viewers. Images can be accessed as arrays (default) or exported to a file.
Furthermore, support for the OpticStudio analyses Wavefront Map, Geometric Image Analysis and Physical Optics Propagation is added.
This release also adds a new, experimental interface for analyses that will be the default from ZOSPy 2.0.0. This change is necessary to streamline and simplify the process of adding new analyses. Please test this new interface and post your feedback in the discussion!
Added
zospy.analyses.wavefront.wavefront_map
(!61)zospy.analyses.extendedscene.geometric_image_analysis
(!61)zospy.analyses.physicaloptics.physical_optics_propagation
(!61)zospy.analyses.physicaloptics.pop_create_beam_parameter_dict
,zospy.analyses.physicaloptics.pop_create_fiber_parameter_dict
zospy.functions.lde.surface_change_aperturetype
zospy.analyses.new
(Implement new analysis structure with parsers #78, Decorator for analyses #15)zospy.analyses.systemviewers.viewer_3d
andzospy.analyses.systemviewers.cross_section
(Add support for OpticStudio viewer exports #80).Changed
zospy.functions.lde.surface_change_type
to also support surfaces that require the specification of a file to load. (!61)zospy.tests
andzospy.scripts.generate_test_reference_data
. (!61)This discussion was created from the release v1.3.0.
Beta Was this translation helpful? Give feedback.
All reactions