INNER CODE UNIT · Python
xmatch_cache_filename
jobovy/gaia_tools · gaia_tools/load/__init__.py:464
def xmatch_cache_filename(filePath,xcat,maxdist):
filename,fileExt= os.path.splitext(filePath)
cachePath= filename+'_xmatch_{}_maxdist_{:.2f}'.format(xcat.replace('/','_').replace(':','_'),maxdist)+'.pkl'
return cachePath
# Support to swap in astroNN into the APOGEE data
def _elemIndx(elem,dr=14):
"""Version of apogee.tools.elemIndx for internal use here, not as general"""
if dr == 14:
_ELEM_SYMBOL= ['c','ci','n','o','na','mg','al','si','p','s','k','ca',
'ti','tiii','v','cr','mn','fe','co','ni','cu','ge','ce',
'rb','y','nd']
else:
raise ValueError('The functionality you are attempting to use is only available for APOGEE DR14')
try:
return _ELEM_SYMBOL.index(elem.lower())
except ValueError:
raise KeyError("Element %s is not part of the APOGEE elements (can't do everything!) or something went wrong)" % elem)