asteca / ASteCA

Code for the ASteCA package.
http://asteca.github.io/
MIT License
18 stars 6 forks source link

DeprecationWarning in prep_plots.py #142

Closed Gabriel-p closed 9 years ago

Gabriel-p commented 9 years ago

Fix the following (probably related to the data file having 12 columns and being read as having 7):

...
Data added to output file.
/path/asteca-master/functions/out/prep_plots.py:20: DeprecationWarning: using a boolean instead of an integer will result in an error in the future
  return data[s < m]

!!! --> /L28.MAG could not be processed <-- !!!

Traceback (most recent call last):
  File "asteca.py", line 41, in main
    af(mypath, cl_file, ip_list, R_in_place)
  File "/path/asteca-master/functions/func_caller.py", line 183, in asteca_funcs
    ip_list, red_return, err_lst, bf_return)
  File "/path/asteca-master/functions/out/make_plots.py", line 72, in make_plots
    phot_x, phot_y)
  File "/path/asteca-master/functions/out/prep_plots.py", line 90, in diag_limits
    x_max_cmd, x_min_cmd = max(phot_x_s) + 0.5, min(phot_x_s) - 0.5
TypeError: 'numpy.float64' object is not iterable
Gabriel-p commented 9 years ago

http://stackoverflow.com/questions/26282266/numpy-deprecationwarning-on-boolean-indexing

Gabriel-p commented 9 years ago

The code crashed because L28 has 12 columns, not 6; ie: it's not a bug, the data was not correctly read.

The DeprecationWarning arises because s is not an array since mdev is the float 0. Made some changes so the code will push through this.