CutoutPath

class lsst.analysis.ap.CutoutPath(root, chunk_size=None, subdirectory='images')

Bases: object

Manage paths to image cutouts with filenames based on diaSourceId.

Supports local files, and id-chunked directories.

Parameters:
rootstr

Root file path to manage.

chunk_sizeint, optional

At most this many files per directory. Must be a power of 10.

subdirectorystr, optional

Name of the subdirectory

Raises:
RuntimeError

Raised if chunk_size is not a power of 10.

Methods Summary

__call__(id, filename)

Return the full path to a diaSource cutout.

directory(id)

Return the directory to store the output in.

exists(id, filename)

Return True if the file already exists.

mkdir(id)

Make the directory tree to write this cutout id to.

Methods Documentation

__call__(id, filename)

Return the full path to a diaSource cutout.

Parameters:
idint

Source id to create the path for.

filename: `str`

Filename to write.

Returns:
pathstr

Full path to the requested file.

directory(id)

Return the directory to store the output in.

Parameters:
idint

Source id to create the path for.

Returns:
directory: str

Directory for this file.

exists(id, filename)

Return True if the file already exists.

Parameters:
idint

Source id to create the path for.

filename: `str`

Filename to write.

Returns:
existsbool

Does the supplied filename exist?

mkdir(id)

Make the directory tree to write this cutout id to.

Parameters:
idint

Source id to create the path for.