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.
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:
The Rate of TEC Index (ROTI) is calculated as the standard deviation of ROT over a given time window:
- The name RotiNat combines "ROTI" and "Nat," honoring Dr. Nat Gopalswamy for his encouragement and support during challenging years.
- 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.
Make sure you have the following libraries installed:
-pip install numpy
-pip install pandas
-pip install ospip install RotiNatpip3 install RotiNatThe 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 displayimport 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')
###############################################################################################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()- Email: tesfayphysics@gmail.com
- GitHub: https://github.com/Tesfay-Tesfu
The following badges highlight the licenses associated with this project:
- CAPES, UNIVAP
- GSFC, NASA Heliophysics Division
- COSPAR
- Institute for Space Astrophysics and Planetology (INAF), Italy
- Dr. Arian Ojeda Gonzalez
- Dr. Gebregiorgis Abrha, Dr. Yikdem Mengesha

