dLux v0.14.0
v0.1.14
This version is a major upgrade to dLux across the board, increasing functionality, improving testing, docs enhancement, a back-end re-organisation, API changes to improve clarity and long-term stability, and an overall simplification of the code, classes and methods. These changes are in preparation for the submission to JOSS and following that, the 1.0 release.
Due to all of this, there have been a lot of changes, although migrating from v0.13.xx will be simple for end-users as the 'high-level' API is relatively unchanged beyond a few class name changes detailed below. If you have any troubles upgrading, please reach out via issues or email and I will be happy to help!
Changes
General
- All functions with a
_to_have been replaced with2, ierad_to_arcsec->rad2arcsec. This falls more in line with the method signatures ofjax/numpyand has been applied package wide. - Python 3.9 is no longer supported. This is due to changes in an upstream package.
- Changed to a 'src/dLux' layout.
Layers
- All scripts containing layers have been moved into a sub-module
layers, so it is clear which scripts are layer-specific (since they are a lot of them) - All
__call__method have been renamed toapply. This is to prevent difficult to debug errors throws fromoptaxwhen trying to optimise classes with a__call__method. - All layer-based inputs can now be passed in as a (key, layer) tuple in order to assign a user-specified key to the dictionary entry.
- The
calculatemethod ofBasisLayerhas been renamed toeval_basis. - A series of similar
DetectorLayersandOpticalLayershave been combined intoUnifiedLayers, namelyRotate,FlipandResize. - Removed the
IrregPolyApertureas it had some unresolved bugs. This is likely to be re-build in the newutils/geometry.pymethods somewhere down the line. ApertureFactoryhas been removed in favor of the newutils.geometrymodule. A small tutorial on how to use this can be found in the 'How-To's/Building Apertures' section of the docs.
Sources
- The
BinarySourceobject now has the attributemean_flux, instead of justfluxto improve clarity.
Utils
- Adds the 'array_ops.py' script, holding specific paraxial array-based operations
pixel_coordinates->nd_coords, improving clarity of the function names.- All functionality from the
apertures.pyscript has been raised into 'utils/cordinates.py', 'utils/geometry.py', 'utils/zernikes.py' - All propagation functionality has been raised out of the
Wavefrontclass and into the 'utils/propagation.py' script. - A small amount of functionality from the
Sourcesclasses has been raised to the 'utils/sources.py' script. - The methods in 'utils/optics.py' have been consolidated and simplified.
Wavefront
- Unified the
FrenselWavefrontandWavefrontclasses. This comes with a namespace change to the propagation methods, detailed below.- All
inverseoptions have been removed from the propagators, the direction is now decided by the current plane of the wavefront. FFT->propagate_FFTMFT&shifted_MFTunified to ->propagatefresnel_prop->propagate_frensel
- All
Optics -> OpticalSystems
- All
xxxOpticsclasses have been renamed toxxxOpticalSystem, ieAngularOptics->AngularOpticalSystem. This is to avoid confusion between theOpticlayer class. - Removed the
LayeredOpticsclass, in favor of including a layers attribute in the (newly named)AngularOpticalSystemandCartesianOpticalSystem. - As per the point above, the
AngularandCartesianOptical Systems have been reworked as child-classes of theLayeredOpticalSystemclass. This means allOpticalSystemclasses sharewf_npixels,diameterandlayersattribute, with the Cartesian and Angular versions have the extrapsf_npixels,psf_pixel_scaleandoversampleattributes, still with their respective um and arcsecond pixel scale units. psf_oversamplehas been renamed tooversampleand now also multiples the output number of pixels by the same value. As suchoversamplemust now be anint, and a PSF with the correct npixels and pixel_scale can be achieved with theDownsampledetector layer, or theutils/downsamplemethod.- Adds the
insert_layerandremove_layermethods
Detectors
- Adds the
insert_layerandremove_layermethods
Image -> PSF
- The
Imageclass have been renamed toPSF - The
.imageattribute has been renamed to.data
Transformations
- Adds the
CoordTransfromclass, allowing for coordinate transformations to be held in classes with a simplified API and structure, allowing for theApertureclasses to have much simpler pytree structure.
Instruments
BaseInstrumenthas been re-named toInstrument- The
Instrumentclass has been re-named toTelescope - Adds the
Ditherclass, details in the 'Observation' section below
Observations
Observationsare fully removed. They were ultimately an extra layer of abstraction and complexity that was not needed. Users wishing to use this functionality should now just create a child-class of theInstrumentor (new)Telescopeclass and then proceed as they would with theObservationclass.
Docs
- The docs have been greatly re-worked an improved, much of this benefit comes from the back-end restructure of the package, and the raising of functionality from classes into the utils module
- All jupyter notebooks have been removed and replaced with automatically generated .md files as a way to reduce the overall size of the repo. This can be done locally using the
docs/generate_mds.pyfile, run from the docs directory. - UML diagrams and now automatically generated and populate the docs as a .png. This allows for users to easily understand how a class is created, and where all if its attributes and method are defined. This should allow for users to very easily navigate the code base and find the methods of all classes easily.
- The tutorials have been re-worked and greatly improved. We now have 'introductory' designed to get new users started, 'how-tos' that go through some of the key feautures and how to use them, and keeps the currently tutorials as under 'examples'. While the 'introductory' and 'how-tos' are not all completed, the core functionality and basic workflow is covered.