Jusas / astrometry-api-lite

Astrometry.net API lite
MIT License
15 stars 4 forks source link

Cast Error #5

Closed fenriques closed 6 years ago

fenriques commented 6 years ago

hi I'm using astrometry-api-lite from client application MountWizzard. When I'm trying to solve for an image I get an error: TypeError: Cannot cast ufunc add output from dtype('int32') to dtype('uint16') with casting rule 'same_kind' Seems the format of my fit file name is not correct. Attached the full dump of the manager. astrometry-api-lite_dump.log

Jusas commented 6 years ago

Hi fenriques, this is a known issue that should have been fixed in the latest release. What version are you running? The latest is 1.2.0. You can check your version by running this in bash (in your installation directory)

cat package.json|grep \"version\":

The bottom line issue is that you're most likely using an old version of the astropy package (and possibly astrometry-api-lite as well). The installer should automatically detect the astropy version for you and install a newer version for you (2.0.6) if it detects that you have an older version.

You can manually check which version you have installed by running

pip --disable-pip-version-check show astropy|grep ^Version

in bash. If it's 1.x, you'll need to upgrade it. To do this, uninstall the old version,

sudo pip --disable-pip-version-check uninstall astropy

and install the new one

sudo pip --disable-pip-version-check install astropy==2.0.6

This should do the trick. Also if you're not running the latest version of astrometry-api-lite, I strongly recommend upgrading it.

fenriques commented 6 years ago

hi Jusas, should be all up to date, did the installation just yestarday: cat package.json|grep \"version\": -> "version": "1.2.0" pip --disable-pip-version-check show astropy|grep ^Version -> Version: 3.0.3

ferrante

Jusas commented 6 years ago

I think the issue is that Astropy 3.0.3 requires Python 3, while astrometry.net uses Python 2.7 - so underneath, the packages your solver is using is actually the packages it can use with Python 2.7, and that version is likely outdated.

Try running pip2 --disable-pip-version-check show astropy|grep ^Version and let me know if it outputs a different version - I don't know much about Python but I think pip2 is explicitly for Python 2 packages.

fenriques commented 6 years ago

you are right. pip2 --disable-pip-version-check show astropy|grep ^Version Outputs: Version: 1.1.1 So I updated astropy for Python 2.7 only: sudo pip2 --disable-pip-version-check install astropy==2.0.6 as the client I'm using (MountWizzard3) is not compatible with 2.0.6 and requires astropy v 3.0.3

Problem solved! I would put it in the installation notes somewhere. Thanks Ferrante

Jusas commented 6 years ago

Yeah, this was oversight on my part. I should update the installer to explicitly invoke pip2 when checking and installing Python packages. Nice to know!