open_session¶
- daschlab.open_session(root: str = '.', source: str = '', interactive: bool = True, _internal_simg: str = '') Session[source]¶
Open or create a new daschlab analysis session.
- Parameters:
- rootoptional
str, default"." A path to a directory that will contain all of the data files associated with this analysis session. Overridden if source_name is specified.
- sourceoptional
str, default"" If specified, derive root by processing this value with the function
source_name_to_fs_name. See the examples below. The resulting name will be relative to the current directory and begin withdaschlab_.- interactiveoptional
bool, default True Whether this is an interactive analysis session. If True, various warnings and errors will be printed under the assumption that a human will read them, as opposed to raising exceptions with proper tracebacks.
- rootoptional
- Returns:
- An initialized
Sessioninstance.
- An initialized
Notes
It is possible to construct a
Sessiondirectly, but this function may perform additional, helpful initialization of the analysis environment. We can’t stop you from calling theSessionconstructor directly, but there should be no reason to do so.Examples
Open a session whose data are stored in a specific directory:
from daschlab import open_session sess = open_session(root="snia/1987a")
Open a session with a name automatically derived from a source name:
from daschlab import open_session source = "SN 1987a" sess = open_session(source=source) sess.select_target(name=source)