Skip to content

Commit

Permalink
Merge pull request #46 from aburrell/develop
Browse files Browse the repository at this point in the history
Version 2.5.3 Release
  • Loading branch information
aburrell authored Dec 23, 2019
2 parents 00b82e5 + db2099a commit ea34616
Show file tree
Hide file tree
Showing 18 changed files with 868 additions and 769 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.5.2
current_version = 2.5.3
commit = True
tag = True

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@

Changelog
=========
2.5.3 (2019-12-23)
-----------------------------------------
* Changed log warning about array functions to info
* Changed default method from `TRACE` to `ALLOWTRACE`
* Added C wrappers for list input, removing inefficient use of `np.vectorize`
* Fixed documentation for use of `method_code`
* Added FutureWarning for deprecated use of `code` keyword argument
* Updated previous version's changelog to encompass all changes
* Improved docstrings to make documentation easier to read
* Removed failing twine commands from `appveyor.yml`
* Removed `RuntimeWarning` filter from `tox.ini`


2.5.2 (2019-08-27)
-----------------------------------------
* Added FutureWarning to deprecated functions
Expand All @@ -11,6 +24,7 @@ Changelog
* Removed logbook dependency
* Added logic to avoid reseting environment variables if not necessary
* Added copyright and license disclaimer to module-specific program files
* Changed keyword argument `code` to `method_code`


2.5.1 (2018-10-19)
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Convert between AACGM and geographic coordinates::
>>> # geo to AACGM, single numbers
>>> dtime = dt.datetime(2013, 11, 3)
>>> np.array(aacgmv2.get_aacgm_coord(60, 15, 300, dtime))
array([57.4698, 93.6300, 1.4822])
array([57.4721, 93.6214, 1.4816])
>>> # AACGM to geo, mix arrays/numbers
>>> aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, method_code="A2G")
(array([82.9666, -74.3385]), array([-84.6652, 125.8401]), array([14.1244, 12.8771]))
>>> np.array2string(np.array(aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, method_code="A2G"))).replace('\n', '')
'[[82.9666 -74.3385] [-84.6652 125.8401] [14.1244 12.8771]]'

Convert between AACGM and MLT::

Expand All @@ -44,7 +44,7 @@ Convert between AACGM and MLT::
>>> np.set_printoptions(formatter={'float_kind': lambda x:'{:.4f}'.format(x)})
>>> # MLT to AACGM
>>> dtime = dt.datetime(2013, 11, 3, 0, 0, 0)
>>> aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True)
>>> np.array(aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True))
array([93.6300, -108.6033])

If you don't know or use Python, you can also use the command line. See details
Expand Down
56 changes: 14 additions & 42 deletions aacgmv2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,22 @@
# the root in the LICENSE file
#
# -*- coding: utf-8 -*-
"""aacgmv2
""" Functions to convert between geographic/geodetic and AACGM-V2 magnetic
coordinates
Modules
---------------------------------------------------------------------------
_aacgmv2 : Contains functions and variables from c code
deprecated : Contains deprecated functions from previous versions
wrapper : Contains current python functions
---------------------------------------------------------------------------
Parameters
---------------------------------------------------------------------------
logger
high_alt_coeff
high_alt_trace
AACGM_V2_DAT_PREFIX
IGRF_12_COEFFS
_aacgmv2.G2A
_aacgmv2.A2G
_aacgmv2.TRACE
_aacgmv2.ALLOWTRACE
_aacgmv2.BADIDEA
_aacgmv2.GEOCENTRIC
Attributes
---------------------------------------------------------------------------
logger : (logger)
Logger handle
high_alt_coeff : (float)
Upper altitude limit for using coefficients in km
high_alt_trace : (float)
Upper altitude limit for using field-line tracing in km
AACGM_V2_DAT_PREFIX : (str)
Location of AACGM-V2 coefficient files with the file prefix
IGRF_12_COEFFS : (str)
Filename, with directory, of IGRF coefficients
Functions
---------------------------------------------------------------------------
convert_latlon_arr
convert_str_to_bit
convert_bool_to_bit
get_aacgm_coord
get_aacgm_coord_arr
convert
convert_mlt
wrapper.set_coeff_path
wrapper.test_height
wrapper.test_time
deprecated.subsol
_aacgmv2.convert
_aacgmv2.set_datetime
_aacgmv2.mlt_convert
_aacgmv2.mlt_convert_yrsec
_aacgmv2.inv_mlt_convert
_aacgmv2.inv_mlt_convert_yrsec
---------------------------------------------------------------------------
"""
# Imports
#---------------------------------------------------------------------
Expand All @@ -66,7 +38,7 @@
# Define global variables
#---------------------------------------------------------------------

__version__ = "2.5.2"
__version__ = "2.5.3"

# Define a logger object to allow easier log handling
logger = logging.getLogger('aacgmv2_logger')
Expand Down
8 changes: 6 additions & 2 deletions aacgmv2/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ def main():
geocentric=args.geocentric)
lats, lons, alts = aacgmv2.convert_latlon_arr(array[:, 0], array[:, 1],
array[:, 2], dtime=date,
code=code)
method_code=code)
np.savetxt(args.file_out, np.column_stack((lats, lons, alts)),
fmt='%.8f')
elif args.subcommand == 'convert_mlt':
dtime = dt.datetime.strptime(args.datetime, '%Y%m%d%H%M%S')
out = aacgmv2.convert_mlt(array[:, 0], dtime, m2a=args.m2a)
out = np.array(aacgmv2.convert_mlt(array[:, 0], dtime, m2a=args.m2a))

if len(out.shape) == 0:
out = np.array([out])

np.savetxt(args.file_out, out, fmt='%.8f')


Expand Down
Loading

0 comments on commit ea34616

Please sign in to comment.