[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Oct 21 22:52:53 PDT 2013
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/f907a339e78e/
Changeset: f907a339e78e
Branch: yt
User: hegan
Date: 2013-10-19 00:24:26
Summary: Fixed OOB errors for windowed spectra and bug with single wavelength partner checking
Affected #: 1 file
diff -r c2b8455b43a67b78aa01953daf000dcca10aa8cb -r f907a339e78e7363c74d2b17ed7a6ac01ffd863f yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
@@ -86,6 +86,10 @@
#Empty fit without any lines
yFit = na.ones(len(fluxData))
+ #Force the first and last flux pixel to be 1 to prevent OOB
+ fluxData[0]=1
+ fluxData[-1]=1
+
#Find all regions where lines/groups of lines are present
cBounds = _find_complexes(x, fluxData, fitLim=fitLim,
complexLim=complexLim, minLength=minLength,
@@ -103,6 +107,7 @@
initWl = speciesDict['wavelength'][0]
for b_i,b in enumerate(cBounds):
+ print b
xBounded=x[b[1]:b[2]]
yDatBounded=fluxData[b[1]:b[2]]
yFitBounded=yFit[b[1]:b[2]]
@@ -120,9 +125,10 @@
z,fitLim,minError*(b[2]-b[1]),speciesDict)
#Check existence of partner lines if applicable
- newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData,
- b, minError*(b[2]-b[1]),
- x0, xRes, speciesDict)
+ if len(speciesDict['wavelength']) != 1:
+ newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData,
+ b, minError*(b[2]-b[1]),
+ x0, xRes, speciesDict)
#If flagged as a bad fit, species is lyman alpha,
# and it may be a saturated line, use special tools
@@ -548,6 +554,10 @@
#Index of the redshifted wavelength
indexRedWl = (redWl-x0)/xRes
+ #Check to see if even in flux range
+ if indexRedWl > len(y):
+ return False
+
#Check if surpasses minimum absorption bound
if y[int(indexRedWl)]>fluxMin:
return False
https://bitbucket.org/yt_analysis/yt/commits/0a55ec8da822/
Changeset: 0a55ec8da822
Branch: yt
User: hegan
Date: 2013-10-19 00:27:50
Summary: got rid of accidental print statement
Affected #: 1 file
diff -r f907a339e78e7363c74d2b17ed7a6ac01ffd863f -r 0a55ec8da8220b26b8215884bdef52ec34ab5f78 yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
@@ -107,7 +107,6 @@
initWl = speciesDict['wavelength'][0]
for b_i,b in enumerate(cBounds):
- print b
xBounded=x[b[1]:b[2]]
yDatBounded=fluxData[b[1]:b[2]]
yFitBounded=yFit[b[1]:b[2]]
https://bitbucket.org/yt_analysis/yt/commits/7b1622244f87/
Changeset: 7b1622244f87
Branch: yt
User: brittonsmith
Date: 2013-10-22 07:52:48
Summary: Merged in hegan/yt (pull request #617)
Absorption spectrum fitting tweaks
Affected #: 1 file
diff -r 0969081e02f4b595a6b60473d7582ab7b3f195c4 -r 7b1622244f87f663d42f3f6e8e70d8c5eacc15b2 yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum_fit.py
@@ -86,6 +86,10 @@
#Empty fit without any lines
yFit = na.ones(len(fluxData))
+ #Force the first and last flux pixel to be 1 to prevent OOB
+ fluxData[0]=1
+ fluxData[-1]=1
+
#Find all regions where lines/groups of lines are present
cBounds = _find_complexes(x, fluxData, fitLim=fitLim,
complexLim=complexLim, minLength=minLength,
@@ -120,9 +124,10 @@
z,fitLim,minError*(b[2]-b[1]),speciesDict)
#Check existence of partner lines if applicable
- newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData,
- b, minError*(b[2]-b[1]),
- x0, xRes, speciesDict)
+ if len(speciesDict['wavelength']) != 1:
+ newLinesP = _remove_unaccepted_partners(newLinesP, x, fluxData,
+ b, minError*(b[2]-b[1]),
+ x0, xRes, speciesDict)
#If flagged as a bad fit, species is lyman alpha,
# and it may be a saturated line, use special tools
@@ -548,6 +553,10 @@
#Index of the redshifted wavelength
indexRedWl = (redWl-x0)/xRes
+ #Check to see if even in flux range
+ if indexRedWl > len(y):
+ return False
+
#Check if surpasses minimum absorption bound
if y[int(indexRedWl)]>fluxMin:
return False
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list