uiucsn / astro_ghost

Galaxies HOsting Supernovae and other Transients (GHOST): A database of supernovae and the photometric and spectroscopic properties of their host galaxies.
2 stars 6 forks source link

getTransientHosts error #13

Closed mariaac3 closed 1 year ago

mariaac3 commented 1 year ago

Hello,

I just downloaded GHOST using pip install to find hosts for supernovae. I tried running some example code that works for Erik Peterson on an older version but I am getting the following error when using getTransientHosts.

RA=['14:35:23.056', '17:32:33.723', '15:38:10.150', '20:49:03.001', 
    '19:15:35.903', '15:02:45.909', '16:13:45.510', '15:38:11.563', 
    '23:48:18.228', '14:37:59.660', '16:14:03.750', '15:22:50.430']
DEC=['-13:39:14.71', '+15:44:09.17', '+04:46:50.41', '-31:43:51.86', 
     '+53:20:21.50', '+58:32:05.31', '+22:55:14.38', '+03:01:40.20', 
     '+33:08:56.28', '+09:23:18.74', '+14:16:57.50', '+16:36:21.78']
COORDS = [SkyCoord(r,d,unit=(u.hourangle,u.deg)) for r,d in zip(RA,DEC)]
CID=['SN2020kkc', 'SN2020kku', 'SN2020kpx', 'SN2020kqv', 
     'SN2020kru', 'SN2020krw', 'SN2020kyx', 'SN2020kzn', 
     'SN2020lfe', 'SN2020lil', 'SN2020lsc', 'SN2020lwj']
ghost_hosts = getTransientHosts(list(CID), COORDS, verbose=True, starcut='gentle', ascentMatch=False)
File ~/.local/lib/python3.10/site-packages/astro_ghost/ghostHelperFunctions.py:676, in findNewHosts(transientName, snCoord, snClass, verbose, starcut, ascentMatch, px, savepath, rad)
    674 host_DF = get_hosts(path, fn_SN, fn_Host, rad)
    675 halfLightSizes = getDR2_petrosianSizes(snRA_arr, snDEC_arr, rad)
--> 676 host_DF_new = host_DF.merge(halfLightSizes, on='objID')

You are trying to merge on object and int64 columns. If you wish to proceed you should use pd.concat

alexandergagliano commented 1 year ago

Hi @mariaac3 , thanks for letting me know! I'm working on a fix for this now.

alexandergagliano commented 1 year ago

The error should be resolved with a fresh pip install - please confirm on your end when you can and I'll close the issue!

mariaac3 commented 1 year ago

Everything is working, thank you!