Model for equatorial vertical drift based on paper published by Scherliess & Fejer.
Project description
SFvdriftPy
SFvdriftPy is a Python package for modeling equatorial vertical drift as a function of solar local time, longitude, day of the year, and solar flux. This package models the vertical drift as described by Scherliess and Fejer (1999). The fortran code that this model has been refactored from is attributed to the sami2py development team.
Installation
To install the package from PyPI:
pip install SFvdriftPy
Quick Start
Importing SFvdriftPy
To begin, import the vdrift_model function, which is the main function for calculating vertical drifts:
from SFvdriftPy import vdrift_model
Example Usage
The vdrift_model function calculates the equatorial vertical drift for given parameters.
Parameters:
xt(float): Solar local time (hours, in 0-24 range).xl(float): Geographic longitude (degrees).param(list): A list of two elements,[doy, f107]:doy(int): Day of the Year (DOY).f107(float): Solar flux (F10.7 index).
Example Code
import numpy as np
from SFvdriftPy import vdrift_model
# Example input parameters
xt = 12.0 # Solar local time (hours)
xl = 150.0 # Geographic longitude (degrees)
doy = 100 # Day of the year (e.g., April 10th)
f107 = 150 # Solar flux (F10.7 index)
# Calculate vertical drift
param = [doy, f107]
vertical_drift = vdrift_model(xt, xl, param)
print(f"Vertical drift at SLT={xt}, longitude={xl}, DOY={doy}, F10.7={f107} is {vertical_drift:.2f} m/s")
Functions Overview
vdrift_model
The main function to calculate the equatorial vertical drift.
Parameters:
xt(float): Solar local time (0-24 hours).xl(float): Geographic longitude in degrees.param(list): Contains[DOY, F10.7], whereDOYis the day of the year, andF10.7is the solar flux index.
Returns:
float: The vertical drift in meters per second (m/s).
g
The seasonal and solar flux-dependent weighting function, which adjusts for seasonal and flux conditions in the drift calculations.
Parameters:
param(list): Contains[DOY, F10.7]for day of the year and solar flux.xl(float): Geographic longitude in degrees.
Returns:
np.array: Array of function weights for seasonal and solar flux adjustments.
bspl4
A B-spline function used to generate values for both time and longitude as part of the main model.
Parameters:
i(int): Index for current spline interval.x1(float): The input value (e.g., SLT or longitude) for the spline calculation.t_knots(np.array): Knot points array for B-spline intervals.
Returns:
float: B-spline interpolated value for the input.
Plotting Example
Here’s how to plot the vertical drift across a range of solar local times for a fixed day of the year and solar flux:
import matplotlib.pyplot as plt
import numpy as np
from SFvdriftPy import vdrift_model
# Define parameters
xl = 150.0 # Geographic longitude in degrees
doy = 100 # Day of the year
f107 = 150 # Solar flux
slt_range = np.linspace(0, 24, 100) # Solar local time range
# Calculate vertical drifts
drifts = [vdrift_model(slt, xl, [doy, f107]) for slt in slt_range]
# Plot the result
plt.figure(figsize=(10, 5))
plt.plot(slt_range, drifts)
plt.xlabel('Solar Local Time (hours)')
plt.ylabel('Vertical Drift (m/s)')
plt.title(f'Equatorial Vertical Drift on DOY={doy} for F10.7={f107}')
plt.grid(True)
plt.show()
References
Part of this work uses the SAMI2 ionosphere model originally written and developed by the Naval Research Laboratory. When referring to this package, please additionally cite the following sources:
• Scherliess, L., & Fejer, B. G. (1999). “Radar and satellite global equatorial F region vertical drift model.” Journal of Geophysical Research: Space Physics, 104(A4), 6829–6842. https://doi.org/10.1029/1998JA900062
• Huba, J. D., Joyce, G., & Krall, J. (2000). “SAMI2 (SAMI2 is Another Model of the Ionosphere): A new low-latitude ionosphere model.” Journal of Geophysical Research: Space Physics, 105(A10), 23035-23053. https://doi.org/10.1029/2000JA000035
• Klenzing, J., Stoneback, R., Sanny, J., Lingerfelt, E., & Heelis, R. (2019). “sami2py: A Python implementation of the SAMI2 model.” https://doi.org/10.5281/zenodo.2875800.
License
This project is licensed under the MIT License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sfvdriftpy-0.1.1.tar.gz.
File metadata
- Download URL: sfvdriftpy-0.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c64de41086a7145113d1d5ad66a8e52cb1b63d08134cd1c7cf8b71a5215284fb
|
|
| MD5 |
061012d9701f020dbae59c588aa797cc
|
|
| BLAKE2b-256 |
42a4a8511f101a24e1e208704f26ed49f3dd77f2c1c04c8e04dafba8602cbccb
|
File details
Details for the file SFvdriftPy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: SFvdriftPy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c66dc9a38e154652f9b27a78c6f85f90a57bdb53f1e025144fbaf9e8d862b3a
|
|
| MD5 |
af4b584bb9b9fe0f8d75c368aa6e17de
|
|
| BLAKE2b-256 |
2ff18f7e43ab48a2a92c1675bdfbbc1882d4eb17101573cc71194f7123c31b5b
|