sczesla / PyAstronomy

A collection of astronomy-related routines in Python
152 stars 35 forks source link

no "weights" keyword argument in crosscorrRV #60

Closed caseylam closed 10 months ago

caseylam commented 10 months ago

I recently (two or so weeks ago) installed PyAstronomy with pip.

I'm trying to run the second example on this page (Example: Cross-correlation including weights): https://pyastronomy.readthedocs.io/en/latest/pyaslDoc/aslDoc/crosscorr.html

I get the error: TypeError: crosscorrRV() got an unexpected keyword argument 'weights'

In this version, there indeed does not appear to be a weights keyword, pyasl.crosscorrRV returns: <function PyAstronomy.pyasl.asl.crosscorr.crosscorrRV(w, f, tw, tf, rvmin, rvmax, drv, mode='doppler', skipedge=0, edgeTapering=None)>

However, the "weights" keyword does appear in this function in the github repo: https://github.com/sczesla/PyAstronomy/blob/master/src/pyasl/asl/crosscorr.py

Is the version of crosscorrRV on github the one I should be using?

Thanks!

sczesla commented 10 months ago

Hi, although your installation is recent, you may be experiencing a version issue. I released the latest version of PyAstronomy (0.20.0) only on 1. November, and this may, indeed, be the first version to contain the feature. You can check the version of your installation via (in the python console)

import PyAstronomy
PyAstronomy.__version__ 

If this shows a version earlier than 0.20.0, you can upgrade from PyPI by using (assuming you use pip)

pip install --upgrade PyAstronomy

Hope this resolves the issue, Stefan

caseylam commented 10 months ago

Thanks Stefan, the upgrade fixed it! I installed PyAstronomy literally the day before the latest release so I was on version 0.19.0.