tree Reference

Tree

class tree.tree.Tree(*args, **kwargs)[source]

Bases: object

Initialize the sdss tree object

This class provides Python programmatic access to the SDSS tree envionment structure

Parameters:
  • key (str|list) – A section or list of sections of the tree to add into the local environment
  • uproot_with (str) – A new TREE_DIR path used to override an existing TREE_DIR environment variable
Variables:
  • treedir (str) – The directory of the tree
  • environ (dict) – The fully loaded SDSS config file
addPathsToOS(key=None)[source]

Add the paths in tree environ into the os environ

This code goes through the tree environ and checks for existence in the os environ, then adds them

Parameters:key (str) – The section name to check against / add
branchOut(limb=None)[source]

Set the individual section branches

This adds the various sections of the config file into the tree environment for access later. Optically can specify a specific branch.

Parameters:branch (str/list) – The name of the section of the config to add into the environ or a list of strings
checkPaths(paths)[source]

Check if the path is in the os environ, and if not add it

Paramters:
paths (OrderedDict):
An ordered dict containing all of the paths from the a given section, as key:val = name:path
getPaths(key)[source]

Retrieve a set of environment paths from the config

Parameters:key (str) – The section name to grab from the environment
Returns:self.environ[newkey] (OrderedDict) – An ordered dict containing all of the paths from the specified section, as key:val = name:path
loadConfig()[source]

loads the sdsswork config file

setRoots(uproot_with=None)[source]

Set the roots of the tree in the os environment

Parameters:uproot_with (str) – A new TREE_DIR path used to override an existing TREE_DIR environment variable