A Python package for the fetching (and some processing) of eCallisto data via the eCallisto API.
Project description
Ecallisto NG
Ecallisto NG is a compact yet effective Python package designed to facilitate seamless interaction with the Ecallisto API.
The package is constructed in Python 3.9 and utilizes the requests
library to directly access the Ecallisto API via the link: https://v000792.fhnw.ch/api/redoc.
Installation
To install this package, clone this repository and use pip for installation. Execute the following command in your terminal:
pip install -e .
PyPI
Ecallisto NG is conveniently available on PyPI as well. To download, visit the following link: https://pypi.org/project/ecallisto-ng/
Example
Please have a look at the jupyter notebook under example
.
Usage
Here's a guide on how to use the different features of Ecallisto NG:
Data Fetching
Fetching data is easy using the get_data
function, housed under the ecallisto_ng.data_fetching.get_data
module. Here's an example:
from ecallisto_ng.data_fetching.get_data import get_data
parameters = {
"instrument_name": "austria_unigraz_01",
"start_datetime": "2021-03-01 06:30:00",
"end_datetime": "2021-03-07 23:30:00",
"timebucket": "15m",
"agg_function": "MAX",
}
df = get_data(**parameters)
Getting Data Availability
You can also check the availability of data using the get_tables
and get_table_names_with_data_between_dates
function, housed under the ecallisto_ng.data_fetching.get_information
module. Here's an example:
from ecallisto_ng.data_fetching.get_information import get_tables, get_table_names_with_data_between_dates
from datetime import datetime, timedelta
get_tables()[:5]
get_table_names_with_data_between_dates(
start_datetime=(datetime.now() - timedelta(hours=24)).strftime("%Y-%m-%d %H:%M:%S"),
end_datetime=datetime.now().strftime("%Y-%m-%d %H:%M:%S")
)
Plotting
Ecallisto NG provides basic plotting capabilities. Here's an example of how to generate a spectogram:
from ecallisto_ng.plotting.utils import fill_missing_timesteps_with_nan, plot_spectogram
df_filled = fill_missing_timesteps_with_nan(df)
plot_spectogram(df_filled, parameters["instrument_name"], parameters["start_datetime"], parameters["end_datetime"])
Spectogram editing
We also provide some basic functionalities to edit the spectogram. Here's how you can do it:
from ecallisto_ng.data_processing.utils import elimwrongchannels, subtract_constant_background, subtract_rolling_background
df = elimwrongchannels(df)
df = fill_missing_timesteps_with_nan(df)
df = subtract_constant_background(df)
df = subtract_rolling_background(df)
plot_spectogram(df, parameters["instrument_name"], parameters["start_datetime"], parameters["end_datetime"])
These simple commands allow you to easily manipulate spectogram data, enabling effective use of the Ecallisto API for your needs.
Be careful when using elimwrongchannels
after fill_missing_timesteps_with_nan
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ecallisto_ng-0.1.7.tar.gz
.
File metadata
- Download URL: ecallisto_ng-0.1.7.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d389e57d266eed9ef3d182bf830f9410acb0c3a47157122fb086af5ac085eb4 |
|
MD5 | 7ae52fdb5ea684add973e02337ee4f47 |
|
BLAKE2b-256 | cb99458e5db18c06113e4569e334e3250be126a5e671cefac909e394c3af70e7 |
File details
Details for the file ecallisto_ng-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: ecallisto_ng-0.1.7-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67729c4ddfa695784e18feb8a2a417cabaafb9eb6ed2a96e155ab22c6dbeef14 |
|
MD5 | c737b086648d0edce8eaf299c7c24c28 |
|
BLAKE2b-256 | 43a58b4cc0e2749c33cdaf153a40e4d2df83b81a38d55e946d7c3cc060127a55 |