Esempio n. 1
0
def setup_datafind_server_connection(cp, tags=None):
    """
    This function is resposible for setting up the connection with the datafind
    server.

    Parameters
    -----------
    cp : pycbc.workflow.configuration.WorkflowConfigParser
        The memory representation of the ConfigParser
    Returns
    --------
    connection
        The open connection to the datafind server.
    """
    if tags is None:
        tags = []

    if cp.has_option_tags("workflow-datafind",
                          "datafind-ligo-datafind-server", tags):
        datafind_server = cp.get_opt_tags("workflow-datafind",
                                        "datafind-ligo-datafind-server", tags)
    else:
        datafind_server = None

    return datafind_connection(datafind_server)
Esempio n. 2
0
def frame_paths(frame_type, start_time, end_time, server=None):
    #! FIXME: make this a pull request to use urltype in PyCBC frame module
    site = frame_type[0]
    connection = datafind_connection(server)
    times = connection.find_times(site, frame_type,
                                  gpsstart=start_time,
                                  gpsend=end_time)
    cache = connection.find_frame_urls(site, frame_type, start_time, end_time, urltype="file")
    paths = [entry.path for entry in cache]
    return paths
Esempio n. 3
0
def frame_paths(frame_type, start_time, end_time, server=None):
    #! FIXME: make this a pull request to use urltype in PyCBC frame module
    site = frame_type[0]
    connection = datafind_connection(server)
    times = connection.find_times(site,
                                  frame_type,
                                  gpsstart=start_time,
                                  gpsend=end_time)
    cache = connection.find_frame_urls(site,
                                       frame_type,
                                       start_time,
                                       end_time,
                                       urltype="file")
    paths = [entry.path for entry in cache]
    return paths