Skip to main content

Location relative to open/closed field line boundary

Project description

Linux Status Windows Status Coverage Status Documentation Status DOI PyPI version

Planet with auroral oval and two pythons representing closed and open magnetic field lines Overview

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). 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.

  • Full documentation

OCBs must be obtained from observations for this coordinate transformation. In the British Antarctic Survey's IMAGE Auroral Boundary data project from three auroral instruments provide northern hemisphere OCB locations for 3 May 2000 03:01:42 UT - 22 Aug 2002 00:01:28, though not all of the times included in these files contain high-quality estimations of the OCB. Recommended selection criteria are included as defaults in the OCBoundary class. OCBpy also supports boundaries provided by AMPERE and DMSP:

Currently, support is included for files from the following datasets:

These routines may be used as a guide to write routines for other datasets.

Python versions

This module has been tested on python version 2.7, 3.5 - 3.8. Support for 2.7 will be dropped in 2020.

Dependencies

The listed dependecies were tested with the following versions:

  • numpy
  • aacgmv2
  • pysat (2.0.0+)
  • ssj_auroral_boundary

Testing is performed using the python module, unittest. To limit dependency issues, pysat (>=2.0.0) and ssj_auroral_boundary are optional dependencies.

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".

    $ cd ocbpy/
    $ python setup.py install

To run the unit tests,

    $ python -m unittest discover

Example

In iPython, run:

import numpy as np
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.OCBoundary()
print(ocb)

The output should be as follows:

Open-Closed Boundary file: ~/ocbpy/ocbpy/boundaries/si13_north_circle
Source instrument: IMAGE
Open-Closed Boundary reference latitude: 74.0 degrees

219927 records from 2000-05-05 11:35:27 to 2002-08-22 00:01:28

YYYY-MM-DD HH:MM:SS Phi_Centre R_Centre R
-----------------------------------------
2000-05-05 11:35:27 356.93 8.74 9.69
2000-05-05 11:37:23 202.97 13.23 22.23
2002-08-21 23:55:20 322.60 5.49 15.36
2002-08-22 00:01:28 179.02 2.32 19.52

Uses scaling function(s):
circular(**{})

Get the first good OCB record, which will be record index 27.

ocb.get_next_good_ocb_ind()
print(ocb.rec_ind)

27

To get the OCB record closest to a specified time, use ocbpy.match_data_ocb

first_good_time = ocb.dtime[ocb.rec_ind]
test_times = [first_good_time + dt.timedelta(minutes=5 * (i + 1))
              for i in range(5)]
itest = ocbpy.match_data_ocb(ocb, test_times, idat=0)
print(itest, ocb.rec_ind, test_times[itest], ocb.dtime[ocb.rec_ind])

0 31 2000-05-05 13:45:30 2000-05-05 13:50:29

More examples are available in the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocbpy-0.2.1.tar.gz (40.3 MB view details)

Uploaded Source

Built Distributions

ocbpy-0.2.1-py3-none-any.whl (40.4 MB view details)

Uploaded Python 3

ocbpy-0.2.1-py2-none-any.whl (40.4 MB view details)

Uploaded Python 2

File details

Details for the file ocbpy-0.2.1.tar.gz.

File metadata

  • Download URL: ocbpy-0.2.1.tar.gz
  • Upload date:
  • Size: 40.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for ocbpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 23d788213276d384010a3d111faaa60a093001ec8070a5c988512bc183ef179e
MD5 a930493224b526d647afff6d8254e7c8
BLAKE2b-256 a028d654791365354ffa4731f788403ac09acd1670b9a84f2ff48b88b89881d1

See more details on using hashes here.

File details

Details for the file ocbpy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ocbpy-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 40.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for ocbpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab653f70d97518364104df6b9f7c73902ac5271a5facbfffcde1638a0fd5d837
MD5 4a14bfd82a293924e821dbb4268572ee
BLAKE2b-256 45daa27d280007e7a2382b58b6fb022fd6c019f0bbd82ff084c410125082446c

See more details on using hashes here.

File details

Details for the file ocbpy-0.2.1-py2-none-any.whl.

File metadata

  • Download URL: ocbpy-0.2.1-py2-none-any.whl
  • Upload date:
  • Size: 40.4 MB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for ocbpy-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 a3a2719dcc15f7e489d3ff9fd111d1ca0198aa12eb85dc1df1b8d6ca4da73cb2
MD5 da1ce66fbcac5da84f445efd10053fb1
BLAKE2b-256 658d8f0f4a421c2bf778d2779975dec89f775348396c819df9111108daa35ac0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page