rachel3834 / robonet_tools

Suite of useful tools developed in the course of operating the ROME/REA Project
GNU General Public License v3.0
2 stars 0 forks source link

calibrate_photometry.py produces errors #3

Open ytsapras opened 5 years ago

ytsapras commented 5 years ago

Some errors I encountered when I run it: In vizier_tools.py, the print statement print qs should be converted to Python3 format.

Fixing that it fails on calibrate_photometry.py with the following Error report:

$ python calibrate_photometry.py /home/Tux/ytsapras/Data/RoboNet/ProcData/2017/pyDANDIA_1226_fl15_ip/ pyDANDIA_metadata.fits /home/Tux/ytsapras/Data/RoboNet/ProcData/2017/logs/ 17:51:34.41 -30:04:31.4 /home/Tux/ytsapras/Installed_Programs/anaconda3/lib/python3.7/site-packages/astropy/table/column.py:965: RuntimeWarning: invalid value encountered in greater return getattr(self.data, op)(other) /home/Tux/ytsapras/Installed_Programs/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py:664: UserWarning: Warning: 'partition' will ignore the 'mask' of the MaskedColumn. a.partition(kth, axis=axis, kind=kind, order=order) /home/Tux/ytsapras/Installed_Programs/anaconda3/lib/python3.7/site-packages/astropy/table/column.py:965: RuntimeWarning: invalid value encountered in less_equal return getattr(self.data, op)(other) /home/Tux/ytsapras/Installed_Programs/anaconda3/lib/python3.7/site-packages/astropy/table/column.py:965: RuntimeWarning: invalid value encountered in less return getattr(self.data, op)(other) Traceback (most recent call last): File "calibrate_photometry.py", line 673, in calibrate_photometry() File "calibrate_photometry.py", line 44, in calibrate_photometry match_index = match_stars_by_position(star_catalog,vphas_cat,log) File "calibrate_photometry.py", line 270, in match_stars_by_position log.info('Matched '+str(len(match_index))) TypeError: len() of unsized object

ytsapras commented 5 years ago

Hi Rache, I traced the error to a zip statement. For reference, I am using Python 3.7.1. The error occurs within match_stars_by_position() To fix it, I replaced: match_index = np.array(zip(ddx[det_index],vdx[cat_index])) with match_index = np.array(list(zip(ddx[det_index],vdx[cat_index])))

There are more zip statement in the code, so you may want to test those out too.

ytsapras commented 5 years ago

Also, raw_input should be changed to input throughout the code to make it Python 3 compatible.