pyspeckit: could not run the example "Radio Fitting: N2H+ cube example" successfully

Dear developer team, I was able to follow the “Radio Fitting: N2H+ cube example” on the website to fit my own N2H+ data successfully. However I could not anymore since I updated pyspeckit to the latest version: 0.1.22.dev2869

It kept giving me this error:

divide by zero encountered in true_divide
INFO: Finished fit    330 of    630 at (  19,   5) s/n=  3.2. Elapsed time is 69.0 seconds.  %52 [pyspeckit.cubes.SpectralCube]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/data/beegfs/astro-storage/groups/beuther/wang/hfs_fit/MPI/fit_n2hp.py in <module>()
     59                 signal_cut=3, # minimize the # of pixels fit for the example
     60                 start_from_point=(2,2),
---> 61                 errmap=errmap,multicore=25)#,blank_value = np.nan)
     62                 #limits=[(2, 100), (0.1, 30), (18, 30), (0, 5)])
     63                 #use_nearest_as_guess=False)

/data/beegfs/astro-storage/groups/beuther/wang/Github/pyspeckit/pyspeckit/cubes/SpectralCube.py in fiteach(self, errspec, errmap, guesses, verbose, verbose_level, quiet, signal_cut, usemomentcube, blank_value, integral, direct_integral, absorption, use_nearest_as_guess, use_neighbor_as_guess, start_from_point, multicore, position_order, continuum_map, prevalidate_guesses, maskmap, **fitkwargs)
   1093                                      " error shape don't match that of the "
   1094                                      "parameter cubes")
-> 1095                 if np.any(np.isnan(modelpars)) or np.any(np.isnan(modelerrs)):
   1096                     self.parcube[:,int(y),int(x)] = np.nan
   1097                     self.errcube[:,int(y),int(x)] = np.nan

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

I also tried to run the original example from the the website with the example data, still got the same error. Not sure why. Thank you very much in advance.

Cheers

Yuan

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17

Most upvoted comments

OK, pushed a new change, try again

The problem is that this isn’t being caught by any regression tests, which I don’t understand yet…

The issue was caused by this change: https://github.com/pyspeckit/pyspeckit/pull/291