Code Reference

SWPy Request

swpy.swds.request Module

The acquisition module provides functions for users to collect data provided by the Korea Astronomy and Space Science Institute (KASI). Through this module, users can search, download, and process data from various KASI data sources.

Classes

Stack

A class that implements the stack data structure.

Downloader

A class that downloads and outputs data.

Primary Functions

These functions provide a user interface and are used to search for data. You will mainly use these functions to utilize the swpy package.

data_info()

Allows users to interact and search for data.

search(table_name, data_id, start_time, end_time=None)

Searches for specific data, prints the data, and returns a Downloader object.

Sub Functions

These functions are primarily called within the data_info and search functions to perform various tasks.

remove_from_end(url, pop_str)

Removes a specific substring from the end of a URL string.

fetch_content(url)

Fetch JSON data from a given URL.

print_data(data)

Print the time and namevalues from the given dictionary.

show_table(url)

Print the list of tables from the given URL and update the URL.

show_data_id(url)

Print the list of data IDs from the given URL and update the URL.

show_start_time(url)

Print the start time from the given URL and update the URL.

show_data_list(url)

Print the list of data from the given URL, update the URL, and download the file.

SWPy Dataset

swpy.swds.dataset.utilities Module

The utilities module builds the fundamental structure of the SWPy dataset and defines the 'Data' and 'Header' components of the dataset. Additionally, it includes integrated data opening and plotting functionalities. This module includes files such as base_dataset.py, header.py, all.py, readfile.py, and plot.py, each of which is responsible for specific functions.

base_dataset.py

BaseDataset

Receives the path of a data file and provides a structure for storing and processing various information related to the data.

header.py

Header

Manages the file's header based on a dictionary.

all.py

All

Stores the 'Header' and the 'Actual Data'.

readfile.py

Processor

The class that reads data from the database in conjunction with 'swds.request.request'.

data_local (filepath)

The function that reads data from the local.

plot.py

BasePlot

A method that receives the data processed by the parsing_data function and plots it.

swpy.swds.dataset.goes Module

This module provides functionality to NOAA's GOES (Geostationary Operational Environmental Satellite) data. It specifically focuses on handling data from Particle, X-ray, and Geomagnetic.

ParticleDatasetFir, ParticleDatasetSec, XrayDatasetFir, XrayDatasetSec, GeoMagDatasetFir, and GeoMagDatasetSec, are subclasses of GOESDataset, which inherits from BaseDataset in swpy.swds.dataset.utilities. As a result, ensuring that each parent class is well-defined will facilitate smooth data loading.

Starting from 2021, the file content changes, so the data is assigned to different classes based on the year to parse it correctly.

Note
  • Data up to 2020: The suffix 'Fir' is added.

  • Data from 2021: The suffix 'Sec' is added.

Classes

GOESDataset

Initialize the GOESDataset with the given file array, loading and parsing its content.

ParticleDatasetFir

Represents save details of Particle Dataset before 2021.

ParticleDatasetSec

Represents save details of Particle Dataset after 2021.

XrayDatasetFir

Represents save details of X-ray Dataset before 2021.

XrayDatasetSec

Represents save details of X-ray Dataset after 2021.

GeoMagDatasetFir

Represents save details of Geomagnetic Dataset before 2021.

GeoMagDatasetSec

Represents save details of Geomagnetic Dataset after 2021.

Functions

goes_open (data_all)

Read the header containing the file name, and assign the observation object and observation date.

swpy.swds.dataset.ace Module

This module provides functionality to NOAA's ACE (Advanced Composition Explorer) data. It specifically focuses on handling data from SWEPAM (Solar Wind Electron Proton Alpha Monitor), MAG (Magnetometer), and SIS (Solar Isotope Spectrometer).

SWEPAMDataset, MAGDataset, and SISDataset are subclasses of ACEDataset, which inherits from BaseDataset in swpy.swds.dataset.utilities. As a result, ensuring that each parent class is well-defined will facilitate smooth data loading.

Classes

ACEDataset

Initialize the ACEDataset with the given file array, loading and parsing its content.

SWEPAMDataset

Represents save details of SWEPAM Dataset.

MAGDataset

Represents save details of MAG Dataset.

SISDataset

Represents save details of SIS Dataset.

Functions

ace_open (data_all)

Read the header containing the file name, and assign the observation target and observation date.