lightkurve.config.get_cache_dir#
- lightkurve.config.get_cache_dir()[source]#
Determines the default Lightkurve cache directory name and creates the directory if it doesn’t exist. If the directory cannot be access or created, then it returns the current directory (
"."
).This directory is typically
$HOME/.lightkurve/cache
, but if the XDG_CACHE_HOME environment variable is set and the$XDG_CACHE_HOME/lightkurve
directory exists, it will be that directory. If neither exists, the former will be created and symlinked to the latter.The value can be also configured via
cache_dir
configuration parameter.- Returns
- cachedirstr
The absolute path to the cache directory.
Examples
To configure “/my_research/data” as the
cache_dir
, users can set it:in the user’s
lightkurve.cfg
file:[config] cache_dir = /my_research/data
at run time:
import lightkurve as lk lk.conf.cache_dir = '/my_research/data'
See configuration for more information.