VIRCAM Pipeline 2.3.12
imcore_polynm-test.c
1/* $Id: imcore_polynm-test.c,v 1.1 2015/10/15 16:18:25 jim Exp $
2 *
3 * This file is part of the CASU Pipeline utilities
4 * Copyright (C) 2015 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/*
22 * $Author: jim $
23 * $Date: 2015/10/15 16:18:25 $
24 * $Revision: 1.1 $
25 * $Name: $
26 */
27
28#include <stdio.h>
29#include <stdlib.h>
30
31#include <cpl_init.h>
32#include <cpl_test.h>
33#include <casu_tfits.h>
34#include <casu_utils.h>
35#include <casu_mods.h>
36#include "../imcore.h"
37#include "../imcore_radii.h"
38
39#define NRADII 13
40
41int main(void) {
42 float x[] = {1.0,3.0,5.0,-10.0};
43 float y[] = {-0.5,-27.5,-86.5,-424.0};
44 float coefs[3] = {1.0,2.5,-4.0};
45 float poly[3];
46
47 /* Initialise */
48
49 cpl_test_init(PACKAGE_BUGREPORT,CPL_MSG_WARNING);
50
51 /* Do the test */
52
53 imcore_polynm(y,x,4,poly,3,0);
54 cpl_test_rel(poly[0],coefs[0],0.01);
55 cpl_test_rel(poly[1],coefs[1],0.01);
56 cpl_test_rel(poly[2],coefs[2],0.01);
57
58 /* Get out of here */
59
60 return(cpl_test_end(0));
61
62}
63
64/*
65
66$Log: imcore_polynm-test.c,v $
67Revision 1.1 2015/10/15 16:18:25 jim
68New
69
70
71
72*/