From 8e9c308995c941c43ec5dc6cbaabafa8183bdd1a Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Fri, 12 Feb 2021 09:28:50 -0500 Subject: [PATCH 01/23] Update apex.py remove documentation for the non-`return_all` case of `basevectors_apex` --- src/apexpy/apex.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 7388120e..4b396881 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -800,7 +800,6 @@ def basevectors_apex(self, lat, lon, height, coords='geo', precision=1e-10): Returns ------- - f1, f2 : (2, N) or (2,) ndarray f3, g1, g2, g3, d1, d2, d3, e1, e2, e3 : (3, N) or (3,) ndarray Note From b0d20ca56194332f7e6e1759d9cc1d8d6d850ddc Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Fri, 12 Feb 2021 10:26:39 -0500 Subject: [PATCH 02/23] Update apex.py adding a note to the `Apex` class to address #25 --- src/apexpy/apex.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 4b396881..bfd34f6e 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -57,6 +57,8 @@ class Apex(object): Notes ----- The calculations use IGRF-12 with coefficients from 1900 to 2020 [1]_. + + The geodetic reference ellipsoid is WGS84. References ---------- From c5be0ca475ab8573ab3961de527612932e9f4988 Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Fri, 12 Feb 2021 12:18:05 -0500 Subject: [PATCH 03/23] Update apex.py removing whitespace to make apex.py pep8 compliant --- src/apexpy/apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index bfd34f6e..cae8082f 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -57,7 +57,7 @@ class Apex(object): Notes ----- The calculations use IGRF-12 with coefficients from 1900 to 2020 [1]_. - + The geodetic reference ellipsoid is WGS84. References From a9a24c2cc4a65b80840f242d5c1c583867a4bcc4 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:09:23 -0400 Subject: [PATCH 04/23] changing cofrm to accept a coefficients file and updating set_epoch to provide it --- src/apexpy/apex.py | 3 +- src/fortranapex/fortranapex.pyf | 140 ++++++++++++++++---------------- src/fortranapex/magfld.f | 8 +- 3 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index cae8082f..15c7cfd6 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -931,7 +931,8 @@ def set_epoch(self, year): # f2py self.year = np.float64(year) fa.loadapxsh(self.datafile, self.year) - fa.cofrm(self.year) + igrf_fn = os.path.join(os.path.dirname(__file__), '..', 'fortranapex', 'igrf13coeffs.txt') + fa.cofrm(self.year, igrf_fn) def set_refh(self, refh): """Updates the apex reference height for all subsequent conversions. diff --git a/src/fortranapex/fortranapex.pyf b/src/fortranapex/fortranapex.pyf index fa4a6bd0..f200f551 100644 --- a/src/fortranapex/fortranapex.pyf +++ b/src/fortranapex/fortranapex.pyf @@ -3,55 +3,7 @@ python module fortranapex ! in interface ! in :fortranapex - subroutine cofrm(date) ! in :fortranapex:magfld.f - real :: date - integer :: nmax - real dimension(255) :: gb - real dimension(225) :: gv - integer, optional :: ichg=-99999 - common /magcof/ nmax,gb,gv,ichg - end subroutine cofrm - subroutine dypol(colat,elon,vp) ! in :fortranapex:magfld.f - real :: colat - real :: elon - real :: vp - integer :: nmax - real dimension(255) :: gb - real dimension(225) :: gv - integer :: ichg - common /magcof/ nmax,gb,gv,ichg - end subroutine dypol - subroutine feldg(ienty,glat,glon,alt,bnrth,beast,bdown,babs) ! in :fortranapex:magfld.f - integer intent(in) :: ienty - real(4) intent(in) :: glat - real(4) intent(in) :: glon - real(4) intent(in) :: alt - real(4) intent(out) :: bnrth - real(4) intent(out) :: beast - real(4) intent(out) :: bdown - real(4) intent(out) :: babs - integer :: nmax - real dimension(255) :: gb - real dimension(225) :: gv - integer :: ichg - common /magcof/ nmax,gb,gv,ichg - end subroutine feldg - subroutine gd2cart(gdlat,glon,alt,x,y,z) ! in :fortranapex:magfld.f - real :: gdlat - real :: glon - real :: alt - real :: x - real :: y - real :: z - end subroutine gd2cart - subroutine convrt(i,gdlat,alt,x1,x2) ! in :fortranapex:magfld.f - integer :: i - real :: gdlat - real :: alt - real :: x1 - real :: x2 - end subroutine convrt - subroutine apex(date,dlat,dlon,alt,a,alat,alon,bmag,xmag,ymag,zmag,v) ! in :fortranapex:apex.f + subroutine apex(date,dlat,dlon,alt,a,alat,alon,bmag,xmag,ymag,zmag,v) ! in :fortranapex:.\apex.f real :: date real :: dlat real :: dlon @@ -71,7 +23,7 @@ python module fortranapex ! in real :: stp common /dipole/ colat,elon,vp,ctp,stp end subroutine apex - subroutine linapx(gdlat,glon,alt,a,alat,alon,xmag,ymag,zmag,f) ! in :fortranapex:apex.f + subroutine linapx(gdlat,glon,alt,a,alat,alon,xmag,ymag,zmag,f) ! in :fortranapex:.\apex.f real :: gdlat real :: glon real :: alt @@ -102,7 +54,7 @@ python module fortranapex ! in common /dipole/ colat,elon,vp,ctp,stp common /itra/ nstp,y,yp,sgn,ds end subroutine linapx - subroutine itrace(iapx) ! in :fortranapex:apex.f + subroutine itrace(iapx) ! in :fortranapex:.\apex.f integer :: iapx real dimension(3,3) :: yapx real :: bx @@ -118,7 +70,7 @@ python module fortranapex ! in common /fldcomd/ bx,by,bz,bb common /itra/ nstp,y,yold,sgn,ds end subroutine itrace - subroutine fndapx(alt,zmag,a,alat,alon) ! in :fortranapex:apex.f + subroutine fndapx(alt,zmag,a,alat,alon) ! in :fortranapex:.\apex.f real :: alt real :: zmag real :: a @@ -133,7 +85,7 @@ python module fortranapex ! in common /apxin/ yapx common /dipole/ colat,elon,vp,ctp,stp end subroutine fndapx - subroutine dipapx(gdlat,gdlon,alt,bnorth,beast,bdown,a,alon) ! in :fortranapex:apex.f + subroutine dipapx(gdlat,gdlon,alt,bnorth,beast,bdown,a,alon) ! in :fortranapex:.\apex.f real :: gdlat real :: gdlon real :: alt @@ -149,7 +101,7 @@ python module fortranapex ! in real :: stp common /dipole/ colat,elon,vp,ctp,stp end subroutine dipapx - function fint(x1,x2,x3,y1,y2,y3,xfit) ! in :fortranapex:apex.f + function fint(x1,x2,x3,y1,y2,y3,xfit) ! in :fortranapex:.\apex.f real :: x1 real :: x2 real :: x3 @@ -159,7 +111,7 @@ python module fortranapex ! in real :: xfit real :: fint end function fint - module apxshmodule ! in :fortranapex:apexsh.f90 + module apxshmodule ! in :fortranapex:.\apexsh.f90 integer(kind=4) :: nterm integer(kind=4) :: nmax integer(kind=4) :: mmax @@ -221,15 +173,15 @@ python module fortranapex ! in real(kind=4) :: altlastg logical, optional :: loadflag=.true. end module apxshmodule - subroutine loadapxsh(datafilenew,epochnew) ! in :fortranapex:apexsh.f90 + subroutine loadapxsh(datafilenew,epochnew) ! in :fortranapex:.\apexsh.f90 use apxshmodule - character*1000 :: datafilenew - real(kind=4) :: epochnew + character*1000 intent(in) :: datafilenew + real(kind=4) intent(in) :: epochnew end subroutine loadapxsh - subroutine allocatearrays ! in :fortranapex:apexsh.f90 + subroutine allocatearrays ! in :fortranapex:.\apexsh.f90 use apxshmodule end subroutine allocatearrays - subroutine apxg2q(glat,glon,alt,vecflagin,qlatout,qlonout,f1,f2,f) ! in :fortranapex:apexsh.f90 + subroutine apxg2q(glat,glon,alt,vecflagin,qlatout,qlonout,f1,f2,f) ! in :fortranapex:.\apexsh.f90 use apxshmodule real(kind=4) intent(in) :: glat real(kind=4) intent(in) :: glon @@ -241,7 +193,7 @@ python module fortranapex ! in real(kind=4) dimension(2),intent(out) :: f2 real(kind=4) intent(out) :: f end subroutine apxg2q - subroutine apxg2all(glat,glon,alt,hr,vecflagin,qlatout,qlonout,mlat,mlon,f1,f2,f,d1,d2,d3,d,e1,e2,e3) ! in :fortranapex:apexsh.f90 + subroutine apxg2all(glat,glon,alt,hr,vecflagin,qlatout,qlonout,mlat,mlon,f1,f2,f,d1,d2,d3,d,e1,e2,e3) ! in :fortranapex:.\apexsh.f90 use apxshmodule real(kind=4) intent(in) :: glat real(kind=4) intent(in) :: glon @@ -263,7 +215,7 @@ python module fortranapex ! in real(kind=4) dimension(3),intent(out) :: e2 real(kind=4) dimension(3),intent(out) :: e3 end subroutine apxg2all - subroutine apxq2g(qlat0,qlon0,alt,prec,glatout,glonout,error) ! in :fortranapex:apexsh.f90 + subroutine apxq2g(qlat0,qlon0,alt,prec,glatout,glonout,error) ! in :fortranapex:.\apexsh.f90 use apxshmodule real(kind=4) intent(in) :: qlat0 real(kind=4) intent(in) :: qlon0 @@ -273,12 +225,12 @@ python module fortranapex ! in real(kind=4) intent(out) :: glonout real(kind=4) intent(out) :: error end subroutine apxq2g - subroutine shcalc(theta,phi) ! in :fortranapex:apexsh.f90 + subroutine shcalc(theta,phi) ! in :fortranapex:.\apexsh.f90 use apxshmodule real(kind=8) intent(in) :: theta real(kind=8) intent(in) :: phi end subroutine shcalc - module alfbasismodule ! in :fortranapex:apexsh.f90 + module alfbasismodule ! in :fortranapex:.\apexsh.f90 integer(kind=4) :: nmax0 integer(kind=4) :: mmax0 real(kind=8), allocatable,dimension(:,:) :: anm @@ -289,12 +241,12 @@ python module fortranapex ! in real(kind=8), allocatable,dimension(:) :: marr real(kind=8), allocatable,dimension(:) :: narr end module alfbasismodule - subroutine alfbasisinit(nmax0in,mmax0in) ! in :fortranapex:apexsh.f90 + subroutine alfbasisinit(nmax0in,mmax0in) ! in :fortranapex:.\apexsh.f90 use alfbasismodule integer(kind=4) intent(in) :: nmax0in integer(kind=4) intent(in) :: mmax0in end subroutine alfbasisinit - subroutine alfbasis(nmax,mmax,theta,p,v,w) ! in :fortranapex:apexsh.f90 + subroutine alfbasis(nmax,mmax,theta,p,v,w) ! in :fortranapex:.\apexsh.f90 use alfbasismodule integer(kind=4) intent(in) :: nmax integer(kind=4) intent(in) :: mmax @@ -303,7 +255,57 @@ python module fortranapex ! in real(kind=8) dimension(nmax + 1,mmax + 1),intent(out),depend(nmax,mmax) :: v real(kind=8) dimension(nmax + 1,mmax + 1),intent(out),depend(nmax,mmax) :: w end subroutine alfbasis - subroutine makeapxsh(datafilein,epochgridin,nepochin,lmaxin,mmaxin,nmaxin) ! in :fortranapex:makeapexsh.f90 + subroutine cofrm(date,filename) ! in :fortranapex:.\magfld.f + use igrf + real(kind=4) intent(in) :: date + character*1000 intent(in) :: filename + integer :: nmax + real dimension(255) :: gb + real dimension(225) :: gv + integer, optional :: ichg=-99999 + common /magcof/ nmax,gb,gv,ichg + end subroutine cofrm + subroutine dypol(colat,elon,vp) ! in :fortranapex:.\magfld.f + real :: colat + real :: elon + real :: vp + integer :: nmax + real dimension(255) :: gb + real dimension(225) :: gv + integer :: ichg + common /magcof/ nmax,gb,gv,ichg + end subroutine dypol + subroutine feldg(ienty,glat,glon,alt,bnrth,beast,bdown,babs) ! in :fortranapex:.\magfld.f + integer intent(in) :: ienty + real intent(in) :: glat + real intent(in) :: glon + real intent(in) :: alt + real intent(out) :: bnrth + real intent(out) :: beast + real intent(out) :: bdown + real intent(out) :: babs + integer :: nmax + real dimension(255) :: gb + real dimension(225) :: gv + integer :: ichg + common /magcof/ nmax,gb,gv,ichg + end subroutine feldg + subroutine gd2cart(gdlat,glon,alt,x,y,z) ! in :fortranapex:.\magfld.f + real :: gdlat + real :: glon + real :: alt + real :: x + real :: y + real :: z + end subroutine gd2cart + subroutine convrt(i,gdlat,alt,x1,x2) ! in :fortranapex:.\magfld.f + integer :: i + real :: gdlat + real :: alt + real :: x1 + real :: x2 + end subroutine convrt + subroutine makeapxsh(datafilein,epochgridin,nepochin,lmaxin,mmaxin,nmaxin) ! in :fortranapex:.\makeapexsh.f90 use apxshmodule character*128 intent(in) :: datafilein real(kind=4) dimension(31),intent(in) :: epochgridin @@ -315,13 +317,13 @@ python module fortranapex ! in real(kind=4) dimension(255) :: gb common /magcof/ nmaxigrf,gb end subroutine makeapxsh - subroutine choldc(a,n,np,p) ! in :fortranapex:makeapexsh.f90 + subroutine choldc(a,n,np,p) ! in :fortranapex:.\makeapexsh.f90 real(kind=8) dimension(np,np),intent(inout) :: a integer(kind=4) intent(in) :: n integer(kind=4), optional,intent(in),check(shape(a,0)==np),depend(a) :: np=shape(a,0) real(kind=8) dimension(n),intent(out),depend(n) :: p end subroutine choldc - subroutine cholsl(a,n,np,p,b,x) ! in :fortranapex:makeapexsh.f90 + subroutine cholsl(a,n,np,p,b,x) ! in :fortranapex:.\makeapexsh.f90 real(kind=8) dimension(np,np),intent(in) :: a integer(kind=4), optional,intent(in),check(len(p)>=n),depend(p) :: n=len(p) integer(kind=4), optional,intent(in),check(shape(a,0)==np),depend(a) :: np=shape(a,0) diff --git a/src/fortranapex/magfld.f b/src/fortranapex/magfld.f index d8311bcf..1240170a 100644 --- a/src/fortranapex/magfld.f +++ b/src/fortranapex/magfld.f @@ -1,6 +1,6 @@ C FILE NAME: magfld.f - SUBROUTINE COFRM (DATE) + SUBROUTINE COFRM (DATE, FILENAME) C Define the International Geomagnetic Reference Field (IGRF) as a C scalar potential field using a truncated series expansion with C Schmidt semi-normalized associated Legendre functions of degree n and @@ -9,7 +9,8 @@ SUBROUTINE COFRM (DATE) C rate after the last epoch. C C INPUTS: -C DATE = yyyy.fraction (UT) +C DATE = yyyy.fraction (UT)\ +C FILENAME = filename C OUTPUTS (in comnon block MAGCOF): C NMAX = Maximum order of spherical harmonic coefficients used C GB = Coefficients for magnetic field calculation @@ -129,9 +130,8 @@ SUBROUTINE COFRM (DATE) ICHG = 1 c Load coefficients - FILENAME='igrf13coeffs.txt' if (.not. allocated(GYR)) then - call read_igrf(filename,GYR,HYR,GT,HT,NEPO,NGHT,EPOCH,NMXE) + call read_igrf(FILENAME,GYR,HYR,GT,HT,NEPO,NGHT,EPOCH,NMXE) endif NGH=NGHT*NEPO From fb27511518a68b07c7d7c3c098ac57973198d769 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:15:06 -0400 Subject: [PATCH 05/23] modifying fortranapex.pyf to clean up PR: removing '.\' --- src/fortranapex/fortranapex.pyf | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/fortranapex/fortranapex.pyf b/src/fortranapex/fortranapex.pyf index f200f551..e639655f 100644 --- a/src/fortranapex/fortranapex.pyf +++ b/src/fortranapex/fortranapex.pyf @@ -3,7 +3,7 @@ python module fortranapex ! in interface ! in :fortranapex - subroutine apex(date,dlat,dlon,alt,a,alat,alon,bmag,xmag,ymag,zmag,v) ! in :fortranapex:.\apex.f + subroutine apex(date,dlat,dlon,alt,a,alat,alon,bmag,xmag,ymag,zmag,v) ! in :fortranapex:apex.f real :: date real :: dlat real :: dlon @@ -23,7 +23,7 @@ python module fortranapex ! in real :: stp common /dipole/ colat,elon,vp,ctp,stp end subroutine apex - subroutine linapx(gdlat,glon,alt,a,alat,alon,xmag,ymag,zmag,f) ! in :fortranapex:.\apex.f + subroutine linapx(gdlat,glon,alt,a,alat,alon,xmag,ymag,zmag,f) ! in :fortranapex:apex.f real :: gdlat real :: glon real :: alt @@ -54,7 +54,7 @@ python module fortranapex ! in common /dipole/ colat,elon,vp,ctp,stp common /itra/ nstp,y,yp,sgn,ds end subroutine linapx - subroutine itrace(iapx) ! in :fortranapex:.\apex.f + subroutine itrace(iapx) ! in :fortranapex:apex.f integer :: iapx real dimension(3,3) :: yapx real :: bx @@ -70,7 +70,7 @@ python module fortranapex ! in common /fldcomd/ bx,by,bz,bb common /itra/ nstp,y,yold,sgn,ds end subroutine itrace - subroutine fndapx(alt,zmag,a,alat,alon) ! in :fortranapex:.\apex.f + subroutine fndapx(alt,zmag,a,alat,alon) ! in :fortranapex:apex.f real :: alt real :: zmag real :: a @@ -85,7 +85,7 @@ python module fortranapex ! in common /apxin/ yapx common /dipole/ colat,elon,vp,ctp,stp end subroutine fndapx - subroutine dipapx(gdlat,gdlon,alt,bnorth,beast,bdown,a,alon) ! in :fortranapex:.\apex.f + subroutine dipapx(gdlat,gdlon,alt,bnorth,beast,bdown,a,alon) ! in :fortranapex:apex.f real :: gdlat real :: gdlon real :: alt @@ -101,7 +101,7 @@ python module fortranapex ! in real :: stp common /dipole/ colat,elon,vp,ctp,stp end subroutine dipapx - function fint(x1,x2,x3,y1,y2,y3,xfit) ! in :fortranapex:.\apex.f + function fint(x1,x2,x3,y1,y2,y3,xfit) ! in :fortranapex:apex.f real :: x1 real :: x2 real :: x3 @@ -111,7 +111,7 @@ python module fortranapex ! in real :: xfit real :: fint end function fint - module apxshmodule ! in :fortranapex:.\apexsh.f90 + module apxshmodule ! in :fortranapex:apexsh.f90 integer(kind=4) :: nterm integer(kind=4) :: nmax integer(kind=4) :: mmax @@ -173,15 +173,15 @@ python module fortranapex ! in real(kind=4) :: altlastg logical, optional :: loadflag=.true. end module apxshmodule - subroutine loadapxsh(datafilenew,epochnew) ! in :fortranapex:.\apexsh.f90 + subroutine loadapxsh(datafilenew,epochnew) ! in :fortranapex:apexsh.f90 use apxshmodule character*1000 intent(in) :: datafilenew real(kind=4) intent(in) :: epochnew end subroutine loadapxsh - subroutine allocatearrays ! in :fortranapex:.\apexsh.f90 + subroutine allocatearrays ! in :fortranapex:apexsh.f90 use apxshmodule end subroutine allocatearrays - subroutine apxg2q(glat,glon,alt,vecflagin,qlatout,qlonout,f1,f2,f) ! in :fortranapex:.\apexsh.f90 + subroutine apxg2q(glat,glon,alt,vecflagin,qlatout,qlonout,f1,f2,f) ! in :fortranapex:apexsh.f90 use apxshmodule real(kind=4) intent(in) :: glat real(kind=4) intent(in) :: glon @@ -193,7 +193,7 @@ python module fortranapex ! in real(kind=4) dimension(2),intent(out) :: f2 real(kind=4) intent(out) :: f end subroutine apxg2q - subroutine apxg2all(glat,glon,alt,hr,vecflagin,qlatout,qlonout,mlat,mlon,f1,f2,f,d1,d2,d3,d,e1,e2,e3) ! in :fortranapex:.\apexsh.f90 + subroutine apxg2all(glat,glon,alt,hr,vecflagin,qlatout,qlonout,mlat,mlon,f1,f2,f,d1,d2,d3,d,e1,e2,e3) ! in :fortranapex:apexsh.f90 use apxshmodule real(kind=4) intent(in) :: glat real(kind=4) intent(in) :: glon @@ -215,7 +215,7 @@ python module fortranapex ! in real(kind=4) dimension(3),intent(out) :: e2 real(kind=4) dimension(3),intent(out) :: e3 end subroutine apxg2all - subroutine apxq2g(qlat0,qlon0,alt,prec,glatout,glonout,error) ! in :fortranapex:.\apexsh.f90 + subroutine apxq2g(qlat0,qlon0,alt,prec,glatout,glonout,error) ! in :fortranapex:apexsh.f90 use apxshmodule real(kind=4) intent(in) :: qlat0 real(kind=4) intent(in) :: qlon0 @@ -225,12 +225,12 @@ python module fortranapex ! in real(kind=4) intent(out) :: glonout real(kind=4) intent(out) :: error end subroutine apxq2g - subroutine shcalc(theta,phi) ! in :fortranapex:.\apexsh.f90 + subroutine shcalc(theta,phi) ! in :fortranapex:apexsh.f90 use apxshmodule real(kind=8) intent(in) :: theta real(kind=8) intent(in) :: phi end subroutine shcalc - module alfbasismodule ! in :fortranapex:.\apexsh.f90 + module alfbasismodule ! in :fortranapex:apexsh.f90 integer(kind=4) :: nmax0 integer(kind=4) :: mmax0 real(kind=8), allocatable,dimension(:,:) :: anm @@ -241,12 +241,12 @@ python module fortranapex ! in real(kind=8), allocatable,dimension(:) :: marr real(kind=8), allocatable,dimension(:) :: narr end module alfbasismodule - subroutine alfbasisinit(nmax0in,mmax0in) ! in :fortranapex:.\apexsh.f90 + subroutine alfbasisinit(nmax0in,mmax0in) ! in :fortranapex:apexsh.f90 use alfbasismodule integer(kind=4) intent(in) :: nmax0in integer(kind=4) intent(in) :: mmax0in end subroutine alfbasisinit - subroutine alfbasis(nmax,mmax,theta,p,v,w) ! in :fortranapex:.\apexsh.f90 + subroutine alfbasis(nmax,mmax,theta,p,v,w) ! in :fortranapex:apexsh.f90 use alfbasismodule integer(kind=4) intent(in) :: nmax integer(kind=4) intent(in) :: mmax @@ -255,7 +255,7 @@ python module fortranapex ! in real(kind=8) dimension(nmax + 1,mmax + 1),intent(out),depend(nmax,mmax) :: v real(kind=8) dimension(nmax + 1,mmax + 1),intent(out),depend(nmax,mmax) :: w end subroutine alfbasis - subroutine cofrm(date,filename) ! in :fortranapex:.\magfld.f + subroutine cofrm(date,filename) ! in :fortranapex:magfld.f use igrf real(kind=4) intent(in) :: date character*1000 intent(in) :: filename @@ -265,7 +265,7 @@ python module fortranapex ! in integer, optional :: ichg=-99999 common /magcof/ nmax,gb,gv,ichg end subroutine cofrm - subroutine dypol(colat,elon,vp) ! in :fortranapex:.\magfld.f + subroutine dypol(colat,elon,vp) ! in :fortranapex:magfld.f real :: colat real :: elon real :: vp @@ -275,7 +275,7 @@ python module fortranapex ! in integer :: ichg common /magcof/ nmax,gb,gv,ichg end subroutine dypol - subroutine feldg(ienty,glat,glon,alt,bnrth,beast,bdown,babs) ! in :fortranapex:.\magfld.f + subroutine feldg(ienty,glat,glon,alt,bnrth,beast,bdown,babs) ! in :fortranapex:magfld.f integer intent(in) :: ienty real intent(in) :: glat real intent(in) :: glon @@ -290,7 +290,7 @@ python module fortranapex ! in integer :: ichg common /magcof/ nmax,gb,gv,ichg end subroutine feldg - subroutine gd2cart(gdlat,glon,alt,x,y,z) ! in :fortranapex:.\magfld.f + subroutine gd2cart(gdlat,glon,alt,x,y,z) ! in :fortranapex:magfld.f real :: gdlat real :: glon real :: alt @@ -298,14 +298,14 @@ python module fortranapex ! in real :: y real :: z end subroutine gd2cart - subroutine convrt(i,gdlat,alt,x1,x2) ! in :fortranapex:.\magfld.f + subroutine convrt(i,gdlat,alt,x1,x2) ! in :fortranapex:magfld.f integer :: i real :: gdlat real :: alt real :: x1 real :: x2 end subroutine convrt - subroutine makeapxsh(datafilein,epochgridin,nepochin,lmaxin,mmaxin,nmaxin) ! in :fortranapex:.\makeapexsh.f90 + subroutine makeapxsh(datafilein,epochgridin,nepochin,lmaxin,mmaxin,nmaxin) ! in :fortranapex:makeapexsh.f90 use apxshmodule character*128 intent(in) :: datafilein real(kind=4) dimension(31),intent(in) :: epochgridin @@ -317,13 +317,13 @@ python module fortranapex ! in real(kind=4) dimension(255) :: gb common /magcof/ nmaxigrf,gb end subroutine makeapxsh - subroutine choldc(a,n,np,p) ! in :fortranapex:.\makeapexsh.f90 + subroutine choldc(a,n,np,p) ! in :fortranapex:makeapexsh.f90 real(kind=8) dimension(np,np),intent(inout) :: a integer(kind=4) intent(in) :: n integer(kind=4), optional,intent(in),check(shape(a,0)==np),depend(a) :: np=shape(a,0) real(kind=8) dimension(n),intent(out),depend(n) :: p end subroutine choldc - subroutine cholsl(a,n,np,p,b,x) ! in :fortranapex:.\makeapexsh.f90 + subroutine cholsl(a,n,np,p,b,x) ! in :fortranapex:makeapexsh.f90 real(kind=8) dimension(np,np),intent(in) :: a integer(kind=4), optional,intent(in),check(len(p)>=n),depend(p) :: n=len(p) integer(kind=4), optional,intent(in),check(shape(a,0)==np),depend(a) :: np=shape(a,0) From 824bb20665c8d5a00cf29b1e35f5faa7b18f3fa7 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:22:13 -0400 Subject: [PATCH 06/23] moving igrfcoeffs.txt --- src/apexpy/apex.py | 2 +- src/{fortranapex => apexpy}/igrf13coeffs.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{fortranapex => apexpy}/igrf13coeffs.txt (100%) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 15c7cfd6..ca1d67ff 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -931,7 +931,7 @@ def set_epoch(self, year): # f2py self.year = np.float64(year) fa.loadapxsh(self.datafile, self.year) - igrf_fn = os.path.join(os.path.dirname(__file__), '..', 'fortranapex', 'igrf13coeffs.txt') + igrf_fn = os.path.join(os.path.dirname(__file__), 'igrf13coeffs.txt') fa.cofrm(self.year, igrf_fn) def set_refh(self, refh): diff --git a/src/fortranapex/igrf13coeffs.txt b/src/apexpy/igrf13coeffs.txt similarity index 100% rename from src/fortranapex/igrf13coeffs.txt rename to src/apexpy/igrf13coeffs.txt From ad252fa56eb8674503b59e872cee0fc35aaa0682 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:25:07 -0400 Subject: [PATCH 07/23] adding igrfcoeffs.txt to setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d6ade3f1..27a28332 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def read(*names, **kwargs): package_dir={'': 'src'}, py_modules=[path.splitext(path.basename(pp))[0] for pp in glob('src/*.py')], - package_data={'apexpy': ['apexsh.dat']}, + package_data={'apexpy': ['apexsh.dat', 'igrfcoeffs.txt']}, zip_safe=False, classifiers=[ # complete classifier list: From b9ce6f729f6a22f9ce7c4c29a26370360013c1ba Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:30:31 -0400 Subject: [PATCH 08/23] adding igrfcoeffs.txt to setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 27a28332..97d88aca 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def read(*names, **kwargs): package_dir={'': 'src'}, py_modules=[path.splitext(path.basename(pp))[0] for pp in glob('src/*.py')], - package_data={'apexpy': ['apexsh.dat', 'igrfcoeffs.txt']}, + package_data={'apexpy': ['apexsh.dat', 'igrf13coeffs.txt']}, zip_safe=False, classifiers=[ # complete classifier list: From dc6a0ee37e3be2e5ff96368ddf1fcaed31aea6ca Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 15:51:31 -0400 Subject: [PATCH 09/23] removing print statements from igrf.f90 --- src/fortranapex/igrf.f90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/fortranapex/igrf.f90 b/src/fortranapex/igrf.f90 index 16cd7399..e997a6c8 100644 --- a/src/fortranapex/igrf.f90 +++ b/src/fortranapex/igrf.f90 @@ -27,10 +27,6 @@ subroutine read_igrf(filename_in,GYR,HYR,GT,HT,NEPO,NGHT,EPOCH,NMXE) !num_sh = NGHT-2*sqrt(real(NGHT)) !write(*,*) num_sh - write(*,*) '----------------------------' - write(*,*) ' Read IGRF coefficeints ' - write(*,*) '----------------------------' - ! Open IGRF file open(unit=100, file=filename_in,status='old',iostat=state) if (state /= 0) then @@ -47,7 +43,6 @@ subroutine read_igrf(filename_in,GYR,HYR,GT,HT,NEPO,NGHT,EPOCH,NMXE) num_epochs=count([(s(i:i+3),i=1,len_trim(s))].eq.'IGRF') num_epochs=count([(s(i:i+3),i=1,len_trim(s))].eq.'DGRF')+num_epochs allocate(EPOCH(1:num_epochs)) - write(*,*) 'Number of epochs read: ',num_epochs allocate(NMXE(1:num_epochs)) ! Read epochs @@ -107,7 +102,6 @@ subroutine read_igrf(filename_in,GYR,HYR,GT,HT,NEPO,NGHT,EPOCH,NMXE) GT =0.0d0 HYR=0.0d0 HT =0.0d0 - write(*,*) 'ASSIGN COEFFICIENTS: ',NEPO,NGHT do e=1,NEPO+1 do l=1,L_max if (e .le. NEPO) then From 7abd6f3aac50e1be88e3e678ec04a63dcd66eed4 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 18:11:08 -0400 Subject: [PATCH 10/23] fixing bug caused by np.sign(qlat) when qlat is zero in apex.py #28 --- src/apexpy/apex.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index ca1d67ff..41b8db6f 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -445,9 +445,8 @@ def _qd2apex_nonvectorized(self, qlat, qlon, height): estr += '({:.3g}) for qlat {:.3g}'.format(self.refh, qlat) raise ApexHeightError(estr) - alat = np.sign(qlat) * np.degrees(np.arccos(np.sqrt((self.RE + - self.refh) / - (self.RE + hA)))) + sqlat = np.sign(qlat) if qlat != 0 else 1 + alat = sqlat * np.degrees(np.arccos(np.sqrt((self.RE + self.refh) / (self.RE + hA)))) return alat, alon From b28d0f446ef174a8f404c3f37082e19678e59a52 Mon Sep 17 00:00:00 2001 From: Greg Starr Date: Mon, 15 Feb 2021 20:33:51 -0400 Subject: [PATCH 11/23] reducing line length in apex.py to be pep8 compliant --- src/apexpy/apex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 41b8db6f..9f24169b 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -446,7 +446,8 @@ def _qd2apex_nonvectorized(self, qlat, qlon, height): raise ApexHeightError(estr) sqlat = np.sign(qlat) if qlat != 0 else 1 - alat = sqlat * np.degrees(np.arccos(np.sqrt((self.RE + self.refh) / (self.RE + hA)))) + alat = sqlat * np.degrees(np.arccos(np.sqrt((self.RE + self.refh) / + (self.RE + hA)))) return alat, alon From f68dc7c4c2f6bb40ccf0f4ef9c96146d9f645fd1 Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Tue, 16 Feb 2021 11:21:48 -0400 Subject: [PATCH 12/23] Update src/apexpy/apex.py Co-authored-by: Angeline Burrell --- src/apexpy/apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 9f24169b..114fa29c 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -804,7 +804,7 @@ def basevectors_apex(self, lat, lon, height, coords='geo', precision=1e-10): ------- f3, g1, g2, g3, d1, d2, d3, e1, e2, e3 : (3, N) or (3,) ndarray - Note + Notes ---- `f3`, `g1`, `g2`, and `g3` are not part of the Fortran code by Emmert et al. [2010] [5]_. They are calculated by this From 0914e5b02fc39a93dcac2f37a3a8df38cf637576 Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Tue, 16 Feb 2021 11:21:54 -0400 Subject: [PATCH 13/23] Update src/apexpy/apex.py Co-authored-by: Angeline Burrell --- src/apexpy/apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index 114fa29c..a619b75e 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -56,7 +56,7 @@ class Apex(object): Notes ----- - The calculations use IGRF-12 with coefficients from 1900 to 2020 [1]_. + The calculations use IGRF-13 with coefficients from 1900 to 2025 [1]_. The geodetic reference ellipsoid is WGS84. From 31d8dd06caac74d5b61502df260592072dc061dd Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 16:38:20 -0500 Subject: [PATCH 14/23] TST: removed strict flag Removed deprecated `strict` flag. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b3f75ce4..ed005def 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,7 +52,6 @@ addopts = --doctest-modules --doctest-glob='*.rst' -rxEfsw - --strict --ignore=docs/conf.py --ignore=setup.py --ignore=.eggs From 37b58f4309eebec9b2f0466f6ae4d8c921170dfa Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 16:38:39 -0500 Subject: [PATCH 15/23] STY: updated formatting Updated formatting for section headers. --- src/apexpy/apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index a619b75e..a33aa2a9 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -805,7 +805,7 @@ def basevectors_apex(self, lat, lon, height, coords='geo', precision=1e-10): f3, g1, g2, g3, d1, d2, d3, e1, e2, e3 : (3, N) or (3,) ndarray Notes - ---- + ----- `f3`, `g1`, `g2`, and `g3` are not part of the Fortran code by Emmert et al. [2010] [5]_. They are calculated by this Python library according to the following equations in From 92efa169e501e0127ca76c9855d25d75e7a275ae Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 16:39:08 -0500 Subject: [PATCH 16/23] TST: updated filename construction Updated filename construction, using `os.path.join` in all instances. --- tests/test_cmd.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/test_cmd.py b/tests/test_cmd.py index d795445d..66bae573 100644 --- a/tests/test_cmd.py +++ b/tests/test_cmd.py @@ -8,8 +8,9 @@ import subprocess os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) -outfile = 'tests/output.txt' - +outfile = os.path.join('tests', 'output.txt') +infile = os.path.join('tests', 'test_convert.txt') +singlefile = os.path.join('tests', 'test_convert_single_line.txt') def setup_function(function): try: @@ -23,10 +24,10 @@ def setup_function(function): def test_module_invocation(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '2015', - '--height', '300', '-i', 'tests/test_convert.txt', - '-o', outfile]) + '--height', '300', '-i', infile, '-o', outfile]) pipe.communicate() pipe.wait() + assert os.path.isfile(outfile) data = np.loadtxt(outfile) np.testing.assert_allclose(data, [[57.469547, 93.639816], @@ -36,8 +37,7 @@ def test_module_invocation(): def test_convert_YYYY(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '2015', - '--height', '300', '-i', 'tests/test_convert.txt', - '-o', outfile]) + '--height', '300', '-i', infile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) @@ -49,8 +49,7 @@ def test_convert_YYYY(): def test_convert_YYYYMM(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '201501', - '--height', '300', '-i', 'tests/test_convert.txt', - '-o', outfile]) + '--height', '300', '-i', infile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) @@ -63,7 +62,7 @@ def test_convert_YYYYMM(): def test_convert_YYYYMMDD(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '20150101', '--height', '300', '-i', - 'tests/test_convert.txt', '-o', outfile]) + infile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) @@ -76,7 +75,7 @@ def test_convert_YYYYMMDD(): def test_convert_YYYYMMDDHHMMSS(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '20150101000000', '--height', '300', '-i', - 'tests/test_convert.txt', '-o', outfile]) + infile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) @@ -89,8 +88,7 @@ def test_convert_YYYYMMDDHHMMSS(): def test_convert_single_line(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'apex', '20150101000000', '--height', '300', '-i', - 'tests/test_convert_single_line.txt', '-o', - outfile]) + singlefile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) @@ -122,8 +120,7 @@ def test_convert_refh(): def test_convert_mlt(): pipe = subprocess.Popen(['python', '-m', 'apexpy', 'geo', 'mlt', '20150101000000', '--height', '300', '-i', - 'tests/test_convert_single_line.txt', '-o', - outfile]) + singlefile, '-o', outfile]) pipe.communicate() pipe.wait() assert os.path.isfile(outfile) From aa90952d3e85b93d2c7abac702603c98cab6e622 Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 16:48:29 -0500 Subject: [PATCH 17/23] DOC: clarified parameters Clarified the parameters in the docstring. --- src/apexpy/apex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apexpy/apex.py b/src/apexpy/apex.py index a33aa2a9..4f9e2e97 100644 --- a/src/apexpy/apex.py +++ b/src/apexpy/apex.py @@ -781,9 +781,9 @@ def basevectors_apex(self, lat, lon, height, coords='geo', precision=1e-10): Parameters ---------- - lat, lon : (N,) array_like or float - Latitude lat : (N,) array_like or float + Latitude + lon : (N,) array_like or float Longitude height : (N,) array_like or float Altitude in km From d3002f332f1a9b61026887e078c4d3a1e6f5e14a Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 16:52:15 -0500 Subject: [PATCH 18/23] DOC: added a note about the geodetic system Added a note about the geodetic system to the README. --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f289c686..a2b8a896 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,9 @@ Overview This is a Python wrapper for the Apex fortran library by Emmert et al. [2010] [1]_, which allows converting between geodetic, modified apex, and quasi-dipole coordinates as well as getting modified apex and -quasi-dipole base vectors (Richmond [1995] [2]_). MLT calculations are also -included. The package is free software (MIT license). +quasi-dipole base vectors (Richmond [1995] [2]_). The geodetic system used here +is WGS84. MLT calculations are also included. The package is free software +(MIT license). Quick start =========== From 8c5de57bf7cae8ec7d7b57593a2b39b84067e6d9 Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 17:00:37 -0500 Subject: [PATCH 19/23] TST: added unit test for equator conversions Added a unit test based on the edge case provided by @bharding512 --- tests/test_Apex.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_Apex.py b/tests/test_Apex.py index 09092762..3ff5b12f 100644 --- a/tests/test_Apex.py +++ b/tests/test_Apex.py @@ -309,6 +309,17 @@ def test_convert_qd2apex(): assert_allclose(apex_out.convert(60, 15, 'qd', 'apex', height=100), apex_out.qd2apex(60, 15, height=100)) + +def test_convert_qd2apex_at_equator(): + """Test the quasi-dipole to apex conversion at the magnetic equator + """ + apex_out = Apex(date=2000, refh=80) + elat, elon = apex_out.convert(lat=0.0, lon=0, source='qd', dest='apex', + height=120.0) + clat, clon = apex_out.convert(lat=0.001, lon=0, source='qd', dest='apex', + height=120.0) + assert_allclose([elat, elon], [clat, clon], atol=1e-4) + def test_convert_qd2mlt(): datetime = dt.datetime(2000, 3, 9, 14, 25, 58) From 7ad084273f95b22b2ee6c42467ba6fbf128652c5 Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 17:06:23 -0500 Subject: [PATCH 20/23] STY: removed trailing whitespace Removed trailing whitespace for PEP8 compliance. --- tests/test_Apex.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_Apex.py b/tests/test_Apex.py index 3ff5b12f..80db26e6 100644 --- a/tests/test_Apex.py +++ b/tests/test_Apex.py @@ -309,10 +309,9 @@ def test_convert_qd2apex(): assert_allclose(apex_out.convert(60, 15, 'qd', 'apex', height=100), apex_out.qd2apex(60, 15, height=100)) - + def test_convert_qd2apex_at_equator(): - """Test the quasi-dipole to apex conversion at the magnetic equator - """ + """Test the quasi-dipole to apex conversion at the magnetic equator """ apex_out = Apex(date=2000, refh=80) elat, elon = apex_out.convert(lat=0.0, lon=0, source='qd', dest='apex', height=120.0) From 4192f3b50258c42e29af616ce1fe28eab3a3401d Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Fri, 19 Feb 2021 17:21:42 -0500 Subject: [PATCH 21/23] STY: removed more trailing whitespace Removed yet more trailing whitespace. --- tests/test_Apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_Apex.py b/tests/test_Apex.py index 80db26e6..c7cc2317 100644 --- a/tests/test_Apex.py +++ b/tests/test_Apex.py @@ -318,7 +318,7 @@ def test_convert_qd2apex_at_equator(): clat, clon = apex_out.convert(lat=0.001, lon=0, source='qd', dest='apex', height=120.0) assert_allclose([elat, elon], [clat, clon], atol=1e-4) - + def test_convert_qd2mlt(): datetime = dt.datetime(2000, 3, 9, 14, 25, 58) From 5829657e6b7d02dc66cc5520a4b01f35f56aa185 Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Fri, 19 Feb 2021 19:38:50 -0400 Subject: [PATCH 22/23] Update test_cmd.py adding whitespace for pep8 compliance --- tests/test_cmd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_cmd.py b/tests/test_cmd.py index 66bae573..20faa1da 100644 --- a/tests/test_cmd.py +++ b/tests/test_cmd.py @@ -12,6 +12,7 @@ infile = os.path.join('tests', 'test_convert.txt') singlefile = os.path.join('tests', 'test_convert_single_line.txt') + def setup_function(function): try: os.remove(outfile) From 12fcc7c1bc81c08a32ecae70922dcdd2c6dbceb3 Mon Sep 17 00:00:00 2001 From: Gregory Starr Date: Fri, 19 Feb 2021 19:42:06 -0400 Subject: [PATCH 23/23] Update test_Apex.py removing trailing whitespace to satisfy codacy --- tests/test_Apex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_Apex.py b/tests/test_Apex.py index c7cc2317..130094a8 100644 --- a/tests/test_Apex.py +++ b/tests/test_Apex.py @@ -311,7 +311,7 @@ def test_convert_qd2apex(): def test_convert_qd2apex_at_equator(): - """Test the quasi-dipole to apex conversion at the magnetic equator """ + """Test the quasi-dipole to apex conversion at the magnetic equator""" apex_out = Apex(date=2000, refh=80) elat, elon = apex_out.convert(lat=0.0, lon=0, source='qd', dest='apex', height=120.0)