Metadata-Version: 2.4
Name: csespy
Version: 2.0.0a0
Summary: Python package to read and process data from the CSES-01 and CSES-02 spacecraft
Author-email: Emanuele Papini <emanuele.papini@inaf.it>, Francesco Maria Follega <francesco.follega@unitn.it>, Davide Giordano <davide.giordano@unitn.it>
License: MIT
Project-URL: Homepage, https://github.com/anomalyco/csespy
Project-URL: Documentation, https://csespy.readthedocs.io
Project-URL: Repository, https://github.com/anomalyco/csespy.git
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aacgmv2
Requires-Dist: cartopy
Requires-Dist: flammkuchen
Requires-Dist: h5py
Requires-Dist: hdf5storage
Requires-Dist: lxml
Requires-Dist: matplotlib
Requires-Dist: numba
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyproj
Requires-Dist: pyWavelets
Requires-Dist: requests
Requires-Dist: scipy
Requires-Dist: scikit-image
Requires-Dist: termcolor
Requires-Dist: xarray
Requires-Dist: zarr
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Dynamic: license-file

# csespy

This repository contains a collection of python routines to read and process data from the CSES-01 spacecraft. This routines are designed to gather, process and store (optionally) payload observations in a given set of semiorbits, and to perform some basic analysis on the data.

It is intended for the internal use of the CSES-Limadou collaboration. Payload supported up to now are:
* EFD ULF/VLF/ELF (Electric Field Detector)
* SCM (Search Coil Magnetometer)
* HPM (High Precision Magnetometer)
* LAP (Langmuir Probe)
* PAP (Plasma Analyser Package)
* **HEPD (High Energy Particle Detector) *--> Support recently added***
* **HEPP-L, HEPP-H, HEPP-X (High Energy Package) *--> Support recently added***

Dependencies: matplotlib, skimage, mpl_toolkits, collections, scipy, copy, warnings, termcolor, numpy, h5py, flammkuchen, datetime

 NOTES: Meticulously drafted from an experimental package made on 30/03/2021 by Emanuele Papini :)


### Install ###

Simply download the repository in the desired folder to start using it.
If you have a PYTHONPATH already set, you can put the csespy folder directly there so that you can import the package from everywhere.

Authors: Emanuele Papini (EP) and Francesco Maria Follega (FMF)

### Files list ###

Files in this repos are named accordingly to their purpose.
* <ins>CSES_main.py</ins> : Contains the main class that is used as an interface for loading and processing of CSES data.
* <ins>CSES_core.py</ins> : Core routines/functions used to read the data.
* <ins>CSES_aux.py</ins> : Contains all auxiliary function for reading/manipulating data (e.g. filename parsing, naming convention, date conversion, reference frame conversion,...).
* <ins>CSES_raw.py</ins> : Routines to load the .h5 files "as it is" in their original format (RAW) without any manipulation (for advanced use and/or debugging).
* <ins>CSES_params.py</ins> : Contains the relevant parameters to properly read the files from the CSES mission.
* <ins>CSES_init.py</ins> : contains few simple instructions to initialize the environment. This requires (in its actual state) editing of the file depending on the machine and/or where data are stored.

In addition, the folder blombly contains a collection of routines directly taken from EP personal python library (named blombly) that are used in csespy.

### Usage ###

The main class allow the user to load data from the cses missions without the need of specifying any filename in principle.
It only requires the location of the folder containing all the .h5 files (named following the convention explained in the CSES-01 data manual) from the instruments. This folder either need to be organized in subfolders following a strict scheme, or simply need to contain the .h5 files of interest (see the __init__ method in the **CSES** class in CSES_main.py)

#### Example ####
Assuming csespy is in the PYTHONPATH, and that data of interest are stored in `/CSES_data/` and that they are not structured in subfolders, the following commands load the EFD ELF waveforms for the orbit 104311 (orbit 10431, night side)
```
import csespy
import pylab as plt

#initialize class and tell it what orbit it will load
css=csespy.CSES(path='/CSES_data/',orbitn='104311',unstructured_path=True) 

#load EFD ELF data
css.load_CSES('EFD_ELF') 

#plot the data
fig,ax = plt.subplots()
css.plot_payload('EFD_ELF',fig=fig,ax=ax)
plt.show()

```
This plot should appear

![EFD ELF orbit 10431(1)](./docs/Figure_EFD_104311.png "EFD ELF orbit 10431(1)")


### Contacts ###

Emanuele Papini - INAF, Istituto di Astrofisica e Planetologia Spaziali (emanuele.papini@inaf.it).

Francesco Maria Follega - TIFPA, Università di Trento (francesco.follega@unitn.it).

Davide Giordano - Università di Trento (davide.giordano@unitn.it).
