Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stellarphot so it can run under current astropy (and numpy, when including previous PR) #92

Merged
merged 8 commits into from
Jun 6, 2023
17 changes: 16 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
1.1.5 (2023-05-31)
------------------

New Features
^^^^^^^^^^^^

Other Changes and Additions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Most functions are now linked to the documentation (some still need docstrings). [#92]

Bug Fixes
^^^^^^^^^
+ Runs without errors on current numpy (1.24.3) and astropy (5.3).


1.1.2 (2022-10-18)
------------------

Expand All @@ -10,9 +25,9 @@ Other Changes and Additions

Bug Fixes
^^^^^^^^^

+ Simplify comparison notebook.


1.1.1 (2022-10-18)
------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ github_project = stellarphot/stellarphot

[options]
install_requires =
astropy >=5,<5.1
astropy >=5
astroquery
ccdproc
ginga
Expand Down
14 changes: 12 additions & 2 deletions stellarphot/analysis/transit_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
_validate_model,
_convert_input)

# Functions blow changed from private to public in astropy 5
# Functions below changed from private to public in astropy 5
try:
from astropy.modeling.fitting import (
fitter_to_model_params,
Expand Down Expand Up @@ -52,7 +52,17 @@ def __call__(self, model, *args, weights=None,
dfunc = None
else:
dfunc = self._wrap_deriv
init_values = model_to_fit_params(model_copy)
init_values0 = model_to_fit_params(model_copy)
# This returns a tuple of (model_params, fitparam_indices, model_bounds),
# where model_params is a numpy array, fitparam_indices is a list, and
# model_bounds is a tuple of tuples. The problem is that this doesn't
# convert simply into an array within scipy.optimize.leastsq, when called.
# So we handle model_bounds here first to the scipy.optimize.leastsq format.
# can handle the list of initial values we pass in.
init_values = np.concatenate((np.asarray(init_values0[0]).flatten(),
np.asarray(init_values0[1]).flatten(),
np.asarray(init_values0[2]).flatten()), axis=None)

fitparams, cov_x, dinfo, mess, ierr = optimize.leastsq(
self.objective_function, init_values, args=farg, Dfun=dfunc,
col_deriv=model_copy.col_fit_deriv, maxfev=maxiter, epsfcn=epsilon,
Expand Down
180 changes: 0 additions & 180 deletions stellarphot/notebooks/ObserveACP.ipynb

This file was deleted.

Loading