Skip to content

Conversation

@aburrell
Copy link
Owner

@aburrell aburrell commented Sep 17, 2025

Description

Added the Gussenhoven model to the available boundary models, partially addressing #153.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Added unit tests.

import ocbpy
import pandas as pds
import pysat
import pysatSpaceWeather as pysw

# Get the Hp30 to use instead of Kp (assumes is downloaded)
hp = pysat.Instrument(inst_module=pysw.instruments.sw_hpo, tag='now', inst_id='30min')
hp.load(year=2001, doy=1)

# Initialize the boundary object
guss = ocbpy.EABoundary(instrument='model', stime=pds.to_datetime(hp.index).to_pydatetime(), rfunc=ocbpy.boundaries.models.gussenhoven_equatorward_auroral_boundary, rfunc_kwargs={'kp': hp['Hp30'], 'model': 'circle'})
print(guss)

Yields:

EABoundary
Source instrument: MODEL
Boundary reference latitude: 64.0 degrees

48 records from 2001-01-01T00:00:00.000000000 to 2001-01-01T23:30:00.000000000

YYYY-MM-DD HH:MM:SS Phi_Centre R_Centre R
-----------------------------------------------------------------------------
2001-01-01 00:00:00 0.00 0.00 0.00
2001-01-01 00:30:00 0.00 0.00 0.00
...
2001-01-01 23:00:00 0.00 0.00 0.00
2001-01-01 23:30:00 0.00 0.00 0.00

Uses boundary function(s):
ocbpy.boundaries.models.gussenhoven_equatorward_auroral_boundary(**{'kp': np.float64(0.667), 'model': 'circle'})
ocbpy.boundaries.models.gussenhoven_equatorward_auroral_boundary(**{'kp': np.float64(0.667), 'model': 'circle'})
...
ocbpy.boundaries.models.gussenhoven_equatorward_auroral_boundary(**{'kp': np.float64(1.0), 'model': 'circle'})
ocbpy.boundaries.models.gussenhoven_equatorward_auroral_boundary(**{'kp': np.float64(1.333), 'model': 'circle'})

Now get the boundaries:

import numpy as np

mlt = np.arange(0, 24, 0.5)
guss.get_aacgm_boundary_lat(mlt)
print(guss.aacgm_boundary_lat[0])

Yields:

array([65.71174466, 65.53007864, 65.39205938, 65.30073565, 65.258141  ,
       65.26522825, 65.32183868, 65.42670714, 65.57750298, 65.77090494,
       66.00270673, 66.26794877, 66.56106993, 66.8760725 , 67.20669269,
       67.54656899, 67.88940071, 68.22909035, 68.5598645 , 68.8763698 ,
       69.17374269, 69.44765346, 69.69432686, 69.91054316, 70.09362431,
       70.24141032, 70.35223089, 70.42487709, 70.45857688, 70.45297768,
       70.40813782, 70.324528  , 70.2030425 , 70.04501884, 69.85226375,
       69.62708192, 69.37230351, 69.09130551, 68.7880219 , 68.4669374 ,
       68.13306057, 67.79187258, 67.44925001, 67.1113615 , 66.78454038,
       66.47513705, 66.18935693, 65.93309071])

Test Configuration

  • Operating system: OS X Ventura (Intel)
  • Version number: Python 3.10
  • Any details about your local setup that are relevant: develop branch of pysat

Checklist:

  • Make sure you are merging into the develop (not main) branch
  • My commits are formatted appropriately (following the SciPy/NumPy style)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Add a note to Changelog.rst, summarising the changes
  • Add yourself to AUTHORS.rst and .zenodo.json

Added the Gussenhoven model for the EAB to the list of models.
Added a summary of changes to the changelog.
Cast data as an array in case a list is input.
Added unit tests for the new model functions.
Removed extra whitespace.
Added the citation for the Gussenhoven EAB to the Citation section and the model description to the Models section.
Fixed a reference in the doc examples.
Fixed the test angle range.
The coveralls implementation broke on the mac OS.  Updated to a simpler method that will hopefully work now.
@aburrell
Copy link
Owner Author

Turns out coveralls is just broken for mac right now: coverallsapp/github-action#248

@aburrell aburrell added this to the v1.0.0 milestone Sep 18, 2025
@aburrell aburrell merged commit 67ee049 into develop Sep 18, 2025
53 of 77 checks passed
@aburrell aburrell deleted the gussenhoven_model branch September 18, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants