Skip to content

Commit

Permalink
Fix to 3DIrescale tool not being compatible with new NamedTuple for S…
Browse files Browse the repository at this point in the history
…tokes I fit results. (#131)
  • Loading branch information
Cameron-Van-Eck committed May 9, 2024
1 parent 885f881 commit 79cebf0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
21 changes: 18 additions & 3 deletions RMtools_3D/rescale_I_model_3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import astropy.io.fits as pf
import numpy as np

from RMutils.util_misc import renormalize_StokesI_model
from RMutils.util_misc import FitResult, renormalize_StokesI_model


def command_line():
Expand Down Expand Up @@ -229,8 +229,23 @@ def rescale_I_pixel(data, fit_function):
oldDict["pcov"] = covar
oldDict["fit_function"] = fit_function

newDict = renormalize_StokesI_model(oldDict, new_freq)
return newDict["p"], newDict["perror"]
old_result = FitResult(
params=coeff,
fitStatus=np.nan, # Placeholder
chiSq=np.nan, # Placeholder
chiSqRed=np.nan, # Placeholder
AIC=np.nan, # Placeholder
polyOrd=len(coeff) - 1,
nIter=0, # Placeholder
reference_frequency_Hz=old_freq,
dof=np.nan, # Placeholder
pcov=covar,
perror=np.zeros_like(coeff), # Placeholder
fit_function=fit_function,
)

new_fit_result = renormalize_StokesI_model(old_result, new_freq)
return new_fit_result.params, new_fit_result.perror


def rescale_I_model_3D(
Expand Down
7 changes: 7 additions & 0 deletions VERSION_HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

1.4.5:
-Fixed 3DIrescale tool to work with new NamedTuple for Stokes I fitting outputs.

1.4.4:
-Fixed calcRMSF tool to work with new NamedTuple system for RMSF calculation/fitting outputs.

1.4.3:
-Fixed bug in RMpeakfit3D which wasn't using the correct channel weights to calculate uncertainties.

1.4.2:
-minor fix to uncertainties generated by RMpeakfit3D
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DESCRIPTION = "RM-synthesis, RM-clean and QU-fitting on polarised radio spectra"
URL = "https://github.com/CIRADA-Tools/RM-Tools"
REQUIRES_PYTHON = ">=3.7.0"
VERSION = "1.4.4"
VERSION = "1.4.5"
DOWNLOAD_URL = (
"https://github.com/CIRADA-Tools/RM-Tools/archive/v" + VERSION + ".tar.gz"
)
Expand Down

0 comments on commit 79cebf0

Please sign in to comment.