Skip to main content

A package to calculate ROTI (Rate of TEC Index)

Project description

RotiNat is to calculate ROTI

RotiNat version 0.0.3 was a Python package for calculating the Rate of Total Electron Content Index (ROTI) from GPS TEC data. It is designed to aid ionospheric studies and space weather analysis. This package is developed by Tesfay-Tesfu (PhD student), under the supervision of Dr. Nat Gopalswamy (NASA Goddard Space Flight Center, Heliophysics Division) and Dr. Virginia Klausner (UNIVAP, Brazil). Their guidance and incredible support have been instrumental in this effort.


Mathematical Expressions:

Rate of TEC (ROT)

The Rate of Total Electron Content (ROT) is calculated as the difference in TEC values between two consecutive time points divided by the time interval:

Rate of TEC Index (ROTI)


Rate of TEC Index (ROTI)

The Rate of TEC Index (ROTI) is calculated as the standard deviation of ROT over a given time window:

Rate of TEC Index (ROTI)


Why RotiNat ?

  • The name RotiNat combines "ROTI" and "Nat," honoring Dr. Nat Gopalswamy for his encouragement and support during challenging years.

Features

  • Computes ROT (Rate of TEC) and ROTI (Rate of TEC Index) from TEC data.
  • Supports input from Cmn and other common data formats.
  • Provides easy-to-use functions for preprocessing and analysis.

Installation

Prerequisite Libraries

Make sure you have the following libraries installed:

-pip install numpy
-pip install pandas
-pip install os

Install the package directly from PyPI:

pip install RotiNat

Alternatively

pip3 install RotiNat

Importing Required Libraries

The following libraries are required for using RotiNat:

import os
import glob
import pandas as pd
import numpy as np
import tkinter as tk
from tkinter import filedialog
from tkinter import simpledialog
import ipywidgets as widgets
from IPython.display import display

Example Usage

Below is an example of how to use the RotiNat package using a single file:

import pandas as pd
import numpy as np
import os
from RotiNat import ROT30s, ROTI5m, ROTI_CAPES
import warnings
# Suppress runtime warnings from numpy
warnings.filterwarnings("ignore", category=RuntimeWarning, module="numpy")
###############################################################################################
# Define file path and parameters
file_path = "/YOURPATH/file_name.Cmn"
Ele_mask = 30  # You can change the Elevation mask based on your interest
skiprows = 5  # Number of lines to skip (This lines to skip after TEC Rinex processes using Gopi)

###############################################################################################
# Read the TEC data file
data = pd.read_csv(
    file_path,
    delim_whitespace=True,
    skiprows=skiprows,
    header=None,
    names=['MJdatet', 'Time', 'PRN', 'Az', 'Ele', 'Lat', 'Lon', 'Stec', 'Vtec', 'S4']
)
# Extract relevant columns
Time_sec = np.round(data['Time'].values * 3600).astype(int)  # Convert time from hours to seconds
tec = data['Vtec'].values  # Vertical TEC values
PRN = data['PRN'].values  # Satellite PRN
Ele = data['Ele'].values  # Elevation angles
Lon = data['Lon'].values  # Longitude values
Lat = data['Lat'].values  # Latitude values
###############################################################################################
# Calculate ROT30s (Rate of TEC at 30s intervals)
Time_sec_out, PRN_out, Ele_out, Lon_out, Lat_out, rot30s = ROT30s(
    Time_sec, PRN, Ele, Lon, Lat, Ele_mask, tec
)
# Calculate ROTI5m (Rate of TEC Index over 5 minutes)
Time_sec_out2, PRN_out2, Ele_out2, Lon_out2, Lat_out2, roti_5m = ROTI5m(
    Time_sec_out, PRN_out, Ele_out, Lon_out, Lat_out, Ele_mask, rot30s
)
###############################################################################################
if len(Time_sec_out2) > 0:
    # Create DataFrames for ROT30s and ROTI5m results
    ROT30s_data = pd.DataFrame({
        'Hour_UT': Time_sec_out / 3600,  # Convert seconds to hours
        'PRN': PRN_out,
        'Elev_deg': Ele_out,
        'Lon_deg': Lon_out,
        'Lat_deg': Lat_out,
        'ROT30s_TECU/min': rot30s
    })

    ROTI5m_data = pd.DataFrame({
        'Hour_UT': Time_sec_out2 / 3600,  # Convert seconds to hours
        'PRN': PRN_out2,
        'Elev_deg': Ele_out2,
        'Lon_deg': Lon_out2,
        'Lat_deg': Lat_out2,
        'ROTI5m_TECU/min': roti_5m
    })

    # Get the directory of the input file path
    directory = os.path.dirname(file_path)
    # Save the outputs
    ROT30s_data.to_csv(os.path.join(directory, 'ROT30s_data.Cmn'), sep='\t', index=False, float_format='%.4f')
    ROTI5m_data.to_csv(os.path.join(directory, 'ROTI5m_data.Cmn'), sep='\t', index=False, float_format='%.4f')
###############################################################################################

Applying RotiNat to Multiple Files in Two Folders (Disturbance and Quiet)

If you need to apply RotiNat for multiple files located in two different folders (e.g., Disturbance and Quiet), use the following:

# Just copy only this two lines and run it. Follow the pop-out interactive instructions
from RotiNat import ROTI_CAPES
ROTI_CAPES()

Contacts:


Badges

The following badges highlight the licenses associated with this project:

MIT License GPLv3 License AGPL License


Acknowledgements


References:

Project details


Download files

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

Source Distribution

RotiNat-0.0.3.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

RotiNat-0.0.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file RotiNat-0.0.3.tar.gz.

File metadata

  • Download URL: RotiNat-0.0.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for RotiNat-0.0.3.tar.gz
Algorithm Hash digest
SHA256 63a4ba74afd5a140a8feef3f57115324d48427c91cd80e4e0f26632244a76642
MD5 c481b9faaebf943c601786427b37a49f
BLAKE2b-256 5fac4137494288aba1c2ce6e2a45f862fa0c57d7c6e1987e03195fc1c0b5ebb5

See more details on using hashes here.

File details

Details for the file RotiNat-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: RotiNat-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for RotiNat-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b887a62f532baa81f3432e64a23e4cb1d8d70d6be7d863dc8ef918cf059aee39
MD5 fb464f3f3060b1ed914cb901b935845b
BLAKE2b-256 fd68577284e4c8e7c83e2d644ad19f64221e5729da931f008beac043a433cdd8

See more details on using hashes here.

Supported by

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