JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for STARLINK Archives


STARLINK Archives

STARLINK Archives


STARLINK@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

STARLINK Home

STARLINK Home

STARLINK  November 2016

STARLINK November 2016

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Change to SLALIB/F

From:

Graham Bell <[log in to unmask]>

Reply-To:

Starlink Software User Support <[log in to unmask]>

Date:

Wed, 23 Nov 2016 09:06:40 -1000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (245 lines)

> Scott Daniel of the LSST project noticed two oddities in the Fortran
> SLALIB.  One is harmless and the other is a bug.  The latter was
> fixed long ago but I suspect is still in the Starlink version.
> Attached are revised GPL'ed copies of the two affected subroutines
> to replace the current Starlink ones.
>
> The harmless oddity was in sla_MAPQK.  In the aberration code, a
> redundant normalization was applied, that had no effect on the
> spherical coordinates, just a minuscule efficiency hit.
>
> The bug was in sla_MAPQKZ, which neglected light deflection.  This
> would have affected the returned position by typically a few mas
> for nighttime stars.  And as I said earlier, it was caught years
> ago.

Hello,

Thank you for sending the updated files!  I tried to apply them in the 
Starlink libraries/sla/ directory, but I'm confused as the differences 
(see git diff below) don't appear to be quite as you described them.

Aside from changes to the comments and copyright lines, the changes seem 
to be:

mapqk.f:
   * parameter VF altered from the 6th d.p.

mapqkz.f:
   * normalization removed from abberation calculation
     (removing variable P1DVP1)

Maybe we already had the fix for the light deflection bug and 
normalization was removed from sla_MAPQKZ instead of sla_MAPQK?

Best regards,
Graham


diff --git a/libraries/sla/mapqk.f b/libraries/sla/mapqk.f
index 0f30a78..7586adb 100644
--- a/libraries/sla/mapqk.f
+++ b/libraries/sla/mapqk.f
@@ -30,9 +30,9 @@
  *       (1)      time interval for proper motion (Julian years)
  *       (2-4)    barycentric position of the Earth (AU)
  *       (5-7)    heliocentric direction of the Earth (unit vector)
-*       (8)      (grav rad Sun)*2/(Sun-Earth distance)
+*       (8)      (Schwarzschild radius of Sun)/(Sun-Earth distance)
  *       (9-11)   barycentric Earth velocity in units of c
-*       (12)     sqrt(1-v**2) where v=modulus(ABV)
+*       (12)     sqrt(1-v^2) where v=modulus(ABV)
  *       (13-21)  precession/nutation (3,3) matrix
  *
  *  Returned:
@@ -64,9 +64,9 @@
  *     sla_DCC2S       Cartesian to spherical
  *     sla_DRANRM      normalize angle 0-2Pi
  *
-*  P.T.Wallace   Starlink   15 January 2000
+*  Last revision:   23 November 2016
  *
-*  Copyright (C) 2000 Rutherford Appleton Laboratory
+*  Copyright P.T.Wallace.  All rights reserved.
  *
  *  License:
  *    This program is free software; you can redistribute it and/or modify
@@ -81,8 +81,8 @@
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program (see SLA_CONDITIONS); if not, write to the
-*    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-*    Boston, MA  02110-1301  USA
+*    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+*    Boston, MA  02111-1307  USA
  *
  *-

@@ -96,7 +96,7 @@

  *  Km/s to AU/year
        DOUBLE PRECISION VF
-      PARAMETER (VF=0.21094502D0)
+      PARAMETER (VF=0.210949528D0)

        INTEGER I

@@ -108,7 +108,7 @@



-*  Unpack scalar and vector parameters
+*  Unpack scalar and vector parameters.
        PMT = AMPRMS(1)
        GR2E = AMPRMS(8)
        AB1 = AMPRMS(12)
@@ -118,17 +118,17 @@
           ABV(I) = AMPRMS(I+8)
        END DO

-*  Spherical to x,y,z
+*  Spherical to x,y,z.
        CALL sla_DCS2C(RM,DM,Q)

-*  Space motion (radians per year)
+*  Space motion (radians per year).
        PXR = PX*AS2R
        W = VF*RV*PXR
        EM(1) = -PR*Q(2)-PD*COS(RM)*SIN(DM)+W*Q(1)
        EM(2) =  PR*Q(1)-PD*SIN(RM)*SIN(DM)+W*Q(2)
        EM(3) =          PD*COS(DM)        +W*Q(3)

-*  Geocentric direction of star (normalized)
+*  Geocentric direction of star (normalized).
        DO I=1,3
           P(I) = Q(I)+PMT*EM(I)-PXR*EB(I)
        END DO
@@ -142,17 +142,17 @@
           P1(I) = PN(I)+W*(EHN(I)-PDE*PN(I))
        END DO

-*  Aberration (normalization omitted)
+*  Aberration (normalization omitted).
        P1DV = sla_DVDV(P1,ABV)
        W = 1D0+P1DV/(AB1+1D0)
        DO I=1,3
           P2(I) = AB1*P1(I)+W*ABV(I)
        END DO

-*  Precession and nutation
+*  Precession and nutation.
        CALL sla_DMXV(AMPRMS(13),P2,P3)

