argopy.stores.argo_index_pd.indexstore_pandas#

class indexstore_pandas(host: str = 'https://data-argo.ifremer.fr', index_file: str = 'ar_index_global_prof.txt', convention: str | None = None, cache: bool = False, cachedir: str = '', timeout: int = 0)[source]#

Argo GDAC index store using pandas.DataFrame as internal storage format.

With this store, index and search results are saved as pickle files in cache

__init__(host: str = 'https://data-argo.ifremer.fr', index_file: str = 'ar_index_global_prof.txt', convention: str | None = None, cache: bool = False, cachedir: str = '', timeout: int = 0) object#

Create an Argo index file store

Parameters:
  • host (str, default: https://data-argo.ifremer.fr) – Local or remote (ftp or http) path to a dac folder (GDAC structure compliant). This takes values like: ftp://ftp.ifremer.fr/ifremer/argo, ftp://usgodae.org/pub/outgoing/argo or a local absolute path.

  • index_file (str, default: ar_index_global_prof.txt) –

    Name of the csv-like text file with the index.

    Possible values are standard file name: ar_index_global_prof.txt, argo_bio-profile_index.txt or argo_synthetic-profile_index.txt.

    You can also use the following shortcuts: core, bgc-b, bgc-s, respectively.

  • convention (str, default: None) –

    Set the expected format convention of the index file. This is useful when trying to load index file with custom name. If set to None, we’ll try to infer the convention from the index_file value.

    Possible values: ar_index_global_prof, argo_bio-profile_index, or argo_synthetic-profile_index.

    You can also use the keyword: core, bgc-s, bgc-b.

  • cache (bool, default: False) – Use cache or not.

  • cachedir (str, default: OPTIONS['cachedir']) – Folder where to store cached files

  • timeout (int, default: OPTIONS['api_timeout']) – Time out in seconds to connect to a remote host (ftp or http).

Methods

__init__([host, index_file, convention, ...])

Create an Argo index file store

cachepath(path)

Return path to a cached file

clear_cache()

Clear cache registry and files associated with this store instance.

load([nrows, force])

Load an Argo-index file content

read_params([index])

Return list of unique PARAMETERs in index or search results

read_wmo([index])

Return list of unique WMOs in search results

records_per_wmo([index])

Return the number of records per unique WMOs in search results

run([nrows])

Filter index with search criteria

search_cyc(CYCs[, nrows])

Search index for cycle numbers

search_lat_lon(BOX[, nrows])

Search index for a rectangular latitude/longitude domain

search_lat_lon_tim(BOX[, nrows])

Search index for a rectangular latitude/longitude domain and time range

search_parameter_data_mode(PARAMs[, ...])

Search index for profiles with a parameter in a specific data mode

search_params(PARAMs[, logical, nrows])

Search index for one or a list of parameters

search_tim(BOX[, nrows])

Search index for a time range

search_wmo(WMOs[, nrows])

Search index for floats defined by their WMO

search_wmo_cyc(WMOs, CYCs[, nrows])

Search index for floats defined by their WMO and specific cycle numbers

to_dataframe([nrows, index, completed])

Return index or search results as pandas.DataFrame

to_indexfile(outputfile)

Save search results on file, following the Argo standard index formats

Attributes

N_FILES

Number of rows in search result or index if search not triggered

N_MATCH

Number of rows in search result

N_RECORDS

Number of rows in the full index

backend

Name of store backend

cname

Return the search constraint(s) as a pretty formatted string

convention

Convention of the index (standard csv file name)

convention_supported

List of supported conventions

convention_title

Long name for the index convention

ext

Storage file extension

search_path

Path to search result uri

search_type

Dictionary with search meta-data

sha_df

Returns a unique SHA for a cname/dataframe

sha_h5

Returns a unique SHA for a cname/hdf5

sha_pq

Returns a unique SHA for a cname/parquet

shape

Shape of the index array

uri

List of URI from search results

uri_full_index

List of URI from index