argopy.stores.index.spec.ArgoIndexStoreProto

argopy.stores.index.spec.ArgoIndexStoreProto#

class ArgoIndexStoreProto(host: str | None = None, index_file: str = 'ar_index_global_prof.txt', convention: str | None = None, cache: bool = False, cachedir: str = '', timeout: int = 0, **kwargs)[source]#
__init__(host: str | None = None, index_file: str = 'ar_index_global_prof.txt', convention: str | None = None, cache: bool = False, cachedir: str = '', timeout: int = 0, **kwargs)[source]#

Create an Argo index store

Parameters:
  • host (str, optional, default=OPTIONS["gdac"]) –

    Local or remote (http, ftp or s3) path to a dac folder (compliant with GDAC structure).

    This parameter takes values like:

    • http or https for https://data-argo.ifremer.fr

    • us-http or us-https for https://usgodae.org/pub/outgoing/argo

    • ftp for ftp://ftp.ifremer.fr/ifremer/argo

    • s3 or aws for s3://argo-gdac-sandbox/pub/idx

    • a local absolute path

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

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

    This parameter takes values like:

    • core or ar_index_global_prof.txt

    • bgc-b or argo_bio-profile_index.txt

    • bgc-s or argo_synthetic-profile_index.txt

    • aux or etc/argo-index/argo_aux-profile_index.txt

    • meta or ar_index_global_meta.txt

    • a local absolute path toward a file following an Argo index convention. When using a local file, you need to set the convention followed by the file.

  • convention (str, default: None) –

    Set the expected format convention of the index file.

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

    This parameter takes values like:

    • core or ar_index_global_prof

    • bgc-b or argo_bio-profile_index

    • bgc-s or argo_synthetic-profile_index

    • aux or argo_aux-profile_index

    • meta or ar_index_global_meta

  • 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 store

cachepath(path)

Return path to a cached file

clear_cache()

Clear cache registry and files associated with this store instance.

copy([deep])

Returns a copy of this ArgoIndex instance

iterfloats([index, chunksize])

Iterate over unique Argo floats in the full index or search results

load([nrows, force])

Load an Argo-index file content in memory

read_dac_wmo([index])

Return a tuple of unique [DAC, WMO] pairs from the index or search results

read_domain()

Read the space/time domain of the index

read_files([index])

Return file paths listed in index or search results

read_params()

Return list of unique PARAMETERs in index or search results

read_wmo()

Return list of unique WMOs in index or search results

records_per_wmo()

Return the number of records per unique WMOs in index or search results

run()

Execute index search query (internal use)

search_cyc(CYCs[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.cyc()

search_lat_lon(BOX[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.lon_lat()

search_lat_lon_tim(BOX[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.box()

search_parameter_data_mode(PARAMs[, ...])

Deprecated: this method is replaced by ArgoIndex().query.parameter_data_mode()

search_params(PARAMs[, logical, nrows])

Deprecated: this method is replaced by ArgoIndex().query.params()

search_profiler_label(profiler_label[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.profiler_label()

search_profiler_type(profiler_type[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.profiler_type()

search_tim(BOX[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.date()

search_wmo(WMOs[, nrows])

search_wmo_cyc(WMOs, CYCs[, nrows])

Deprecated: this method is replaced by ArgoIndex().query.wmo_cyc()

to_dataframe([nrows, index, completed])

Return index or search results as pandas.DataFrame

to_indexfile()

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

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 (pandas or pyarrow)

cname

Search query as a pretty formatted string

convention

Convention of the index (standard csv file name)

convention_columns

CSV file column names for the index convention

convention_supported

List of supported conventions

convention_title

Long name for the index convention

domain

Space/time domain of the index

ext

Storage file extension

files

File paths listed in search results

files_full_index

File paths listed in the index

index_path

Absolute path to the index file

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