Configuration#

Lightkurve uses Astropy’s configuration system for configurable parameters.

Users can set their defaults in their configuration file, defaulted at $HOME/.lightkurve/config/lightkurve.cfg.

Furthermore, they can also change the values at runtime via lightkurve.conf object.

The remaining specifics can be found in Astropy documentation.

Access configuration values#

conf

Configuration parameters for lightkurve.

config.get_cache_dir()

Determines the default Lightkurve cache directory name and creates the directory if it doesn't exist.

config.get_config_dir()

Determines the package configuration directory name and creates the directory if it doesn't exist.

Default Cache Directory Migration#

Starting from Lightkurve version 2.4.0, the default cache directory is at ~/.lightkurve/cache . The data files cached at the legacy location, ~/.lightkurve-cache, will not be used.

A warning is issued if the legacy ~/.lightkurve-cache directory still exists.

Migration suggestions for handling various scenarios:

  • To use the existing data files cached, move all the contents under ~/.lightkurve-cache to ~/.lightkurve/cache, and remove ~/.lightkurve-cache directory itself.

  • If you need to use older version of Lightkurve, e.g., because of the requirements of other packages / applications, you can:

    1. Keep the cache at the legacy location ~/.lightkurve-cache

    2. Instruct current Lightkurve to use the legacy location. In the user’s lightkurve.cfg, add:

      [config]

      cache_dir = /<your-home-directory>/.lightkurve-cache

    3. The warning will no long appear once a custom `cache_dir` is specified.

  • To suppress the warning for any reason, you can set warn_legacy_cache_dir in the user’s lightkurve.cfg.

    [config]

    warn_legacy_cache_dir = False