Skip to content

Added a boundary models#150

Merged
aburrell merged 18 commits intodevelopfrom
boundary_models
Jun 30, 2025
Merged

Added a boundary models#150
aburrell merged 18 commits intodevelopfrom
boundary_models

Conversation

@aburrell
Copy link
Owner

@aburrell aburrell commented Jun 30, 2025

Description

Fixes #124 by adding an empirical model for the OCB, and two different equatorward boundaries based off of northern hemisphere all-sky imager data. This is an older model, but creates a framework for adding newer auroral boundary models.

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

Added unit tests, integration tests, and examples in the documentation.

import datetime as dt
import ocbpy

ocb = ocbpy.OCBoundary(instrument="model", hemisphere=1, stime=[dt.datetime(2000, 1, 1, i) for i in range(3)], rfunc=ocbpy.boundaries.models.starkov_auroral_boundary, rfunc_kwargs={"al": [ -10, -60, -100], "bnd": "ocb"})
print(ocb)

This yeilds:

OCBoundary
Source instrument: MODEL
Boundary reference latitude: 74.0 degrees

3 records from 2000-01-01 00:00:00 to 2000-01-01 02:00:00

YYYY-MM-DD HH:MM:SS Phi_Centre R_Centre R
-----------------------------------------------------------------------------
2000-01-01 00:00:00 0.00 0.00 0.00
2000-01-01 01:00:00 0.00 0.00 0.00
2000-01-01 02:00:00 0.00 0.00 0.00

Uses boundary function(s):
ocbpy.boundaries.models.starkov_auroral_boundary(**{'al': -10, 'bnd': 'ocb'})
ocbpy.boundaries.models.starkov_auroral_boundary(**{'al': -60, 'bnd': 'ocb'})
ocbpy.boundaries.models.starkov_auroral_boundary(**{'al': -100, 'bnd': 'ocb'})

Test Configuration

  • Operating system: OS X Big Sur
  • 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

aburrell added 18 commits June 24, 2025 15:30
Added the Starkov boundary model to a new model file under boundaries.
Began adjusting the boundary classes to accept model input, starting with OCBoundary by:
- adjusting inputs for `instrument`, `stime`, `rfunc`, and `rfunc_kwargs` to permit initialization with a mathematical model function,
- moving hidden methods to the same section of the class,
- moving the logic reformatting the `rfunc` and `rfunc_kwargs` input into a new hidden method,
- added more logic to reform `rfunc_kwargs` inputs for easier model input specification,
- created a method for initializing the data to be ready for model input, and
- adjusted the `load` method to call hidden methods for loading based on whether the boundaries are provided by an instrument or a model.
Added a summary of the current changes to the changelog.
Fixed log call to use log10 instead of ln.
Updated all boundary classes to take model input.  Adjusted class string output to be shorter for instances with a lot of different geomagnetic indices in the model kwarg inputs.
Added a citation for the Starkov model.
Added a model example to the documentation.
Added a model initialization example to the documentation.
Added the ellipses to the expected example output.
Added a section to hold the boundary models in the docs.
Ensure all co-latitudes have a realistic lower limit.
Added unit tests for the Starkov functions.
Added test for the different boundary classes with model initialization and loading.
Fixes ellipses to only appear of there are records that are not shown in the printed representation.
Updated the class display to include ellipses.
Fixed the documentation typing for python text.
Added members section to automodule.
Fixed the use of references in the models docstring.
@aburrell aburrell added this to the v0.6.0 milestone Jun 30, 2025
@aburrell aburrell linked an issue Jun 30, 2025 that may be closed by this pull request
@aburrell
Copy link
Owner Author

Failed tests are addressed in #152

@aburrell aburrell merged commit 081c4ee into develop Jun 30, 2025
61 of 77 checks passed
@aburrell aburrell deleted the boundary_models branch June 30, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Add model boundaries

1 participant