Utility to help downloading spice kernels.

Will download local copy of kernels with same directory structure as on Use planetmapper.set_kernel_path() to choose the location that the kernels are downloaded to.

These functions can be used to download a set of URLS. For example:

from planetmapper.kernel_downloader import download_urls

# Download all kernel files in generic_kernels/pck

# Download specific kernel file

# Download multiple sets of kernel files
planetmapper.kernel_downloader.download_urls(*urls: str, **kwargs) None[source]

Download data from and save locally.

urls can either be a the url of a single kernel, or the index page containing multiple kernels.

If a single kernel, download the kernel using download_kernel().

If an index page, download all first-level files using download_kernels_from_webpage().

planetmapper.kernel_downloader.download_kernels_from_webpage(index_url: str, **kwargs) None[source]

Download all first-level kernels listed in the page given by index_url.

URL must be on This will break if JPL changes the format of the webpage.


This function will only download kernels found immediately on index_url. Kernels in nested folders must therefore be downloaded manually.

  • index_url – URL of index page on

  • **kwargs – passed to download_kernel().

planetmapper.kernel_downloader.download_kernel(url: str, force_download: bool = False, note: str = '') None[source]

Download single kernel given by url.

URL must be on By default will only download file if if does not already exist locally. Set force_download=True to override this check and download the file even if it already exists locally.

  • url – URL of kernel on

  • force_download – toggle overwriting already downloaded kernels.

  • note – string to include in progress message.

planetmapper.kernel_downloader.get_kernel_paths_from_webpage(index_url: str) list[str][source]

Get list of kernel urls from an index page on

This is a bit of a hack and will break if JPL changes the format of the webpage.


index_url – URL of webpage.


List of URL strings corresponding to kernels on the webpage.

planetmapper.kernel_downloader.download_file(url: str, local_path: str) None[source]

Download kernel file to local system.

  • url – URL of kernel file.

  • local_path – File path to save kernel file on local system.