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
/numpy
and 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 fromoptax
when 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
calculate
method ofBasisLayer
has been renamed toeval_basis
. - A series of similar
DetectorLayers
andOpticalLayers
have been combined intoUnifiedLayers
, namelyRotate
,Flip
andResize
. - Removed the
IrregPolyAperture
as it had some unresolved bugs. This is likely to be re-build in the newutils/geometry.py
methods somewhere down the line. ApertureFactory
has been removed in favor of the newutils.geometry
module. A small tutorial on how to use this can be found in the 'How-To's/Building Apertures' section of the docs.
Sources
- The
BinarySource
object now has the attributemean_flux
, instead of justflux
to 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.py
script has been raised into 'utils/cordinates.py', 'utils/geometry.py', 'utils/zernikes.py' - All propagation functionality has been raised out of the
Wavefront
class and into the 'utils/propagation.py' script. - A small amount of functionality from the
Sources
classes has been raised to the 'utils/sources.py' script. - The methods in 'utils/optics.py' have been consolidated and simplified.
Wavefront
- Unified the
FrenselWavefront
andWavefront
classes. This comes with a namespace change to the propagation methods, detailed below.- All
inverse
options have been removed from the propagators, the direction is now decided by the current plane of the wavefront. FFT
->propagate_FFT
MFT
&shifted_MFT
unified to ->propagate
fresnel_prop
->propagate_frensel
- All
Optics -> OpticalSystems
- All
xxxOptics
classes have been renamed toxxxOpticalSystem
, ieAngularOptics
->AngularOpticalSystem
. This is to avoid confusion between theOptic
layer class. - Removed the
LayeredOptics
class, in favor of including a layers attribute in the (newly named)AngularOpticalSystem
andCartesianOpticalSystem
. - As per the point above, the
Angular
andCartesian
Optical Systems have been reworked as child-classes of theLayeredOpticalSystem
class. This means allOpticalSystem
classes sharewf_npixels
,diameter
andlayers
attribute, with the Cartesian and Angular versions have the extrapsf_npixels
,psf_pixel_scale
andoversample
attributes, still with their respective um and arcsecond pixel scale units. psf_oversample
has been renamed tooversample
and now also multiples the output number of pixels by the same value. As suchoversample
must now be anint
, and a PSF with the correct npixels and pixel_scale can be achieved with theDownsample
detector layer, or theutils/downsample
method.- Adds the
insert_layer
andremove_layer
methods
Detectors
- Adds the
insert_layer
andremove_layer
methods
Image -> PSF
- The
Image
class have been renamed toPSF
- The
.image
attribute has been renamed to.data
Transformations
- Adds the
CoordTransfrom
class, allowing for coordinate transformations to be held in classes with a simplified API and structure, allowing for theAperture
classes to have much simpler pytree structure.
Instruments
BaseInstrument
has been re-named toInstrument
- The
Instrument
class has been re-named toTelescope
- Adds the
Dither
class, details in the 'Observation' section below
Observations
Observations
are 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 theInstrument
or (new)Telescope
class and then proceed as they would with theObservation
class.
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.py
file, 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.