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

A solvable requests error #21

Closed awe2 closed 1 year ago

awe2 commented 1 year ago

This looks like a requests error, but if you look closely we can see the URL its trying to access is: https://catalogs.mast.stsci.edu/api/v0.1/panstarrs/dr1/stack.csv?ra=nan&dec=nan&radius=0.002777777777777778

which fails because ra = nan and dec = nan

Most of this is stdout, scroll to bottom for stack-trace. Including because warning mean of empty slice might be informative?

Couldn't find where you want to save GHOST. Setting location to package path...
GHOST database already exists in the install path!
100 transients not found in GHOST by name, trying a coordinate search...
100 transients not found in GHOST by name or coordinates, manually associating...
No NED radius found for 3 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 31 GLADE galaxies.
No NED radius found for 5 GLADE galaxies.
No NED radius found for 2 GLADE galaxies.
No NED radius found for 22 GLADE galaxies.
 /people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 3 GLADE galaxies.
No NED radius found for 31 GLADE galaxies.
No NED radius found for 2 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 9 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 25 GLADE galaxies.
No NED radius found for 3 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 4 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 1 GLADE galaxies.
No NED radius found for 4 GLADE galaxies.
No NED radius found for 21 GLADE galaxies.
No NED radius found for 21 GLADE galaxies.
No NED radius found for 1 GLADE galaxies.
No NED radius found for 76 GLADE galaxies.
No NED radius found for 4 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 5 GLADE galaxies.
No NED radius found for 46 GLADE galaxies.
No NED radius found for 55 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 28 GLADE galaxies.
No NED radius found for 50 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 6 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 24 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 1 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 8 GLADE galaxies.
No NED radius found for 52 GLADE galaxies.
No NED radius found for 28 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 43 GLADE galaxies.
No NED radius found for 23 GLADE galaxies.
No NED radius found for 19 GLADE galaxies.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1215: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis, out=out, keepdims=keepdims)
No NED radius found for 33 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 27 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 5 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 6 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 39 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
No NED radius found for 0 GLADE galaxies.
Found 21 hosts in GLADE! See gladeDLR.txt for details.
Finding northern sources with Pan-starrs...
Processed 10 of 79 lines!
Processed 20 of 79 lines!
Processed 30 of 79 lines!
Processed 40 of 79 lines!
Processed 50 of 79 lines!
Processed 60 of 79 lines!
Processed 70 of 79 lines!
Associated fraction after quality cuts: 100.00%.
/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/stellarLocus.py:56: RuntimeWarning: All-NaN slice encountered
  df.loc[i,"7DCD"] = np.nanmin(np.array(temp_7DCD_1val))
Loading model Star_Galaxy_RealisticModel_GHOST_PS1ClassLabels.sav.
Removed 330 stars. We now have 539 candidate host galaxies.
Adding 21 sources from GLADE back into the catalog...
Warning! Host of ZTF21aajuerd is the hierarchical child of another object in Simbad, choosing parent as host instead...
Warning! Host of ZTF21aarohyu is the hierarchical child of another object in Simbad, choosing parent as host instead...
Warning! Host of ZTF21aakybgi is the hierarchical child of another object in Simbad, choosing parent as host instead...
Warning! Host of ZTF20actekrw is the hierarchical child of another object in Simbad, choosing parent as host instead...
Warning! Host of ZTF20acsesce is the hierarchical child of another object in Simbad, choosing parent as host instead...
Warning! Host of ZTF20abyzomt is the hierarchical child of another object in Simbad, choosing parent as host instead...
Traceback (most recent call last):
  File "/rcfs/projects/pinn4photoz/astroghost/example_script_idx0.py", line 36, in <module>
    hosts = getTransientHosts(snName, snCoord, snClass, verbose=True, starcut='gentle', ascentMatch=False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/ghostHelperFunctions.py", line 682, in getTransientHosts
    tempHost3 = findNewHosts(transientName_remaining, snCoord_remaining, snClass_remaining, verbose, starcut, ascentMatch, px, savepath)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/ghostHelperFunctions.py", line 927, in findNewHosts
    host_DF = checkSimbadHierarchy(host_DF, verbose=verbose)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/ghostHelperFunctions.py", line 241, in checkSimbadHierarchy
    a = ps1cone(tap_pandas.loc[0, 'ra'], tap_pandas.loc[0, 'dec'], 10./3600)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/PS1QueryFunctions.py", line 490, in ps1cone
    return ps1search(table=table,release=release,format=format,columns=columns,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/astro_ghost/PS1QueryFunctions.py", line 452, in ps1search
    r.raise_for_status()
  File "/people/enge625/.conda/envs/new_astro/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://catalogs.mast.stsci.edu/api/v0.1/panstarrs/dr1/stack.csv?ra=nan&dec=nan&radius=0.002777777777777778
alexandergagliano commented 1 year ago

@awe2 Looks like this was an issue with "Virtual Parents" in Simbad, entries with a reported hierarchy but with no coordinate information listed. I pushed a fix in the latest version of the code and will close this now, but feel free to re-open it if you're still running into this issue.