spacepy.datamanager.DataManager

class spacepy.datamanager.DataManager(directories, file_fmt, descend=False, period=None)[source]

THIS CLASS IS NOT YET COMPLETE, doesn’t do much useful.

Will have to do something that allows the config file to specify regex and other things, and then just the directory to be changed (since regex, etc.

Parameters:
directorieslist

A list of directories that might contain the data

file_fmtstring

Regular expression that matches the files desired. Will also recognize strftime parameters %w %d %m %y %Y %H %M %s %j %U %W, all zero-pad. https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior Can have subdirectory reference, but separator should be unix-style, with no leading slash.

periodstring

Size of file; can be a number followed by one of d, m, y, H, M, s. Anything else is assumed to be “irregular” and files treated as if there are neither gaps nor overlaps in the sequence. If not specified, will be assumed to match one count of the smallest unit in the format string.

__init__(directories, file_fmt, descend=False, period=None)[source]

Methods

files_matching([dt])

Return all the files matching this file format

get_filename(dt)

Returns the filename corresponding to a particular point in time

files_matching(dt=None)[source]

Return all the files matching this file format

Parameters:
dtdatetime

Optional; if specified, match only files for this date.

Returns:
outgenerator

Iterates over every file matching the format specified at creation. Note this is specified in native path format!

get_filename(dt)[source]

Returns the filename corresponding to a particular point in time