View on GitHub

mooda

Module for Ocean Observatory Data Analysis - Python package

WaterFrame.to_es(data_index_name=‘data’, metadata_index_name=‘metadata’, summary_index_name=‘summary’, qc_to_ingest=[0, 1], **kwargs)

Reference

Injestion of the WaterFrame into a ElasticSeach DB.

Parameters

Example

To reproduce the example, download the NetCDF file here and start an ElasticSearch service on localhost:9200.

import mooda as md

path_netcdf = 'MO_TS_MO_OBSEA_201402.nc'  # Path of the NetCDF file

# Create a WaterFrame from the EMODnet NetCDF file.
wf = md.read_nc_emodnet(path_netcdf)

# Add some mandatory metadata information
wf.metadata['network'] = 'emodnet'

# Execute the following line to create the ElaticSearch indexes (just the first time)
# md.es_create_indexes()

wf.to_es()

Output:

ATMS from MO_TS_MO_OBSEA_201402 ingested: 0 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 1 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 2 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 3 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 4 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 5 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 6 of 628
ATMS from MO_TS_MO_OBSEA_201402 ingested: 7 of 628
...

Return to mooda.WaterFrame.