andycasey / smhr

Spectroscopy Made Hard(er)
14 stars 7 forks source link

Weird error when doing synthesis #237

Closed maddiecain closed 7 years ago

maddiecain commented 7 years ago

Terminal output: 595418.964826 -1636127.2888 -307.661977528 0.0939149491749 -98533.4965131 Python(22963,0xa34b9000) malloc: mach_vm_map(size=8388608) failed (error code=3) error: can't allocate region *** set a breakpoint in malloc_error_break to debug

MemoryError Traceback (most recent call last) /Users/madelyncain/smhr/smh/gui/chemical_abundances.pyc in fit_one(self) 905 if spectral_model is None: return None 906 try: --> 907 res = spectral_model.fit() 908 except (ValueError, RuntimeError) as e: 909 print("Fitting error",spectral_model)

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in fit(self, spectrum, *kwargs) 393 p_alt = np.random.multivariate_normal(p_opt, cov, size=draws) 394 model_yerr = model_y - np.percentile( --> 395 [objective_function(x, ) for in p_alt], percentiles, axis=0) 396 else: 397 p_alt = np.nan * np.ones((draws, p_opt.size))

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in objective_function(x, parameters) 359 synth_dispersion, intensities = approximater(parameters) 360 return self._nuisance_methods( --> 361 x, synth_dispersion, intensities, *parameters) 362 363 p_opt, p_cov = op.curve_fit(objective_function, xdata=x, ydata=y,

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in _nuisance_methods(self, dispersion, synth_dispersion, intensities, *parameters) 595 kernel = abs(sigma_smooth)/np.mean(np.diff(synth_dispersion)) 596 if kernel > 0: --> 597 model = gaussian_filter(model, kernel) 598 599 try:

/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.pyc in gaussian_filter(input, sigma, order, output, mode, cval, truncate) 303 for axis, sigma, order in axes: 304 gaussian_filter1d(input, sigma, axis, order, output, --> 305 mode, cval, truncate) 306 input = output 307 else:

/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.pyc in gaussian_filter1d(input, sigma, axis, order, output, mode, cval, truncate) 222 sum += 2.0 tmp 223 for ii in range(2 lw + 1): --> 224 weights[ii] /= sum 225 # implement first, second and third order derivatives: 226 if order == 1: # first derivative

MemoryError:

Error message: Traceback (most recent call last):

File "/Users/madelyncain/smhr/smh/gui/chemical_abundances.py", line 907, in fit_one res = spectral_model.fit()

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 395, in fit [objectivefunction(x, *) for _ in p_alt], percentiles, axis=0)

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 361, in objective_function x, synth_dispersion, intensities, *parameters)

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 597, in _nuisance_methods model = gaussian_filter(model, kernel)

File "/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.py", line 305, in gaussian_filter mode, cval, truncate)

File "/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.py", line 224, in gaussian_filter1d weights[ii] /= sum

MemoryError

This isn't a super big issue, but i thought i'd submit it anyways. Happened when I tried to run Sm3848

alexji commented 7 years ago

This is because your computer ran out of RAM. Is Sm3848 the super huge one with a million lines? That one is definitely broken and the linelist should be deleted.

On Sun, Jun 25, 2017 at 1:38 PM maddiecain notifications@github.com wrote:

Terminal output: 595418.964826 -1636127.2888 -307.661977528 0.0939149491749 -98533.4965131 Python(22963,0xa34b9000) malloc: mach_vm_map(size=8388608) failed (error code=3) error: can't allocate region *** set a breakpoint in malloc_error_break to debug

MemoryError Traceback (most recent call last) /Users/madelyncain/smhr/smh/gui/chemical_abundances.pyc in fit_one(self) 905 if spectral_model is None: return None 906 try: --> 907 res = spectral_model.fit() 908 except (ValueError, RuntimeError) as e: 909 print("Fitting error",spectral_model)

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in fit(self, spectrum, *kwargs) 393 p_alt = np.random.multivariate_normal(p_opt, cov, size=draws) 394 model_yerr = model_y - np.percentile( --> 395 [objective_function(x, ) for in p_alt], percentiles, axis=0) 396 else: 397 p_alt = np.nan * np.ones((draws, p_opt.size))

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in objective_function(x, parameters) 359 synth_dispersion, intensities = approximater(parameters) 360 return self._nuisance_methods( --> 361 x, synth_dispersion, intensities, *parameters) 362 363 p_opt, p_cov = op.curve_fit(objective_function, xdata=x, ydata=y,

/Users/madelyncain/smhr/smh/spectral_models/synthesis.pyc in _nuisance_methods(self, dispersion, synth_dispersion, intensities, *parameters) 595 kernel = abs(sigma_smooth)/np.mean(np.diff(synth_dispersion)) 596 if kernel > 0: --> 597 model = gaussian_filter(model, kernel) 598 599 try:

/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.pyc in gaussian_filter(input, sigma, order, output, mode, cval, truncate) 303 for axis, sigma, order in axes: 304 gaussian_filter1d(input, sigma, axis, order, output, --> 305 mode, cval, truncate) 306 input = output 307 else:

/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.pyc in gaussian_filter1d(input, sigma, axis, order, output, mode, cval, truncate) 222 sum += 2.0 tmp 223 for ii in range(2 lw + 1): --> 224 weights[ii] /= sum 225 # implement first, second and third order derivatives: 226 if order == 1: # first derivative

MemoryError:

Error message: Traceback (most recent call last):

File "/Users/madelyncain/smhr/smh/gui/chemical_abundances.py", line 907, in fit_one res = spectral_model.fit()

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 395, in fit [objectivefunction(x, *) for _ in p_alt], percentiles, axis=0)

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 361, in objective_function x, synth_dispersion, intensities, *parameters)

File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 597, in _nuisance_methods model = gaussian_filter(model, kernel)

File "/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.py", line 305, in gaussian_filter mode, cval, truncate)

File "/Users/madelyncain/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/scipy/ndimage/filters.py", line 224, in gaussian_filter1d weights[ii] /= sum

MemoryError

This isn't a super big issue, but i thought i'd submit it anyways. Happened when I tried to run Sm3848

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andycasey/smhr/issues/237, or mute the thread https://github.com/notifications/unsubscribe-auth/AC8Ijvv-tbriJEmFdPdkDVCpzOMPEhKIks5sHsVZgaJpZM4OEtrv .

maddiecain commented 7 years ago

Oops, It's actually a line from a faulty Tb linelist that doesn't have any Tb lines in it, so I just had to click Sm to get the window to close. Not one of the huge linelists. It's probably an issue because of that