rubin_sim.phot_utils.cache_lsst_seds(wavelen_min=None, wavelen_max=None, cache_dir=None)

Read all of the SEDs in sims_sed_library into a dict. Pickle the dict and store it in sims_phot_utils/cacheDir/lsst_sed_cache.p for future use.

After the file has initially been created, the next time you run this script, it will just use pickle to load the dict.

Once the dict is loaded, Sed.read_sed_flambda() will be able to read any LSST-shipped SED directly from memory, rather than using I/O to read it from an ASCII file stored on disk.

Note: the dict of cached SEDs will take up about 5GB on disk. Once loaded, the cache will take up about 1.5GB of memory. The cache takes about 14 minutes to generate and about 51 seconds to load on a 2014 Mac Book Pro.

if either of these are not None, then every SED in the cache will be
truncated to only include the wavelength range (in nm) between
wavelen_min and wavelen_max
cache_dir is a string indicating the directory in which to search for/write
the cache. If set to None, the cache will be in
$SIMS_SED_LIBRARY_DIR/lsst_sed_cache_dir/, which may be write-protected on
shared installations of the LSST stack. Defaults to None.