gwdatafind.find_latest(site, frametype, urltype='file', on_missing='error', host=None, session=None, **request_kw)

Query a GWDataFind host for the latest file in a given dataset.

  • site (str) – single-character name of site to match

  • frametype (str) – name of dataset to match

  • urltype (str, optional) – URL scheme to search for

  • on_missing (str, optional) –

    what to do when the requested file isn’t found, one of:

    • 'error': raise a RuntimeError

    • 'warn': print a warning but return an empty list

    • 'ignore': return an empty list with no warnings

  • host (str, optional) – the URL/name of the GWDataFind host to query; if not given get_default_host() will be used to discover the default host.

  • session (requests.Session, optional) – the connection session to use; if not given, a igwn_auth_utils.requests.Session will be created on-the-fly

  • **request_kw – other keywords are passed to igwn_auth_utils.requests.get()


urls (list of str) – a list of URLs for the latest file found

  • requests.RequestsException – if the request fails for any reason

  • RuntimeError – if no latest file is found and on_missing="error" was given


>>> find_latest('H', 'H1_GWOSC_O2_4KHZ_R1', urltype='file', host=''))