-*  Geocentric apparent RA,Dec
+*  Geocentric apparent RA,Dec.
        CALL sla_DCC2S(P3,RA,DA)
        RA = sla_DRANRM(RA)

diff --git a/libraries/sla/mapqkz.f b/libraries/sla/mapqkz.f
index 2e26bc8..a308adf 100644
--- a/libraries/sla/mapqkz.f
+++ b/libraries/sla/mapqkz.f
@@ -27,9 +27,9 @@
  *
  *       (1-4)    not used
  *       (5-7)    heliocentric direction of the Earth (unit vector)
-*       (8)      (grav rad Sun)*2/(Sun-Earth distance)
+*       (8)      (Schwarzschild radius of Sun)/(Sun-Earth distance)
  *       (9-11)   ABV: barycentric Earth velocity in units of c
-*       (12)     sqrt(1-v**2) where v=modulus(ABV)
+*       (12)     sqrt(1-v^2) where v=modulus(ABV)
  *       (13-21)  precession/nutation (3,3) matrix
  *
  *  Returned:
@@ -42,8 +42,8 @@
  *
  *  Notes:
  *
-*  1)  The vectors AMPRMS(2-4) and AMPRMS(5-7) are referred to the
-*      mean equinox and equator of epoch EQ.
+*  1)  The vector AMPRMS(5-7) is referred to the mean equinox and
+*      equator of epoch EQ.
  *
  *  2)  Strictly speaking, the routine is not valid for solar-system
  *      sources, though the error will usually be extremely small.
@@ -56,9 +56,9 @@
  *
  *  Called:  sla_DCS2C, sla_DVDV, sla_DMXV, sla_DCC2S, sla_DRANRM
  *
-*  P.T.Wallace   Starlink   18 March 1999
+*  Last revision:   23 November 2016
  *
-*  Copyright (C) 1999 Rutherford Appleton Laboratory
+*  Copyright P.T.Wallace.  All rights reserved.
  *
  *  License:
  *    This program is free software; you can redistribute it and/or modify
@@ -73,8 +73,8 @@
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program (see SLA_CONDITIONS); if not, write to the
-*    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-*    Boston, MA  02110-1301  USA
+*    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+*    Boston, MA  02111-1307  USA
  *
  *-

@@ -86,14 +86,13 @@

        DOUBLE PRECISION GR2E,AB1,EHN(3),ABV(3),
       :                 P(3),PDE,PDEP1,W,P1(3),P1DV,
-     :                 P1DVP1,P2(3),P3(3)
+     :                 P2(3),P3(3)

        DOUBLE PRECISION sla_DVDV,sla_DRANRM



-
-*  Unpack scalar and vector parameters
+*  Unpack scalar and vector parameters.
        GR2E = AMPRMS(8)
        AB1 = AMPRMS(12)
        DO I=1,3
@@ -101,10 +100,10 @@
           ABV(I) = AMPRMS(I+8)
        END DO

-*  Spherical to x,y,z
+*  Spherical to x,y,z.
        CALL sla_DCS2C(RM,DM,P)

-*  Light deflection
+*  Light deflection (restrained within the Sun's disc).
        PDE = sla_DVDV(P,EHN)
        PDEP1 = PDE+1D0
        W = GR2E/MAX(PDEP1,1D-5)
@@ -112,18 +111,17 @@
           P1(I) = P(I)+W*(EHN(I)-PDE*P(I))
        END DO

-*  Aberration
+*  Aberration (normalization omitted).
        P1DV = sla_DVDV(P1,ABV)
-      P1DVP1 = P1DV+1D0
        W = 1D0+P1DV/(AB1+1D0)
        DO I=1,3
-         P2(I) = (AB1*P1(I)+W*ABV(I))/P1DVP1
+         P2(I) = AB1*P1(I)+W*ABV(I)
        END DO

-*  Precession and nutation
+*  Precession and nutation.
        CALL sla_DMXV(AMPRMS(13),P2,P3)

-*  Geocentric apparent RA,Dec
+*  Geocentric apparent RA,Dec.
        CALL sla_DCC2S(P3,RA,DA)
        RA = sla_DRANRM(RA)

----
Starlink User Support list
For list configuration, including subscribing to and unsubscribing from the list, see
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=STARLINK

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

December 2023
November 2023
August 2023
July 2023
May 2023
April 2023
March 2023
February 2023
January 2023
November 2022
October 2022
August 2022
July 2022
June 2022
April 2022
January 2022
December 2021
October 2021
May 2021
February 2021
November 2020
October 2020
August 2020
July 2020
June 2020
February 2020
November 2019
October 2019
September 2019
July 2019
June 2019
May 2019
April 2019
March 2019
December 2018
November 2018
October 2018
September 2018
July 2018
June 2018
April 2018
January 2018
December 2017
October 2017
August 2017
July 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
September 2016
July 2016
June 2016
April 2016
March 2016
February 2016
December 2015
November 2015
October 2015
September 2015
May 2015
April 2015
March 2015
February 2015
October 2014
August 2014
July 2014
June 2014
May 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
November 2006
October 2006
September 2006
August 2006
July 2006
April 2006
March 2006
February 2006
December 2004
September 2004


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager