Skip to content

Commit

Permalink
Merge pull request #19 from Autostronomy/versionreqs
Browse files Browse the repository at this point in the history
set req limits, fix logo missing, update trapz
  • Loading branch information
ConnorStoneAstro authored Jul 31, 2024
2 parents 291ece7 + 43828c4 commit 87b658b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
autoprofutils/oldcode.py
docs/build_html.sh
autoprof.egg-info
dist
dist
build
2 changes: 1 addition & 1 deletion autoprof/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from . import autoprofutils, Pipeline, pipeline_steps

__version__ = "1.1.2"
__version__ = "1.2.0"
__author__ = "Connor Stone"
__email__ = "connorstone628@gmail.com"

Expand Down
10 changes: 6 additions & 4 deletions autoprof/autoprofutils/SharedFunctions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import os
from scipy.integrate import trapz, quad
from scipy.integrate import trapezoid, quad
from scipy.stats import iqr, norm
from scipy.interpolate import interp2d, SmoothBivariateSpline, Rbf, RectBivariateSpline
from scipy.fftpack import fft, ifft
Expand Down Expand Up @@ -1111,7 +1111,9 @@ def fluxdens_to_fluxsum(R, I, axisratio):
S = np.zeros(len(R))
S[0] = I[0] * np.pi * axisratio[0] * (R[0] ** 2)
for i in range(1, len(R)):
S[i] = trapz(2 * np.pi * I[: i + 1] * R[: i + 1] * axisratio[: i + 1], R[: i + 1]) + S[0]
S[i] = (
trapezoid(2 * np.pi * I[: i + 1] * R[: i + 1] * axisratio[: i + 1], R[: i + 1]) + S[0]
)
return S


Expand Down Expand Up @@ -1223,7 +1225,7 @@ def Fmode_fluxdens_to_fluxsum(R, I, parameters, A=None):
S[0] = I[0] * Aq[0]
Adiff = np.array([Aq[0]] + list(Aq[1:] - Aq[:-1]))
for i in range(1, len(R)):
S[i] = trapz(I[: i + 1] * Adiff[: i + 1], R[: i + 1]) + S[0]
S[i] = trapezoid(I[: i + 1] * Adiff[: i + 1], R[: i + 1]) + S[0]
return S


Expand Down Expand Up @@ -1343,7 +1345,7 @@ def SBprof_to_COG(R, SB, parameters):
# R = arcsec_to_pc(np.array(R), D)
# # Integrate up to each radius in the profile
# for i in range(1,len(R)):
# m[i] = abs_mag_to_app_mag(L_to_mag(trapz(2*np.pi*I[:i+1]*R[:i+1]*axisratio[:i+1],R[:i+1]) + \
# m[i] = abs_mag_to_app_mag(L_to_mag(trapezoid(2*np.pi*I[:i+1]*R[:i+1]*axisratio[:i+1],R[:i+1]) + \
# mag_to_L(app_mag_to_abs_mag(m[0], D), band), band),D)
# elif method == 1:
# # Compute the starting point assuming constant SB within first isophote
Expand Down
11 changes: 3 additions & 8 deletions autoprof/pipeline_steps/Isophote_Fit.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import numpy as np
from scipy.stats import iqr
from scipy.fftpack import fft, ifft
from scipy.fftpack import fft
from scipy.optimize import minimize
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import RANSACRegressor, HuberRegressor
from time import time
from astropy.visualization import SqrtStretch, LogStretch
from astropy.visualization.mpl_normalize import ImageNormalize
from photutils.isophote import EllipseSample, EllipseGeometry, Isophote, IsophoteList
from sklearn.linear_model import HuberRegressor
from photutils.isophote import EllipseGeometry
from photutils.isophote import Ellipse as Photutils_Ellipse
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from copy import copy, deepcopy
import logging
import sys
import os

from ..autoprofutils.SharedFunctions import (
_iso_extract,
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
astropy>=3.2.3
astroquery>=0.3.10
astropy>=3.2.3,<6.0
astroquery>=0.4,<0.5
matplotlib>=3.1.2
numpy>=1.17.4
numpy>=1.17.4,<2.0
photutils>=0.7.2,<=1.5.0
scikit-learn>=0.21.3
scipy>=1.3.3
6 changes: 3 additions & 3 deletions requirements_build.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
astropy>=3.2.3
astroquery>=0.3.10
astropy>=3.2.3,<6.0
astroquery>=0.3.10,<0.4
matplotlib>=3.1.2
numpy>=1.17.4
numpy>=1.17.4,<2.0
photutils>=0.7.2,<=1.5.0
scikit-learn>=0.21.3
scipy>=1.3.3
Expand Down
25 changes: 11 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@
import autoprof.__init__ as ap
import os


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


setup(
name="autoprof",
version=ap.__version__,
version=ap.__version__,
description="Fast, robust, deep isophotal solutions for galaxy images",
long_description=read("README.md"),
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
url="https://github.com/Autostronomy/AutoProf",
author=ap.__author__,
author_email=ap.__email__,
license="GPL-3.0 license",
packages=find_packages(),
install_requires=["scipy",
"numpy",
"astropy",
"matplotlib",
"photutils",
"requests",
"scikit-learn",
],
entry_points = {
'console_scripts': [
'autoprof = autoprof:run_from_terminal',
package_data={"": ["*.png"]},
include_package_data=True,
install_requires=list(read("requirements.txt").split("\n")),
entry_points={
"console_scripts": [
"autoprof = autoprof:run_from_terminal",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
],
)

0 comments on commit 87b658b

Please sign in to comment.