ebachelet / pyLIMA

GNU General Public License v3.0
31 stars 8 forks source link

Example 5: function error "create_the_fake_telescopes" #56

Closed anibal-art closed 1 year ago

anibal-art commented 1 year ago

Hello, an error arise when I run the example 5. It's in the second example of the two telescopes OGLE and Spitzer.

in the line your_event.fits[-1].produce_outputs() the output is


TypeError Traceback (most recent call last) Cell In[146], line 1 ----> 1 your_event.fits[-1].produce_outputs()

File ~/anaconda3/envs/pyLIMA/lib/python3.9/site-packages/pyLIMA-0.8.3-py3.9.egg/pyLIMA/microlfits.py:1077, in MLFits.produce_outputs(self) 1072 def produce_outputs(self): 1073 """ Produce the standard outputs for a fit. 1074 More details in microloutputs module. 1075 """ -> 1077 outputs = microloutputs.fit_outputs(self) 1079 self.outputs = outputs

File ~/anaconda3/envs/pyLIMA/lib/python3.9/site-packages/pyLIMA-0.8.3-py3.9.egg/pyLIMA/microloutputs.py:348, in fit_outputs(fit) 344 # hexcolor[0] = '#000000' 346 if (fit.method == 'LM') or (fit.method == 'TRF'): 347 # prepare a list of fake telescopes --> 348 create_the_fake_telescopes(fit, fit.fit_results) 350 results = parameters_result(fit) 352 figure_trajectory, bokeh_trajectory = plot_geometry(fit)

File ~/anaconda3/envs/pyLIMA/lib/python3.9/site-packages/pyLIMA-0.8.3-py3.9.egg/pyLIMA/microloutputs.py:473, in create_the_fake_telescopes(fit, parameters) 469 telescope_time = fit.event.telescopes[telescope_index].lightcurve_flux[:, 0] 471 if fit.event.telescopes[telescope_index].location == 'Space': --> 473 if np.min(telescope_time)>np.min(reference_telescope.spacecraft_positions[:,0]): 474 time_minimum = np.min(reference_telescope.spacecraft_positions[:,0]) 475 else:

TypeError: list indices must be integers or slices, not tuple

I see that the problem is related with the function "create_the_fake_telescopes" because the telescope object "reference_telescope" has not the atribute "spacecraft_positions[:,0]" or rather it's a empty list.

how can I solve this? Thank you Anibal

ebachelet commented 1 year ago

Hi Annibal

I believe you using the master branch? This branch is currently no maintained and I recommend you try to install the Rebranding branch, i.e. the alpha version of pyLIMA 2.0, and you adapt your code slightly following the updated version of the example. We are happy to help on debugging.

anibal-art commented 1 year ago

Thank you Etienne. I will start work with the new version.