Skip to content

Commit c754932

Browse files
committed
update wcslib to 6.4
1 parent 39919a5 commit c754932

68 files changed

Lines changed: 2510 additions & 2069 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGES.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ astropy.visualization
142142
astropy.wcs
143143
^^^^^^^^^^^
144144

145+
- Updated wcslib to v6.4. [#9125]
146+
145147
API Changes
146148
-----------
147149

‎astropy/wcs/setup_package.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from astropy_helpers.distutils_helpers import get_distutils_build_option
1616

1717
WCSROOT = os.path.relpath(os.path.dirname(__file__))
18-
WCSVERSION = "6.2.0"
18+
WCSVERSION = "6.4.0"
1919

2020

2121
def b(s):

‎cextern/wcslib/C/GNUmakefile‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#-----------------------------------------------------------------------------
2-
# GNU makefile for building WCSLIB 6.2 and its test suite.
2+
# GNU makefile for building WCSLIB 6.4 and its test suite.
33
#
44
# Summary of the main targets
55
# ---------------------------
@@ -31,7 +31,7 @@
3131
#
3232
# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
3333
# http://www.atnf.csiro.au/people/Mark.Calabretta
34-
# $Id: GNUmakefile,v 6.2 2018/10/20 10:03:13 mcalabre Exp $
34+
# $Id: GNUmakefile,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
3535
#-----------------------------------------------------------------------------
3636
# Get configure settings.
3737
SUBDIR := C
@@ -81,27 +81,32 @@ TEST_P := tspc tprj2 tcel1 tcel2 ttab2 ttab3 twcsmix
8181
# Test programs that require PGPLOT and PGSBOX.
8282
TEST_B := tpih2
8383

84-
# Test programs that aren't automatically exercised.
84+
# Test programs that are compiled but not automatically exercised.
8585
TEST_X := tsphdpa twcshdr
8686

87+
8788
TESTS := $(TEST_N)
8889

89-
# Add test programs that require CFITSIO if we have it.
90-
ifneq "$(CFITSIOINC)" ""
91-
ifneq "$(CFITSIOLIB)" ""
90+
# Do we have CFITSIO?
91+
ifeq "$(CFITSIOINC)$(CFITSIOLIB)" ""
92+
# No, amend TEST_X.
93+
TEST_X := $(filter-out $(TEST_C),$(TEST_X))
94+
else
95+
# Yes, add test programs that use it.
9296
TESTS += $(TEST_C)
9397
CFITSIO_CFLAGS := $(filter-out -Wpadded,$(CFLAGS))
9498
endif
95-
endif
9699

97-
# Add test programs that require PGPLOT if we have it.
100+
# Do we have PGPLOT?
98101
ifneq "$(CHECK)" "nopgplot"
99-
ifneq "$(PGPLOTINC)" ""
100-
ifneq "$(PGPLOTLIB)" ""
102+
ifeq "$(PGPLOTINC)$(PGPLOTLIB)" ""
103+
# No, amend TEST_X.
104+
TEST_X := $(filter-out $(TEST_P) $(TEST_B),$(TEST_X))
105+
else
106+
# Yes, add test programs that use it.
101107
TESTS += $(TEST_P) $(TEST_B)
102108
endif
103109
endif
104-
endif
105110

106111
# Remove tests that aren't automatically exercised.
107112
TESTS := $(filter-out $(TEST_X), $(TESTS))
@@ -205,10 +210,10 @@ run_% : %
205210
fi ; \
206211
echo 'PASS: C/$<' >> test_results ; \
207212
elif [ -f 'test/$<.out' ] ; then \
208-
trap 'rm -f run_test.tmp' 0 1 2 3 15 ; \
213+
trap 'rm -f run_$<.tmp' 0 1 2 3 15 ; \
209214
sed -e 's/$(ADDRE)/0x<address>/g' $<.out > \
210-
run_test.tmp ; \
211-
mv -f run_test.tmp $<.out ; \
215+
run_$<.tmp ; \
216+
mv -f run_$<.tmp $<.out ; \
212217
if cmp -s $<.out test/$<.out ; then \
213218
if [ '$(MODE)' != interactive ] ; then \
214219
head -2 $<.out ; \
@@ -386,17 +391,17 @@ tpih2_cfitsio : test/tpih2.c $(PGSBOXLIB) $(WCSLIB)
386391
$(CFITSIOLIB) $(WCSLIB) $(FLIBS) $(LIBS)
387392
-@ $(RM) $@.o
388393

389-
twcstab : test/twcstab.c $(GETWCSTAB) $(WCSLIB)
394+
twcstab : test/twcstab.c $(WCSLIB) $(GETWCSTAB)
390395
-@ echo ''
391396
$(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \
392397
$(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS)
393-
-@ $(RM) $@.o
398+
-@ $(RM) $@.o $(GETWCSTAB)
394399

395-
twcshdr : test/twcshdr.c $(GETWCSTAB) $(WCSLIB)
400+
twcshdr : test/twcshdr.c $(WCSLIB) $(GETWCSTAB)
396401
-@ echo ''
397402
$(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \
398403
$(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS)
399-
-@ $(RM) $@.o
404+
-@ $(RM) $@.o $(GETWCSTAB)
400405

401406
tdis3 : test/tdis3
402407
-@ echo ''
@@ -427,8 +432,10 @@ GNUmakefile : ../makedefs ;
427432
cd .. && ./config.status
428433

429434
show ::
430-
-@ -@ echo ' FLEXMODS := $(FLEXMODS)'
431-
-@ -@ echo ' MODULES := $(MODULES)'
435+
-@ echo ' FLEXMODS := $(FLEXMODS)'
436+
-@ echo ' MODULES := $(MODULES)'
437+
-@ echo ' TESTS := $(TESTS)'
438+
-@ echo ' TEST_X := $(TEST_X)'
432439

433440
# Dependencies (use the %.d pattern rule to list them)
434441
#-----------------------------------------------------

‎cextern/wcslib/C/cel.c‎

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*============================================================================
22
3-
WCSLIB 6.2 - an implementation of the FITS WCS standard.
4-
Copyright (C) 1995-2018, Mark Calabretta
3+
WCSLIB 6.4 - an implementation of the FITS WCS standard.
4+
Copyright (C) 1995-2019, Mark Calabretta
55
66
This file is part of WCSLIB.
77
@@ -22,7 +22,7 @@
2222
2323
Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
2424
http://www.atnf.csiro.au/people/Mark.Calabretta
25-
$Id: cel.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $
25+
$Id: cel.c,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
2626
*===========================================================================*/
2727

2828
#include <math.h>
@@ -62,9 +62,7 @@ const int cel_prjerr[] = {
6262

6363
/*--------------------------------------------------------------------------*/
6464

65-
int celini(cel)
66-
67-
struct celprm *cel;
65+
int celini(struct celprm *cel)
6866

6967
{
7068
register int k;
@@ -91,26 +89,19 @@ struct celprm *cel;
9189

9290
/*--------------------------------------------------------------------------*/
9391

94-
int celfree(cel)
95-
96-
struct celprm *cel;
92+
int celfree(struct celprm *cel)
9793

9894
{
9995
if (cel == 0x0) return CELERR_NULL_POINTER;
10096

101-
if (cel->err) {
102-
free(cel->err);
103-
cel->err = 0x0;
104-
}
97+
wcserr_clear(&(cel->err));
10598

10699
return cel_prjerr[prjfree(&(cel->prj))];
107100
}
108101

109102
/*--------------------------------------------------------------------------*/
110103

111-
int celprt(cel)
112-
113-
const struct celprm *cel;
104+
int celprt(const struct celprm *cel)
114105

115106
{
116107
int i;
@@ -182,9 +173,7 @@ int celperr(const struct celprm *cel, const char *prefix)
182173

183174
/*--------------------------------------------------------------------------*/
184175

185-
int celset(cel)
186-
187-
struct celprm *cel;
176+
int celset(struct celprm *cel)
188177

189178
{
190179
static const char *function = "celset";
@@ -429,14 +418,19 @@ struct celprm *cel;
429418

430419
/*--------------------------------------------------------------------------*/
431420

432-
int celx2s(cel, nx, ny, sxy, sll, x, y, phi, theta, lng, lat, stat)
433-
434-
struct celprm *cel;
435-
int nx, ny, sxy, sll;
436-
const double x[], y[];
437-
double phi[], theta[];
438-
double lng[], lat[];
439-
int stat[];
421+
int celx2s(
422+
struct celprm *cel,
423+
int nx,
424+
int ny,
425+
int sxy,
426+
int sll,
427+
const double x[],
428+
const double y[],
429+
double phi[],
430+
double theta[],
431+
double lng[],
432+
double lat[],
433+
int stat[])
440434

441435
{
442436
static const char *function = "celx2s";
@@ -475,14 +469,19 @@ int stat[];
475469

476470
/*--------------------------------------------------------------------------*/
477471

478-
int cels2x(cel, nlng, nlat, sll, sxy, lng, lat, phi, theta, x, y, stat)
479-
480-
struct celprm *cel;
481-
int nlng, nlat, sll, sxy;
482-
const double lng[], lat[];
483-
double phi[], theta[];
484-
double x[], y[];
485-
int stat[];
472+
int cels2x(
473+
struct celprm *cel,
474+
int nlng,
475+
int nlat,
476+
int sll,
477+
int sxy,
478+
const double lng[],
479+
const double lat[],
480+
double phi[],
481+
double theta[],
482+
double x[],
483+
double y[],
484+
int stat[])
486485

487486
{
488487
static const char *function = "cels2x";

‎cextern/wcslib/C/cel.h‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*============================================================================
22
3-
WCSLIB 6.2 - an implementation of the FITS WCS standard.
4-
Copyright (C) 1995-2018, Mark Calabretta
3+
WCSLIB 6.4 - an implementation of the FITS WCS standard.
4+
Copyright (C) 1995-2019, Mark Calabretta
55
66
This file is part of WCSLIB.
77
@@ -22,10 +22,10 @@
2222
2323
Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
2424
http://www.atnf.csiro.au/people/Mark.Calabretta
25-
$Id: cel.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $
25+
$Id: cel.h,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
2626
*=============================================================================
2727
*
28-
* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System
28+
* WCSLIB 6.4 - C routines that implement the FITS World Coordinate System
2929
* (WCS) standard. Refer to the README file provided with WCSLIB for an
3030
* overview of the library.
3131
*
@@ -72,6 +72,11 @@
7272
* celini() sets all members of a celprm struct to default values. It should
7373
* be used to initialize every celprm struct.
7474
*
75+
* PLEASE NOTE: If the celprm struct has already been initialized, then before
76+
* reinitializing, it celfree() should be used to free any memory that may have
77+
* been allocated to store an error message. A memory leak may otherwise
78+
* result.
79+
*
7580
* Returned:
7681
* cel struct celprm*
7782
* Celestial transformation parameters.

0 commit comments

Comments
 (0)