Skip to main content

tools-python

Additional tools to support hapiclient, including merge, etc. Currently consists of 'merge_hapi()' and 'hapi_to_df()'. Cloud HAPI coming soon. Assuming you have fetched 2 HAPI datasets and their metadata using hapiclient ( dataA, metaA and dataB, metaB):

merged_data, merged_meta = hapiutils.merge_hapi(dataA, metaA, dataB, metaB, round_to_sec=True)

Useful to feed into hapi-nn (see https://github.com/hapi-server/application-neuralnetwork-python)

Also, you can cast HAPI data into a Pandas dataframe with:

hapidf = hapi_to_df(dataA)

Full example:

from hapiclient import hapi
from hapiplot import hapiplot
import hapiutils

opts = {'logging': False, 'usecache': True, 'cachedir': './hapicache' }
start      = '2013-01-01T00:00:54Z'
stop       = '2013-01-01T06:00:54.000Z'
serverA, datasetA, parametersA = 'https://cdaweb.gsfc.nasa.gov/hapi', 'OMNI2_H0_MRG1HR', 'DST1800'
serverB, datasetB, parametersB = "https://imag-data.bgs.ac.uk/GIN_V1/hapi", "cki/best-avail/PT1M/hdzf", "Field_Vector"

dataA, metaA = hapi(serverA, datasetA, parametersA, start, stop, **opts)
dataB, metaB = hapi(serverB, datasetB, parametersB, start, stop, **opts)
newAB, metaAB = hapiutils.merge_hapi(dataA, metaA, dataB, metaB, True)
hapiplot(newAB, metaAB)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hapiutils-0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hapiutils-0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file hapiutils-0.1.tar.gz.

File metadata

  • Download URL: hapiutils-0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for hapiutils-0.1.tar.gz
Algorithm Hash digest
SHA256 d3c9504b0991ffc0b99acde1f4be5d6d912eb4273ef2ac021d84340225880cfa
MD5 c403b8084c0e20864d54c2779dc2a52e
BLAKE2b-256 7050aa82ea551ebf1c8024d47efb4f9128b0cebcaa59b6603e22d02ae6c37e1d

See more details on using hashes here.

File details

Details for the file hapiutils-0.1-py3-none-any.whl.

File metadata

  • Download URL: hapiutils-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for hapiutils-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd94bb642d6c111575352e6a591add9af7d0c628f8fafc822bc6681cbc82d651
MD5 dc1e51bcaa3f8b0887fa167e0c6e31b3
BLAKE2b-256 ec0dd70c3c5963dfd00c42bd51042c419b07ca2c20a5232a6aba59f9df61ba61

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page