samuelyeewl / specmatch-emp

Empirical SpecMatch
9 stars 8 forks source link

Library plot in docs #26

Open petigura opened 7 years ago

petigura commented 7 years ago

The documentation seem to refer to an old version of the library. We don't use the casagrande parameters any more.

image

petigura commented 7 years ago

@samuelyeewl:

I tried updating the plots in the docs by running quickstart.py. I was able to regenerate the library plot:

quickstart-library-labeled

But the quickstart.py The code failed here:

139                     if idx is not None:
140                         shift_specs.append(self.lib.get_spectrum(idx))
141     
142             # Use the bootstrap shift approach
143             self.target = shift.bootstrap_shift(self.target_unshifted, shift_specs,
144  ->                                             store=self.shift_data)
145     
146             self.shift_ref = shift_specs[self.shift_data['shift_reference']]
147     
148             self._shifted = True
149             return self.target

With the following error message.

Shifting spectrum HD190406
Attempting shift to spectrum NSO, median cross-correlation peak = 2.60
Traceback (most recent call last):
  File "/Users/petigura/anaconda/lib/python2.7/pdb.py", line 1314, in main
    pdb._runscript(mainpyfile)
  File "/Users/petigura/anaconda/lib/python2.7/pdb.py", line 1233, in _runscript
    self.run(statement)
  File "/Users/petigura/anaconda/lib/python2.7/bdb.py", line 400, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "quickstart.py", line 2, in <module>
    import pandas as pd
  File "/Users/petigura/anaconda/lib/python2.7/site-packages/specmatchemp/specmatch.py", line 144, in shift
    store=self.shift_data)
  File "/Users/petigura/anaconda/lib/python2.7/site-packages/specmatchemp/shift.py", line 56, in bootstrap_shift
    shift(targ_cut, ref, store=shift_data)
  File "/Users/petigura/anaconda/lib/python2.7/site-packages/specmatchemp/shift.py", line 260, in shift
    args=(center_pix, lags), loss='cauchy')
  File "/Users/petigura/anaconda/lib/python2.7/site-packages/scipy/optimize/_lsq/least_squares.py", line 775, in least_squares
    raise ValueError("Residuals are not finite in the initial point.")