Commit dd97f92d authored by Ole Streicher's avatar Ole Streicher

New upstream version 0.9.8

parent e87b891a
......@@ -101,6 +101,7 @@ palPrenut.c \
palPv2el.c \
palPv2ue.c \
palPvobs.c \
palRanorm.c \
palRdplan.c \
palRefco.c \
palRefro.c \
......@@ -131,8 +132,8 @@ palTest_SOURCES = palTest.c
palTest_LDADD = libpal.la
# A target for making the SUN documentation. We do not do this automatically
palsun.tex: $(PUBLIC_C_FILES)
palsun.tex: $(PUBLIC_C_FILES) palOne2One.c
-rm -f palsun.tex all.c
cat $(PUBLIC_C_FILES) > all.c
cat $^ > all.c
${STARCONF_DEFAULT_PREFIX}/bin/sst/prolat in=all.c out=palsun.tex single=no page=no atask=no document=no
-rm all.c
PAL - Positional Astronomy Library
==================================
[![DOI](https://zenodo.org/badge/12517/Starlink/pal.svg)](http://dx.doi.org/10.5281/zenodo.17212)
[![DOI](https://zenodo.org/badge/5487324.svg)](https://zenodo.org/badge/latestdoi/5487324)
The PAL library is a partial re-implementation of Pat Wallace's popular SLALIB
library written in C using a Gnu GPL license and layered on top of the IAU's
......@@ -74,3 +74,6 @@ The description paper for PAL is: ["_PAL: A Positional Astronomy Library_"](http
Jenness, T. & Berry, D. S., in _Astronomical Data Anaysis Software and Systems XXII_,
Friedel, D. N. (ed), ASP Conf. Ser. **475**, p307.
PAL is registered with the ASCL as [ascl:1606.002](http://ascl.net/1606.002).
Please consider citing the ADASS paper or the ASCL entry if you make use of this software.
......@@ -3,7 +3,7 @@
<!-- component.xml. Generated from component.xml.in by configure. -->
<component id="pal" support="S">
<version>0.9.7</version>
<version>0.9.8</version>
<path>libext/pal</path>
<description>Positional Astronomy Library</description>
<abstract><p>
......
......@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script
AC_REVISION($Revision: 27534 $)
dnl Initialisation: package name and version number
AC_INIT([pal],[0.9.7],[starlink@jiscmail.ac.uk])
AC_INIT([pal],[0.9.8],[starlink@jiscmail.ac.uk])
AC_CONFIG_AUX_DIR([build-aux])
dnl Require autoconf-2.50 at least
......@@ -37,6 +37,12 @@ AC_SEARCH_LIBS([strlcpy], [bsd])
AS_IF([test "x$ac_cv_search_strlcpy" = "x-lbsd"], [AC_CHECK_HEADERS([bsd/string.h])])
AC_CHECK_FUNCS([strlcpy])
dnl Windows might not have str[n]casecmp
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(_stricmp)
AC_CHECK_FUNCS(_strnicmp)
# Need the math library
AC_CHECK_LIB([m],[sin])
......
......@@ -4,6 +4,11 @@ The Starlink Positional Astronomy Library (PAL) is a C implementation of the
SLALIB API. It is distributed under the GPL and uses the SOFA library wherever
possible.
V0.9.8
- Add palRanorm (thanks to Christopher Jordan)
- Fix compiler issue on Windows
V0.9.7
- Enable light deflection in palAmpqk.
......
......@@ -155,6 +155,10 @@ static void star__strellcpy( char * dest, const char * src, size_t size ) {
#define star_strellcpy(dest, src, size) star__strellcpy(dest, src, size)
#endif
#if HAVE__STRICMP || defined(_WIN32) || defined(_WIN64)
#define strcasecmp _stricmp
#endif
#include "pal.h"
#include "palmac.h"
......
......@@ -83,11 +83,19 @@
*-
*/
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "pal.h"
#include "pal1sofa.h"
#include <string.h>
#if HAVE__STRNICMP || defined(_WIN32) || defined(_WIN64)
# define strncasecmp _strnicmp
#endif
void palPreces ( const char sys[3], double ep0, double ep1,
double *ra, double *dc ) {
......
/*
*+
* Name:
* palRanorm
* Purpose:
* Reduce angle to be within [0, 2*pi) (single precision)
* Language:
* Starlink ANSI C
* Type of Module:
* Library routine
* Invocation:
* float palRanorm ( float angle );
* Arguments:
* angle = float (Given)
* Angle to be reduced (radians)
* Description:
* The result is "angle" expressed in the range 0 to 2*pi.
* Authors:
* TIMJ: Tim Jenness
* PTW: Patrick T. Wallace
* CHJ: Christopher H. Jordan
* {enter_new_authors_here}
* History:
* 2018-08-27 (CHJ):
* Initial version
* Adapted from the Fortran SLALIB library authored by Patrick Wallace.
* {enter_further_changes_here}
* Copyright:
* Copyright (C) 1995 Rutherford Appleton Laboratory
* All Rights Reserved.
* Licence:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
* Bugs:
* {note_any_bugs_here}
*-
*/
#include <math.h>
#include "pal.h"
#include "palmac.h"
float palRanorm ( float angle ) {
float reduced;
reduced = fmodf(angle, PAL__D2PI);
if (reduced < 0.0) reduced += PAL__D2PI;
return reduced;
}
......@@ -924,6 +924,9 @@ static void t_range( int *status ) {
}
static void t_ranorm( int *status ) {
vvd ( (double)palRanorm ( -0.1f ), 6.183185307179587,
1.0e-5, "palRanorm", "1", status );
vvd ( palDranrm ( -0.1 ), 6.183185307179587,
1e-12, "palDranrm", "2", status );
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment