Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

AM_CFLAGS = -Wall -Wimplicit-function-declaration
if USE_MODEL
FFTSOURCE = fft.c
PATTERNSOURCE = pattern.c
Expand Down
3 changes: 2 additions & 1 deletion src/wcs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
# along with AstrOmatic software.
# If not, see <http://www.gnu.org/licenses/>.
#
# Last modified: 10/10/2010
# Last modified: 2025-01-22 (added -Wall)
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

AM_CFLAGS= -Wall
noinst_LIBRARIES = libwcs_c.a
libwcs_c_a_SOURCES = cel.c lin.c poly.c proj.c sph.c tnx.c wcs.c \
wcstrig.c \
Expand Down
31 changes: 6 additions & 25 deletions src/wcs/cel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 18/04/2012
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
Expand Down Expand Up @@ -308,12 +308,7 @@ const char *celrev_errmsg[] = {
"Invalid value of (x,y)"};


int celset(pcode, cel, prj)

const char pcode[4];
struct celprm *cel;
struct prjprm *prj;

int celset(const char pcode[4], struct celprm *cel, struct prjprm *prj)
{
int dophip;
const double tol = 1.0e-10;
Expand Down Expand Up @@ -565,15 +560,8 @@ struct prjprm *prj;

/*--------------------------------------------------------------------------*/

int celfwd(pcode, lng, lat, cel, phi, theta, prj, x, y)

const char pcode[4];
const double lng, lat;
struct celprm *cel;
double *phi, *theta;
struct prjprm *prj;
double *x, *y;

int celfwd(const char pcode[4], const double lng, const double lat, struct celprm *cel,
double *phi, double *theta, struct prjprm *prj, double *x, double *y)
{
int err;

Expand All @@ -594,15 +582,8 @@ double *x, *y;

/*--------------------------------------------------------------------------*/

int celrev(pcode, x, y, prj, phi, theta, cel, lng, lat)

const char pcode[4];
const double x, y;
struct prjprm *prj;
double *phi, *theta;
struct celprm *cel;
double *lng, *lat;

int celrev(const char pcode[4], const double x, const double y, struct prjprm *prj,
double *phi, double *theta, struct celprm *cel, double * lng, double *lat)
{
int err;

Expand Down
8 changes: 2 additions & 6 deletions src/wcs/cel.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/*
* cel.h
*
Expand All @@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 11/04/2012
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
Expand Down Expand Up @@ -58,9 +59,6 @@
* $Id: cel.h,v 1.1.1.1 2012/04/11 16:33:26 bertin Exp $
*===========================================================================*/

#ifndef WCSLIB_CEL
#define WCSLIB_CEL

#include "proj.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -115,5 +113,3 @@ extern const char *celrev_errmsg[];
#ifdef __cplusplus
}
#endif

#endif /* WCSLIB_CEL */
28 changes: 5 additions & 23 deletions src/wcs/lin.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 10/10/2010
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
Expand Down Expand Up @@ -198,10 +198,7 @@ const char *linrev_errmsg[] = {
"Memory allocation error",
"PC matrix is singular"};

int linset(lin)

struct linprm *lin;

int linset(struct linprm *lin)
{
int i, ij, j, mem, n;

Expand Down Expand Up @@ -235,12 +232,7 @@ struct linprm *lin;

/*--------------------------------------------------------------------------*/

int linfwd(imgcrd, lin, pixcrd)

const double imgcrd[];
struct linprm *lin;
double pixcrd[];

int linfwd(const double imgcrd[], struct linprm *lin, double pixcrd[])
{
int i, ij, j, n;

Expand All @@ -266,12 +258,7 @@ double pixcrd[];

/*--------------------------------------------------------------------------*/

int linrev(pixcrd, lin, imgcrd)

const double pixcrd[];
struct linprm *lin;
double imgcrd[];

int linrev(const double pixcrd[], struct linprm *lin, double imgcrd[])
{
int i, ij, j, n;
double temp;
Expand All @@ -298,12 +285,7 @@ double imgcrd[];

/*--------------------------------------------------------------------------*/

int matinv(n, mat, inv)

const int n;
const double mat[];
double inv[];

int matinv(const int n, const double mat[], double inv[])
{
register int i, ij, ik, j, k, kj, pj;
int itemp, mem, *mxl, *lxm, pivot;
Expand Down
8 changes: 2 additions & 6 deletions src/wcs/lin.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/*
* lin.h
*
Expand All @@ -24,7 +25,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 10/10/2010
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*=============================================================================
Expand Down Expand Up @@ -58,9 +59,6 @@
* $Id: lin.h,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
*===========================================================================*/

#ifndef WCSLIB_LIN
#define WCSLIB_LIN

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -101,5 +99,3 @@ extern const char *linrev_errmsg[];
#ifdef __cplusplus
};
#endif

#endif /* WCSLIB_LIN */
8 changes: 5 additions & 3 deletions src/wcs/poly.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 20/11/2012
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

Expand Down Expand Up @@ -481,15 +481,16 @@ int poly_fit(polystruct *poly, double *x, double *y, double *w, int ndata,
coeff = poly->coeff;
for (j=ncoeff; j--;)
*(coeff++) = *(betat++);
/*
#if 0
poly_addcste(poly, offset);
*/
#endif
free(beta);

return info;
}


#if 0
/****** poly_addcste *********************************************************
PROTO void poly_addcste(polystruct *poly, double *cste)
PURPOSE Modify matrix coefficients to mimick the effect of adding a cst to
Expand Down Expand Up @@ -572,6 +573,7 @@ void poly_addcste(polystruct *poly, double *cste)

return;
}
#endif /* 0 */


/****** poly_solve ************************************************************
Expand Down
16 changes: 7 additions & 9 deletions src/wcs/poly.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/*
* poly.h
*
Expand All @@ -23,13 +24,10 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 20/11/2012
* Last modified: 2025-01-22
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

#ifndef _POLY_H_
#define _POLY_H_

/*--------------------------------- constants -------------------------------*/

#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
Expand Down Expand Up @@ -68,15 +66,15 @@ extern int cholsolve(double *a, double *b, int n),
*poly_powers(polystruct *poly),
poly_solve(double *a, double *b, int n);

extern void poly_addcste(polystruct *poly, double *cste),
poly_end(polystruct *poly);
#if 0
/* not used */
extern void poly_addcste(polystruct *poly, double *cste);
#endif
extern void poly_end(polystruct *poly);

extern double *poly_deortho(polystruct *poly, double *datain,
double *dataout),
*poly_ortho(polystruct *poly, double *datain,
double *dataout);
extern void poly_initortho(polystruct *poly, double *data,
int ndata);

#endif

Loading
Loading