From b3178471484c48f3ae6af3738afcb39bbf50e0ee Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 09:51:58 +0200 Subject: [PATCH 01/19] adding gitignore --- .gitignore | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e25aac --- /dev/null +++ b/.gitignore @@ -0,0 +1,141 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +Pipfile.lock + +# PEP 582 +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# IDEs +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Version control +.git/ +.gitignore + +# Dynamite specific +_version.py \ No newline at end of file From 4594fc649c3b7571b529691ec5dc911161957b43 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 09:58:22 +0200 Subject: [PATCH 02/19] modern installation --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 07c94c4..efd109a 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,13 @@ It follows the method presented in Pinte et al. 2018, with various improvements, ``` git clone https://github.com/cpinte/dynamite.git cd dynamite -python3 setup.py install +pip install . ``` -If you don't have the `sudo` rights, use `python3 setup.py install --user`. - To install in developer mode: (i.e. using symlinks to point directly at this directory, so that code changes here are immediately available without needing to repeat the above step): ``` - python3 setup.py develop +pip install -e . ``` From d567c77dc5a3baa8392acd51ca0d6da9f2de4fee Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 09:58:45 +0200 Subject: [PATCH 03/19] delete old setup.py --- setup.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index d187e44..0000000 --- a/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -from setuptools import setup - -setup(name='dynamite', - description='DYNamical Analysis and MultIscale Tomography of line Emission', - url='http://github.com/cpinte/dynamite', - author='Christophe Pinte', - license='MIT', - packages=['dynamite'], - zip_safe=False) From 3a9a045220f4230a01340e7c271b86b6a8554bad Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 09:58:56 +0200 Subject: [PATCH 04/19] bump version --- src/dynamite/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamite/__init__.py b/src/dynamite/__init__.py index 12b197a..18c6970 100644 --- a/src/dynamite/__init__.py +++ b/src/dynamite/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1" +__version__ = "0.1.0" from .measure_height import * from .toy_model import * From 3f6be218fe42ec413e22a37872cdb7ce014871a9 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 09:59:14 +0200 Subject: [PATCH 05/19] add pyproject.toml file for installation --- pyproject.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f342ee2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=45"] +build-backend = "setuptools.build_meta" + +[project] +name = "dynamite" +version = "0.1.0" +description = "DYNamical Analysis and MultIscale Tomography of line Emission" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "Christophe Pinte", email = "christophe.pinte@univ-grenoble-alpes.fr"} +] +keywords = ["astronomy", "protoplanetary-disks", "kinematics", "tomography", "ALMA"] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Scientific/Engineering :: Physics", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "numpy", + "astropy", + "scipy", + "matplotlib", + "alive-progress", +] + +[project.urls] +Homepage = "https://github.com/cpinte/dynamite" +Repository = "https://github.com/cpinte/dynamite.git" + +[tool.setuptools] +package-dir = {"" = "src"} +packages = ["dynamite"] \ No newline at end of file From 0873d9bb54ce9390d522fcc027c5191b75f09420 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:03:52 +0200 Subject: [PATCH 06/19] delete requirements.txt --- requirements.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7961e23..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -numpy -astropy -scipy -matplotlib -alive-progress From 3f660dcaf245491b03b30d490f8147b0b54f7c2d Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:05:57 +0200 Subject: [PATCH 07/19] replace alive-progress with tqdm --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f342ee2..9b216aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ "astropy", "scipy", "matplotlib", - "alive-progress", + "tqdm", ] [project.urls] From 72e3c9a5f8725298f34a3a353a930ba9c24ba370 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:06:13 +0200 Subject: [PATCH 08/19] replace alive-progress with tqdm --- src/dynamite/measure_height.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index b55ff99..6e68d1b 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt import numpy as np import scipy.constants as sc -from alive_progress import alive_bar +from tqdm import tqdm from numpy import ndarray from scipy import ndimage from scipy.ndimage import rotate @@ -543,10 +543,8 @@ def _rotate_cube(self): self.x_star_rot = center[0] + dx * np.cos(angle) + dy * np.sin(angle) self.y_star_rot = center[1] - dx * np.sin(angle) + dy * np.cos(angle) - with alive_bar(int(self.iv_max-self.iv_min), title="Rotating cube") as bar: - for iv in range(self.iv_min,self.iv_max): - self.cube.image[iv,:,:] = np.array(rotate(self.cube.image[iv,:,:], self.PA - self.inc_sign * 90.0, reshape=False)) - bar() + for iv in tqdm(range(self.iv_min, self.iv_max), desc="Rotating cube"): + self.cube.image[iv,:,:] = np.array(rotate(self.cube.image[iv,:,:], self.PA - self.inc_sign * 90.0, reshape=False)) return @@ -650,12 +648,10 @@ def _extract_isovelocity(self): self.I = np.zeros([ns,nv,nx,2]) # Loop over the channels - with alive_bar(int(self.iv_max-self.iv_min), title="Extracting isovelocity curves") as bar: - for iv in range(self.iv_min,self.iv_max): - for iscale in range(self.n_scales): - self._extract_isovelocity_1channel(iv,iscale) - #self._refine_isovelocity_1channel(iv,iscale=iscale) - bar() + for iv in tqdm(range(self.iv_min, self.iv_max), desc="Extracting isovelocity curves"): + for iscale in range(self.n_scales): + self._extract_isovelocity_1channel(iv,iscale) + #self._refine_isovelocity_1channel(iv,iscale=iscale) #-- Additional spectral filtering to clean the data ?? @@ -708,11 +704,9 @@ def _make_multiscale_cube(self): self.multiscale_std[iscale] = np.nanstd([im,im1]) # Make the multiscale cube - with alive_bar(int(self.iv_max-self.iv_min), title="Making multi-scale cube: scale #"+str(iscale)) as bar: - for iv in range(self.iv_min,self.iv_max): - im = self.rotated_images[0,iv-self.iv_min,:,:] - self.rotated_images[iscale,iv-self.iv_min,:,:] = convolve_fft(im, beam) - bar() + for iv in tqdm(range(self.iv_min, self.iv_max), desc=f"Making multi-scale cube: scale #{iscale}"): + im = self.rotated_images[0,iv-self.iv_min,:,:] + self.rotated_images[iscale,iv-self.iv_min,:,:] = convolve_fft(im, beam) self.multiscale_bmaj[iscale] = bmaj self.multiscale_bmin[iscale] = bmin From 9ac89dd6a5ed082c43fddd0334408712327ff4ac Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:07:29 +0200 Subject: [PATCH 09/19] imports tidy up --- src/dynamite/measure_height.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 6e68d1b..1001280 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -19,11 +19,10 @@ from scipy import ndimage from scipy.ndimage import rotate from scipy.optimize import curve_fit, minimize -from scipy.optimize import minimize from scipy.interpolate import interp1d from scipy.signal import find_peaks from scipy.stats import binned_statistic -from astropy.convolution import Gaussian2DKernel, convolve, convolve_fft +from astropy.convolution import Gaussian2DKernel, convolve_fft import celerite from celerite import terms from scipy import signal From 9b754c5f5939522981772780119a63f72fa8b9b3 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:08:16 +0200 Subject: [PATCH 10/19] add casa_cube --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9b216aa..59714d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ dependencies = [ "scipy", "matplotlib", "tqdm", + "casa_cube" ] [project.urls] From 0a136222bc65337ef981e5cc1608b2f0b8211192 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:08:34 +0200 Subject: [PATCH 11/19] only import Cube from casa_cube --- src/dynamite/measure_height.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 1001280..fdebfc0 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -27,8 +27,7 @@ from celerite import terms from scipy import signal - -import casa_cube +from casa_cube import Cube sigma_to_FWHM = 2.0 * np.sqrt(2.0 * np.log(2)) FWHM_to_sigma = 1.0 / sigma_to_FWHM @@ -107,7 +106,7 @@ def __init__(self, if isinstance(cube,str): print("Reading cube: "+cube) - cube = casa_cube.Cube(cube) + cube = Cube(cube) # Truncating the cube is velocity if needed if vmin is not None: From 71ea8cad79276f5078e444b85d6315202ef9344b Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 10:44:30 +0200 Subject: [PATCH 12/19] move celerite import to lazy load --- src/dynamite/measure_height.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index fdebfc0..4457f02 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -23,8 +23,6 @@ from scipy.signal import find_peaks from scipy.stats import binned_statistic from astropy.convolution import Gaussian2DKernel, convolve_fft -import celerite -from celerite import terms from scipy import signal from casa_cube import Cube @@ -1761,6 +1759,9 @@ def to_mcfost(self, planet_r=0., planet_PA=0.): def fit_surface_height_gp(self): + import celerite + from celerite import terms + x = np.array(self.r.ravel().compressed()) y = self.h.ravel().compressed() yerr = 1/(np.mean(self.snr[:,:,:,:],axis=3).ravel()[np.invert(self.r.mask.ravel())]) From add561a4bcfc0b2cffc171fbf46d6f0ea1121756 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 11:17:49 +0200 Subject: [PATCH 13/19] celerite2 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 59714d6..de4d3fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,8 @@ dependencies = [ "scipy", "matplotlib", "tqdm", - "casa_cube" + "casa_cube", + "celerite2" ] [project.urls] From 73ddee2f384ab98468a3dbc2c303b46b0002e3dc Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 11:20:16 +0200 Subject: [PATCH 14/19] celerite -> celerite2 --- src/dynamite/measure_height.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 4457f02..6dd8e3d 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -1758,9 +1758,8 @@ def to_mcfost(self, planet_r=0., planet_PA=0.): def fit_surface_height_gp(self): - - import celerite - from celerite import terms + import celerite2 + from celerite2 import terms x = np.array(self.r.ravel().compressed()) y = self.h.ravel().compressed() @@ -1771,13 +1770,16 @@ def fit_surface_height_gp(self): y=y[order] yerr=yerr[order] - # Set up the GP model - k0 = terms.JitterTerm(log_sigma=np.log(np.var(y))) - k1 = terms.RealTerm(log_a=np.log(np.var(y)), log_c=np.log(50)) - k2 = terms.RealTerm(log_a=np.log(np.var(y)), log_c=np.log(5)) - kernel = k0+k1+k2 - kernel = k0+k2 - gp = celerite.GP(kernel, fit_mean=False) + # set up the GP model + # in celerite2, we use GaussianProcess with a mean function + # the JitterTerm and RealTerm are replaced with appropriate terms + sigma = np.sqrt(np.var(y)) + k0 = terms.SHOTerm(sigma=sigma, rho=1.0, Q=1/np.sqrt(2)) + k1 = terms.SHOTerm(sigma=sigma, rho=50.0, Q=1/np.sqrt(2)) + k2 = terms.SHOTerm(sigma=sigma, rho=5.0, Q=1/np.sqrt(2)) + kernel = k0 + k1 + k2 + kernel = k0 + k2 + gp = celerite2.GaussianProcess(kernel, mean=0.0) # Define a cost function def neg_log_like(params, y, gp): @@ -1786,9 +1788,9 @@ def neg_log_like(params, y, gp): def grad_neg_log_like(params, y, gp): gp.set_parameter_vector(params) - return -gp.grad_log_likelihood(y)[1] + return -gp.grad_log_likelihood(y, params)[1] - gp.compute(x, yerr) + gp.compute(x, yerr=yerr) initial_params = gp.get_parameter_vector() bounds = gp.get_parameter_bounds() @@ -1800,7 +1802,7 @@ def grad_neg_log_like(params, y, gp): # Make the maximum likelihood prediction t = np.linspace(np.min(x), np.max(x), 500) - mu, var = gp.predict(y, t, return_var=True) + mu, var = gp.predict(y, t=t, return_var=True) std = np.sqrt(var) return t, mu, std From cdbf5c916a97cd31fcad125a13acf8ae5f3ff633 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 11:22:43 +0200 Subject: [PATCH 15/19] added support for newer python --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index de4d3fe..9d78aa7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: Astronomy", "Topic :: Scientific/Engineering :: Physics", From 8bec00af76a544b09e59d3932f294b0435df5186 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 11:25:32 +0200 Subject: [PATCH 16/19] bump setuptools to something not ancient --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9d78aa7..5ec7731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45"] +requires = ["setuptools>=70"] build-backend = "setuptools.build_meta" [project] From 097ee50b6918e7563e1a0ed774230a1e08c93f69 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 11:32:56 +0200 Subject: [PATCH 17/19] fixing invalid syntax --- src/dynamite/measure_height.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 6dd8e3d..8ac430e 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -1089,7 +1089,7 @@ def find_i(self,num=0): metric[i] = self.h_std plt.plot(inc_array,metric, color="red", markersize=1) - plt.xlabel("Inclination ($^\mathrm{o}$)") + plt.xlabel(r"Inclination ($^\mathrm{o}$)") plt.ylabel("altitude dispersion") # T dispersion @@ -1106,7 +1106,7 @@ def find_i(self,num=0): metric[i] = self.T_std plt.plot(inc_array,metric, color="red", markersize=1) - plt.xlabel("Inclination ($^\mathrm{o}$)") + plt.xlabel(r"Inclination ($^\mathrm{o}$)") plt.ylabel("T dispersion") # Velocity dispersion @@ -1135,7 +1135,7 @@ def find_i(self,num=0): metric[i] = self.v_std plt.plot(inc_array,metric, color="blue", markersize=1) - plt.xlabel("Inclination ($^\mathrm{o}$)") + plt.xlabel(r"Inclination ($^\mathrm{o}$)") plt.ylabel("Velocity dispersion") self.inc = inc_array[np.nanargmin(metric)] print("Best fit for inclination =", self.inc, "deg") @@ -1372,7 +1372,7 @@ def plot_channel(self, iv, iscale=0, radius=3.0, ax=None, clear=True): # im = np.array(rotate(im, self.PA - self.inc_sign * 90.0, reshape=False)) ax.imshow(im, origin="lower", cmap='binary_r') - ax.set_title(r'v='+"{:.2f}".format(cube.velocity[iv])+' , $\Delta$v='+"{:.2f}".format(cube.velocity[iv] - self.v_syst)+' , id:'+str(iv), color='k') + ax.set_title(r'v='+"{:.2f}".format(cube.velocity[iv])+r' , $\Delta$v='+"{:.2f}".format(cube.velocity[iv] - self.v_syst)+' , id:'+str(iv), color='k') if n_surf[iscale,iv]: ax.plot(x[iscale,iv,:n_surf[iscale,iv]],y[iscale,iv,:n_surf[iscale,iv],0],"o",color="red",markersize=1) From efd5cd1ab4fb386efe8273966827020211b8f11e Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 13:53:34 +0200 Subject: [PATCH 18/19] fixed a call to celerite --- src/dynamite/measure_height.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 8ac430e..4b313c2 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -1788,7 +1788,7 @@ def neg_log_like(params, y, gp): def grad_neg_log_like(params, y, gp): gp.set_parameter_vector(params) - return -gp.grad_log_likelihood(y, params)[1] + return -gp.grad_log_likelihood(y)[1] gp.compute(x, yerr=yerr) From 1eb70fa6b9610d959cb7f4cca1cfc69608245c0c Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 7 May 2026 13:56:14 +0200 Subject: [PATCH 19/19] fixed indexing mistake --- src/dynamite/measure_height.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dynamite/measure_height.py b/src/dynamite/measure_height.py index 4b313c2..873bfe4 100644 --- a/src/dynamite/measure_height.py +++ b/src/dynamite/measure_height.py @@ -539,7 +539,7 @@ def _rotate_cube(self): self.x_star_rot = center[0] + dx * np.cos(angle) + dy * np.sin(angle) self.y_star_rot = center[1] - dx * np.sin(angle) + dy * np.cos(angle) - for iv in tqdm(range(self.iv_min, self.iv_max), desc="Rotating cube"): + for iv in tqdm(range(self.iv_min, self.iv_max + 1), desc="Rotating cube"): self.cube.image[iv,:,:] = np.array(rotate(self.cube.image[iv,:,:], self.PA - self.inc_sign * 90.0, reshape=False)) return @@ -644,7 +644,7 @@ def _extract_isovelocity(self): self.I = np.zeros([ns,nv,nx,2]) # Loop over the channels - for iv in tqdm(range(self.iv_min, self.iv_max), desc="Extracting isovelocity curves"): + for iv in tqdm(range(self.iv_min, self.iv_max + 1), desc="Extracting isovelocity curves"): for iscale in range(self.n_scales): self._extract_isovelocity_1channel(iv,iscale) #self._refine_isovelocity_1channel(iv,iscale=iscale) @@ -700,7 +700,7 @@ def _make_multiscale_cube(self): self.multiscale_std[iscale] = np.nanstd([im,im1]) # Make the multiscale cube - for iv in tqdm(range(self.iv_min, self.iv_max), desc=f"Making multi-scale cube: scale #{iscale}"): + for iv in tqdm(range(self.iv_min, self.iv_max + 1), desc=f"Making multi-scale cube: scale #{iscale}"): im = self.rotated_images[0,iv-self.iv_min,:,:] self.rotated_images[iscale,iv-self.iv_min,:,:] = convolve_fft(im, beam)