Name | ocbpy JSON |
Version |
0.6.0
JSON |
| download |
home_page | None |
Summary | Convert between magnetic/geodetic and adaptive, polar boundary coordinates |
upload_time | 2025-08-11 18:30:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | Copyright (c) 2017, Angeline G. Burrell (AGB) and Gareth Chisham (GC)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ocbpy nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
keywords |
coordinates
field-line boundary
auroral oval
polar cap
pysat
ionosphere
atmosphere
thermosphere
magnetosphere
heliosphere
observations
models
space
satellites
analysis
|
VCS |
 |
bugtrack_url |
|
requirements |
aacgmv2
coverage
coveralls
flake8
numpy
packaging
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[](http://ocbpy.readthedocs.io/en/latest/?badge=latest)
[](https://zenodo.org/badge/latestdoi/96153180)
[](https://badge.fury.io/py/ocbpy)
[](https://github.com/aburrell/ocbpy/actions/workflows/main.yml)
[](https://coveralls.io/github/aburrell/ocbpy)
<h1> <img width="128" height="128" src="https://raw.githubusercontent.com/aburrell/ocbpy/main/docs/figures/ocbpy_logo.gif" alt="Planet with auroral oval and two pythons representing closed and open magnetic field lines" title="OCBpy Logo" style="float:left;">
Overview </h1>
OCBpy is a Python module that converts between AACGM coordinates and a magnetic
coordinate system that adjusts latitude and local time relative to the Open
Closed field line Boundary (OCB), Equatorial Auroral Boundary (EAB), or both.
This is particulary useful for statistical studies of the poles, where gridding
relative to a fixed magnetic coordinate system would cause averaging of
different physical regions, such as auroral and polar cap measurements. This
coordinate system is described in:
* Chisham, G. (2017), A new methodology for the development of highâlatitude
ionospheric climatologies and empirical models, Journal of Geophysical
Research: Space Physics,
[doi:10.1002/2016JA023235.](https://doi.org/10.1002/2016JA023235)
* Full [documentation](https://ocbpy.readthedocs.io/en/latest/)
Boundaries must be obtained from observations or models for this coordinate
transformation. Several boundary data sets are included within this package.
These include northern hemisphere boundaries from the IMAGE satellite,
northern and southern hemisphere OCBs from AMPERE, and single-point boundary
locations from DMSP.
* [IMAGE Auroral Boundary data](https://www.bas.ac.uk/project/image-auroral-boundary-data/)
* Burrell, A. G. et al. (2020): AMPERE Polar Cap Boundaries, Ann. Geophys.,
38, 481-490,
[doi:10.5194/angeo-38-481-2020](https://doi.org/10.5194/angeo-38-481-2020)
* [DMSP SSJ Boundaries](https://zenodo.org/records/3373812)
Currently, support is included for files from the following datasets:
* SuperMAG (available at http://supermag.jhuapl.edu)
* SuperDARN Vorticity (contact GC at gchi@bas.ac.uk)
* Any pysat Instrument (available at https://github.com/pysat/pysat)
These routines may be used as a guide to write routines for other datasets.
# Python versions
This module currently supports Python version 3.10 - 3.13.
# Dependencies
The listed dependecies were tested with the following versions:
* numpy
* aacgmv2
* pysat (3.2.1+)
* zenodo_get
Testing is performed using the python module, unittest. To limit dependency
issues, the pysat and zenodo_get dependencies are optional.
# Installation
Installation is now available through pypi
```
$ pip install ocbpy
```
You may also checkout the repository and install it yourself:
```
$ git clone git://github.com/aburrell/ocbpy.git;
```
Change directories into the repository folder and run the setup.py file. For
a local install use the "--user" flag after "install". For development, add
the "-e" flag.
```
$ cd ocbpy/
$ pip install .
```
To run the unit tests,
```
$ python -m unittest discover
```
# Example
In iPython, run:
```
import datetime as dt
import ocbpy
```
Then initialise an OCB class object. This uses the default IMAGE FUV file and
will take a few minutes to load.
```
ocb = ocbpy.OCBoundary()
print(ocb)
```
The output should be as follows:
```
Open-Closed Boundary file: ~/ocbpy/ocbpy/boundaries/image_north_circle.ocb
Source instrument: IMAGE
Boundary reference latitude: 74.0 degrees
305805 records from 2000-05-04 03:03:20 to 2002-10-31 20:05:16
YYYY-MM-DD HH:MM:SS Phi_Centre R_Centre R
-----------------------------------------------------------------------------
2000-05-04 03:03:20 4.64 2.70 21.00
2000-05-04 03:07:15 147.24 2.63 7.09
...
2002-10-31 20:03:16 207.11 5.94 22.86
2002-10-31 20:05:16 335.47 6.76 11.97
Uses scaling function(s):
ocbpy.ocb_correction.circular(**{})
```
Get the first good OCB record, which will be record index 0.
```
ocb.get_next_good_ocb_ind()
print(ocb.rec_ind)
```
To get the good OCB record closest to a specified time (with a maximum of a
60 sec time difference, as a default), use **ocbpy.match_data_ocb**
```
test_times = [dt.datetime(otime.year, otime.month, otime.day, otime.hour,
otime.minute, 0) for otime in ocb.dtime[1:10]]
itest = ocbpy.match_data_ocb(ocb, test_times, idat=0)
print(itest, ocb.rec_ind, test_times[itest], ocb.dtime[ocb.rec_ind])
4 5 2000-05-05 11:39:00 2000-05-05 11:39:20
```
More examples are available in the documentation.
Raw data
{
"_id": null,
"home_page": null,
"name": "ocbpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "\"Angeline G. Burrell\" <angeline.g.burrell.civ@us.navy.mil>",
"keywords": "coordinates, field-line boundary, auroral oval, polar cap, pysat, ionosphere, atmosphere, thermosphere, magnetosphere, heliosphere, observations, models, space, satellites, analysis",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/05/93/0d8add5852d74ff8916b91afcb8223a4ef91e1af37340304bf39e7d577ed/ocbpy-0.6.0.tar.gz",
"platform": null,
"description": "[](http://ocbpy.readthedocs.io/en/latest/?badge=latest)\n[](https://zenodo.org/badge/latestdoi/96153180)\n[](https://badge.fury.io/py/ocbpy)\n\n[](https://github.com/aburrell/ocbpy/actions/workflows/main.yml)\n[](https://coveralls.io/github/aburrell/ocbpy)\n\n<h1> <img width=\"128\" height=\"128\" src=\"https://raw.githubusercontent.com/aburrell/ocbpy/main/docs/figures/ocbpy_logo.gif\" alt=\"Planet with auroral oval and two pythons representing closed and open magnetic field lines\" title=\"OCBpy Logo\" style=\"float:left;\">\nOverview </h1>\n\nOCBpy is a Python module that converts between AACGM coordinates and a magnetic\ncoordinate system that adjusts latitude and local time relative to the Open\nClosed field line Boundary (OCB), Equatorial Auroral Boundary (EAB), or both.\nThis is particulary useful for statistical studies of the poles, where gridding\nrelative to a fixed magnetic coordinate system would cause averaging of\ndifferent physical regions, such as auroral and polar cap measurements. This\ncoordinate system is described in:\n\n * Chisham, G. (2017), A new methodology for the development of high\u2010latitude\n ionospheric climatologies and empirical models, Journal of Geophysical\n Research: Space Physics,\n [doi:10.1002/2016JA023235.](https://doi.org/10.1002/2016JA023235)\n\n * Full [documentation](https://ocbpy.readthedocs.io/en/latest/)\n\nBoundaries must be obtained from observations or models for this coordinate\ntransformation. Several boundary data sets are included within this package.\nThese include northern hemisphere boundaries from the IMAGE satellite,\nnorthern and southern hemisphere OCBs from AMPERE, and single-point boundary\nlocations from DMSP.\n\n * [IMAGE Auroral Boundary data](https://www.bas.ac.uk/project/image-auroral-boundary-data/)\n * Burrell, A. G. et al. (2020): AMPERE Polar Cap Boundaries, Ann. Geophys.,\n 38, 481-490,\n [doi:10.5194/angeo-38-481-2020](https://doi.org/10.5194/angeo-38-481-2020)\n * [DMSP SSJ Boundaries](https://zenodo.org/records/3373812)\n\nCurrently, support is included for files from the following datasets:\n\n * SuperMAG (available at http://supermag.jhuapl.edu)\n * SuperDARN Vorticity (contact GC at gchi@bas.ac.uk)\n * Any pysat Instrument (available at https://github.com/pysat/pysat)\n\nThese routines may be used as a guide to write routines for other datasets.\n\n# Python versions\n\nThis module currently supports Python version 3.10 - 3.13.\n\n# Dependencies\n\nThe listed dependecies were tested with the following versions:\n * numpy\n * aacgmv2\n * pysat (3.2.1+)\n * zenodo_get\n\nTesting is performed using the python module, unittest. To limit dependency\nissues, the pysat and zenodo_get dependencies are optional.\n\n# Installation\n\nInstallation is now available through pypi\n\n```\n $ pip install ocbpy\n```\n\nYou may also checkout the repository and install it yourself:\n\n```\n $ git clone git://github.com/aburrell/ocbpy.git;\n```\n\nChange directories into the repository folder and run the setup.py file. For\na local install use the \"--user\" flag after \"install\". For development, add\nthe \"-e\" flag.\n\n```\n $ cd ocbpy/\n $ pip install .\n```\n\nTo run the unit tests,\n\n```\n $ python -m unittest discover\n```\n\n# Example\n\nIn iPython, run:\n\n```\nimport datetime as dt\nimport ocbpy\n```\n\nThen initialise an OCB class object. This uses the default IMAGE FUV file and\nwill take a few minutes to load.\n\n```\nocb = ocbpy.OCBoundary()\nprint(ocb)\n```\n\nThe output should be as follows:\n\n```\nOpen-Closed Boundary file: ~/ocbpy/ocbpy/boundaries/image_north_circle.ocb\nSource instrument: IMAGE\nBoundary reference latitude: 74.0 degrees\n\n305805 records from 2000-05-04 03:03:20 to 2002-10-31 20:05:16\n\nYYYY-MM-DD HH:MM:SS Phi_Centre R_Centre R\n-----------------------------------------------------------------------------\n2000-05-04 03:03:20 4.64 2.70 21.00\n2000-05-04 03:07:15 147.24 2.63 7.09\n...\n2002-10-31 20:03:16 207.11 5.94 22.86\n2002-10-31 20:05:16 335.47 6.76 11.97\n\nUses scaling function(s):\nocbpy.ocb_correction.circular(**{})\n```\n\nGet the first good OCB record, which will be record index 0.\n\n```\nocb.get_next_good_ocb_ind()\nprint(ocb.rec_ind)\n```\n\nTo get the good OCB record closest to a specified time (with a maximum of a\n60 sec time difference, as a default), use **ocbpy.match_data_ocb**\n\n```\ntest_times = [dt.datetime(otime.year, otime.month, otime.day, otime.hour,\n otime.minute, 0) for otime in ocb.dtime[1:10]]\nitest = ocbpy.match_data_ocb(ocb, test_times, idat=0)\nprint(itest, ocb.rec_ind, test_times[itest], ocb.dtime[ocb.rec_ind])\n\n4 5 2000-05-05 11:39:00 2000-05-05 11:39:20\n```\n\nMore examples are available in the documentation.\n",
"bugtrack_url": null,
"license": "Copyright (c) 2017, Angeline G. Burrell (AGB) and Gareth Chisham (GC)\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n \n * Neither the name of ocbpy nor the names of its contributors may be used to\n endorse or promote products derived from this software without specific\n prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n ",
"summary": "Convert between magnetic/geodetic and adaptive, polar boundary coordinates",
"version": "0.6.0",
"project_urls": {
"documentation": "https://ocbpy.readthedocs.io/en/latest/",
"download": "https://github.com/aburrell/ocbpy/releases",
"source": "https://github.com/aburrell/ocbpy",
"tracker": "https://github.com/aburrell/ocbpy/issues"
},
"split_keywords": [
"coordinates",
" field-line boundary",
" auroral oval",
" polar cap",
" pysat",
" ionosphere",
" atmosphere",
" thermosphere",
" magnetosphere",
" heliosphere",
" observations",
" models",
" space",
" satellites",
" analysis"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "16f3323101ed1fcf93f5098bf3c1933b91bb59969e618227cd17ea324763991c",
"md5": "a5a27e4a43659604f7cf645cad82f8e5",
"sha256": "fb09ee70f8e65fb715cd2ff880bed20440e10eec591e60c08719587c899ccc53"
},
"downloads": -1,
"filename": "ocbpy-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a5a27e4a43659604f7cf645cad82f8e5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 115975403,
"upload_time": "2025-08-11T18:30:08",
"upload_time_iso_8601": "2025-08-11T18:30:08.515845Z",
"url": "https://files.pythonhosted.org/packages/16/f3/323101ed1fcf93f5098bf3c1933b91bb59969e618227cd17ea324763991c/ocbpy-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "05930d8add5852d74ff8916b91afcb8223a4ef91e1af37340304bf39e7d577ed",
"md5": "dd72c58ac316fdb0457c1a94bde892c7",
"sha256": "439bae6c0d758b86943ba419e333c768f9ed5e10921cee3ac67501f7f30f320e"
},
"downloads": -1,
"filename": "ocbpy-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "dd72c58ac316fdb0457c1a94bde892c7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 114900071,
"upload_time": "2025-08-11T18:30:14",
"upload_time_iso_8601": "2025-08-11T18:30:14.839375Z",
"url": "https://files.pythonhosted.org/packages/05/93/0d8add5852d74ff8916b91afcb8223a4ef91e1af37340304bf39e7d577ed/ocbpy-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-11 18:30:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aburrell",
"github_project": "ocbpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "aacgmv2",
"specs": []
},
{
"name": "coverage",
"specs": []
},
{
"name": "coveralls",
"specs": []
},
{
"name": "flake8",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "packaging",
"specs": []
}
],
"lcname": "ocbpy"
}