- Added optional calculation of higher order moments when calling
gmix.get_weighted_moments(obs, with_higher_order=True)
This is also available with GaussMom(fwhm, with_higher_order=True)
Currently the sums are calculated and are stored in a larger "sums" and
"sums_cov" arrays in the results. No normalized moments are returned.
Names and indices for moments can be found in moments.MOMENTS_NAME_MAP
- Fixed bug when moments are used in guesser and size is bad.
Only affected rng such as np.random.default_rng that checks
range for uniform
- Convert GMixND.plot to use matplotlib
- Add calculation of "rho4" to the adaptive moments code.
- The metacal psf reconvolution method 'gauss' (which uses MetacalGaussPSF)
now works with a complex WCS
- Caching in pre-psf moments and metacal is now optional
with an API to turn it on. Default is off.
- Pixel in pre-PSF moments is not deconvolved when doing PSFs.
- Added new guesser BDFPSFFluxGuesser, makes a flux guess
based on the PSF flux
- Added O(N) phase shift computation for pre-psf moments
- ignore NumbaExperimentalFeatureWarning being spewed by
numba. We can ignore these, as the features are of order
ten years old from the time of writing
- Added function to regularize moments results.
- Added numba to pre-PSF moments to reduce runtime.
- Fixed 1/area normalization for all moments fields in `GaussMom` results.
- Added `fwhm_smooth` keyword to pre-PSF moments routines to allow for extra
smoothing of the profile before the moments are measured.
- Added caching of FFTs in metacal and pre-PSF moment rountines.
- Added moments weight function normalization.
- Changed `mom*` fields in the moments outputs to `sums*`.
- Added `sums_norm` field to adaptive moments outputs.
- Fixed a bug where the `kind` attribute was not set for the `PrePSFMom` fitter.
- implemented check for equality, copy() method, copy, and deepcopy
for Gmix objects, jacobians, and Observation/ObsList/MultiBandObsList
- added get_data() method for jacobian objects
- added apodization to the pre-PSF moments to help prevent FFT artifacts
- util.get_ratio_error and get_ratio_var support array arguments
- added new function ngmix.gmix.gmix_concat to concatenate
GMix objects into a combined GMix
- It is no longer required to send a random number generator
to the constructors for MetacalGaussPSF and MetacalAnalyticPSF. If one
is sent it is still used to add a small amount of noise.
- The metacal codes now use a copy() of the input observations when
creating their output. This passes along all the internal data.
- Changes to ensure the "flux" result from the `AdmomFitter` is normalized
the same as those from the other moments fitters.
- In MetacalFitGaussPSF when using adaptive moments to get the psf
model, be careful to use the fitted parameters rather than going through
an intermediate gmix, which converts e1, e2 to g1, g2 and can fail in
rare cases.
- Some AdmomFitter failures were not being flagged properly.
- All moments codes now produce similar output dictionaries and flags.
- The `PrePSFGaussMom` class has been renamed to `PGaussMom`. The old name still
exists for backwards compatibility but will be deprecated and removed at
some future date.
- The moments codes and `gaussap.py` codes now use np.nan for missing values.
- The flag bits have been normalized across the code base to now all reside in
`ngmix.flags`. A new function to convert the flags to a descriptive string is
located there as well.
- A new function exists to convert raw moments to shape results:
`ngmix.moments.make_mom_result`
- The moments fitters now have a `kind` attribute to help downstream code
process them uniformly.
- Added slots for position moments in moments output for moments fitters.
- Ensure only square images are accepted for pre psf moments codes
KSigmaMom and PrePSFGaussMom
- Added
PrePSFGaussMom
fitter for computing pre-PSF moments in Gaussian
apertures
- Test suite now runs in parallel using
pytest-xdist
- Added
flux_flags
and T_flags
fields to KSigmaMom
and PrePSFGaussMom
fitters for using just those quantities.
- Added
FFTRangeError
which is now raised if KSigmaMom
or PrePSFGaussMom
are using inconsistent FFT sizes given the kernel size.
- add
cenonly
option to adaptive moments, using a fixed gaussian covariance
with only the center varying. Added ngmix.admom.find_cen_admom function
for finding the center.
- Fixed bug identifying that adaptive moments had reached maximum
number of iterations
- em fitting now supports fixed covariance matrices using the
EMFitterFixCov, or equivalently the fixcov=True keyword to the run_em
convenience function
- fixed bug with sheared psfs in metacal, negative sheared psfs
were not being cached.
- bug in psf guesser when using guess_from_moms that caused
infinite recursion
- ngmix now evaluates models in flux units rather than surface brightness.
Users whose images are in flux units previously had to include extra
factors of pixel scale squared to get the right units, this is no longer
the case.
- The fitters no longer take the observation in the constructor.
All fitting/measurement conform to a common interface. The classes have a
go
method that takes the observation and possibly a guess.
- The bootstrap and runner code has been completely replaced by a new api.
The bootstrappers are now generic, wrapping runners that are themselves
generic wrappers for fitters and guessers. Thus the bootstrap/runner
code is completely generic and can work with any of the fitters/guessers.
- The guessers now optionally take the observation as argument when called; this
facilitates the cases where a guess can be made based on the observations.
- The em codes take GMix objects as guesses, a simple T guess is no longer
supported
- The em codes now work in image flux units rather than normalizing the
mixture
- all PDFs/priors sample methods take the option nrand=. Some had previously
taken n=
- fitters renamed:
- LMSimple -> Fitter
- LMCoellip -> CoellipFitter
- TemplateFluxFitter -> PSFFluxFitter
- GalsimSimple -> GalsimFitter
- SpergelFitter -> GalsimSpergelFitter
- MoffatFitter -> GalsimMoffatFitter
- GalsimTemplateFluxFitter -> GalsimPSFFluxFitter
- GMixEM -> EMFitter
- Admom -> AdmomFitter
- Copies of observations now propagate the values of
store_pixels
and ignore_zero_weight
.
- metacal was reconvolving by the pixel twice, which resulted in larger
reconvolved PSFs and thus somewhat lower, but still accurate, response than
the pixel was included once. This did not cause any bias.
- fixed computation of Jacobian center for
ngmix.KObservation
s with mixed
even-odd dimensions
- the total shape amplitude
g
is now reset properly when using the
Shape.set_g1g2
method
- fixed large rounding errors in some shape conversions in
ngmix.shape
- fixed bug in
ngmix.shape.g1g2_to_eta1eta2
in handling numpy array inputs
- fixed bug in
ngmix.shape.e1e2_to_eta1eta2
in handling numpy array inputs
- fixed bug in
ngmix.priors.GPriorBA.get_fdiff
in handling array inputs
- fixed a bug in
ngmix.priors.TwoSidedErf.get_fdiff
in handling array inputs
- fixed bug in
TruncatedSimpleGauss2D
where the truncation radius was applied about
zero in some methods and not about the center
- fixed flux unit scaling in metadetect regression tests
- All fitters and measurement classes adhere to a common interface.
fitter.go(obs=obs)
or fitter.go(obs=obs, guess=guess)
. The obs
is no longer taken in the constructor so the same object can be reused
in the runners/bootstrappers for multiple measurements.
- Replaced boostrapper/runner classes with generic classes/functions that
expect fitters/measurements and runners to provide common interfaces
For fitters
fitter.go(obs=obs)
or fitter.go(obs=obs, guess=guess)
For runners runner.go(obs=obs)
. New classes are bootstrap.Bootstrapper
runners.Runner, runners.PSFRunner
- Expanded test suite and improved documentation for all modules
- introduced
NGmixBaseException
as parent class for all ngmix-specific exceptions
- New guessers
TPSFFluxGuesser
, TPSFFluxAndPriorGuesser
, GmixPSFGuesser
,
SimplePSFGuesser
, CoellipPSFGuesser
- New joint prior
PriorGalsimSimpleSep
- Added guessers
TPSFFluxGuesser
, TPSFFluxAndPriorGuesser
, GMixPSFGuesser
,
SimplePSFGuesser
, CoellipPSFGuesser
,
- New specialized EM fitting codes added:
- GMixEMFixedCen: fit mixtures with fixed centers for each component
- GMixEMFluxOnly: fit mixtures allowing only the fluxes to vary
- some refactoring of like modules into sub-packages.
- Added
mfrac
attribute to observations to hold masked fraction images.
- Added Python
@property
functions for store_pixels
and ignore_zero_weight
for ngmix.Observation
.
setup.py
now gets the version from the package.
- Added new
KSigmaMom
fitter to measure pre-PSF weighted moments using the
ksigma
kernel from Bernstein et al.
- The
LMSimple
class now supports the "bdf" and "bd" models and has been
renamed to LM
. The LMSimple
is now an alias for LM
and is considered
deprecated. The LMBDF
and LMBD
classes have been removed.
ngmix.lensfit
has been removed in v2.0.0
- all
dbyg1_*
, dbyg2_*
, dlnbyg1_*
, dlnbyg2_*
, and get_pqr*
methods,
along with the code used to test them, have been removed from the classes in
ngmix.priors
- removed travis-ci in favor of GitHub Actions
- the optional
rng
keyword for ngmix.priors.srandu
has been removed in favor
of a required keyword
- removed priors
ZDisk2DErf
, ZAnnulus
, UDisk2DCut
, TruncatedStudentPolar
,
TruncatedGaussianPolar
, Student
, Student2D
, MultivariateLogNormal
,
MVNMom
, TruncatedSimpleGauss2D
, GPriorGreat3Exp
, GPriorGreatDES
,
GPriorGreatDES2
, GPriorGreatDESNoExp
, GPriorM
, GPriorMErf
, GPriorMErf2
,
FlatEtaPrior
, BFrac
, TFluxPriorCosmosExp
, TFluxPriorCosmosDev
,
GPriorCosmosSersicSpline
- Removed all the old bootstrapper and runner classes; replaced with generic
Bootstrapper, Runner, PSFRuner, and MetacalBootstrapper
, and associated functions
- removed
GMixBDF
class. The "bdf" is now supported by the GMixModel
class
- removed the
roundify
and stats
modules
- removed the "prepix" option for metacal
- removed guessers
RoundParsGuesser
, MomGuesser
,
- switched from print to logging in many modules
- removed simplex.py no longer needed, we just use the scipy simplex fitter
- metacal was reconvolving by the pixel twice, which resulted in larger reconvolved PSFs and thus somewhat lower, but still accurate, response than the pixel was included once. This did not cause any bias.
- fix bug not updating pixel array when adding noise in metacal
- added writeable context for observations, now returned references
for observation images etc. are read only unless in the writeable
context
- jacobian getter returns new Jacobian with readonly view, rather
than a copy
- added more unit tests
- Add option to not store pixels
- fixed bug in T fraction sum for
dev
profiles
- fixed bugs for the full bulge+disk fitter
- added order 5 fast exponential to fastexp.py which
is exported as fexp. This has satisfactory accuracy
but is much faster than expd in some real world
scenarios. Modified the tests accordinly.
- added a Gaussian moments fitter
- added 5 gaussian coellip fitting in the coellip
psf fitter
- better fast exponential function approximation
- bug in gaussian aperture flux calculation for cm
- unit tests and travis CI for core APIs
- analytic Gaussian aperture fluxes
- fixed bug in BDF Gaussian aperture fluxes
- Use psf_cutout_row and col for center in psf obs for
meds reader