WCSLIB 8.4
Loading...
Searching...
No Matches
wcslib.h
Go to the documentation of this file.
1/*============================================================================
2 WCSLIB 8.4 - an implementation of the FITS WCS standard.
3 Copyright (C) 1995-2024, Mark Calabretta
4
5 This file is part of WCSLIB.
6
7 WCSLIB is free software: you can redistribute it and/or modify it under the
8 terms of the GNU Lesser General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or (at your option)
10 any later version.
11
12 WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15 more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with WCSLIB. If not, see http://www.gnu.org/licenses.
19
20 Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
21 http://www.atnf.csiro.au/people/Mark.Calabretta
22 $Id: wcslib.h,v 8.4 2024/10/28 13:56:16 mcalabre Exp $
23*=============================================================================
24*
25* WCSLIB 8.4 - C routines that implement the FITS World Coordinate System
26* (WCS) standard. Refer to the README file provided with WCSLIB for an
27* overview of the library.
28*
29* Summary of wcslib.h
30* -------------------
31* This header file is provided purely for convenience. Use it to include all
32* of the separate WCSLIB headers.
33*
34*===========================================================================*/
35
36#ifndef WCSLIB_WCSLIB
37#define WCSLIB_WCSLIB
38
39#include "cel.h"
40#include "dis.h"
41#include "fitshdr.h"
42#include "lin.h"
43#include "log.h"
44#include "prj.h"
45#include "spc.h"
46#include "sph.h"
47#include "spx.h"
48#include "tab.h"
49#include "wcs.h"
50#include "wcserr.h"
51#include "wcsfix.h"
52#include "wcshdr.h"
53#include "wcsmath.h"
54#include "wcsprintf.h"
55#include "wcstrig.h"
56#include "wcsunits.h"
57#include "wcsutil.h"
58#include "wtbarr.h"
59
60#endif // WCSLIB_WCSLIB
100
120
135
161
180
195
214
247
287
327
340
365
372
377
386
426
432
440
452
461
467
472
484
490
496
502
508
857
874
925
937
950
960
1005
1036
1055
1083
1108
1123
1141
1158
1189
1202
1246
1334
1346
1368
1377
1383
1388
1396
1408
1418
1428
1439
1446
1468
1479
1490
1497
1504
1509
1514
1520
1525
1530
1535
1540
1545
1550
1555
1566
1580
1585
1594
1605
1619
1627
1635
1642
1650
1658
1666
1674
1682
1690
1698
1706
1714
1722
1730
1748
1882
1892
1899
1904
1917
1926
1933
1939
1956
1974
2046
2051
2068
2074
2080
2086
2092
2098
2104
2111
2123
2136
2143
2150
2157
2164
2171
2206
2315
2325
2370
2381
2422
2453
2472
2502
2527
2542
2561
2594
2633
2671
2756
2766
2789
2798
2807
2840
2846
2895
2903
2909
2915
2921
2926
2931
2936
2942
2947
2952
2957
2962
2967
2972
2977
2982
2994
3000
3006
3012
3018
3024
3030
3036
3089
3114
3142
3195
3249
3250
3395
3396
3548
3549
3603
3604
3662
3663
3695 wcserr_enable(1);
3696 wcsprintf_set(stderr);
3697
3698 ...
3699
3700 if (wcsset(&wcs) {
3701 wcsperr(&wcs);
3702 return wcs.err->status;
3703 }
3704@endverbatim
3705In this example, if an error was generated in one of the prjset() functions,
3706wcsperr() would print an error traceback starting with wcsset(), then
3707celset(), and finally the particular projection-setting function that
3708generated the error. For each of them it would print the status return value,
3709function name, source file, line number, and an error message which may be
3710more specific and informative than the general error messages reported in the
3711first example. For example, in response to a deliberately generated error,
3712the @c twcs test program, which tests wcserr among other things, produces a
3713traceback similar to this:
3714@verbatim
3715ERROR 5 in wcsset() at line 1564 of file wcs.c:
3716 Invalid parameter value.
3717ERROR 2 in celset() at line 196 of file cel.c:
3718 Invalid projection parameters.
3719ERROR 2 in bonset() at line 5727 of file prj.c:
3720 Invalid parameters for Bonne's projection.
3721@endverbatim
3722
3723Each of the @ref structs "structs" in @ref overview "WCSLIB" includes a
3724pointer, called @a err, to a wcserr struct. When an error occurs, a struct is
3725allocated and error information stored in it. The wcserr pointers and the
3726@ref memory "memory" allocated for them are managed by the routines that
3727manage the various structs such as wcsinit() and wcsfree().
3728
3729wcserr messaging is an opt-in system enabled via wcserr_enable(), as in the
3730example above. If enabled, when an error occurs it is the user's
3731responsibility to free the memory allocated for the error message using
3732wcsfree(), celfree(), prjfree(), etc. Failure to do so before the struct goes
3733out of scope will result in memory leaks (if execution continues beyond the
3734error).
3735*/
3736
3737
3918
3919
3980
3981
4002
4003
4004
4115
4116
4305
4306
4345
4564
4584
4599
4625
4644
4659
4677
4711
4748
4782
4817
4828
4848
4853
4860
4872
4877
4885
4904
4911
4938
4947
4955
4962
4969
4977
4984
4989
4995
5001
5006
5015
5022
5027
5032
5051
5064
5078
5091
5104
5118
5131
5144
5158
5171
5184
5198
5211
5224
5238
5251
5265
5279
5292
5305
5319
5332
5345
5359
5372
5385
5399
5412
5425
5439
5452
5465
5479
5492
5505
5519
5532
5545
5559
5572
5585
5599
5612
5625
5639
5652
5665
5679
5692
5705
5719
5732
5745
5759
5772
5785
5799
5812
5825
5839
5852
5865
5879
5892
5905
5919
5932
5945
5959
5972
5985
5999
6012
6025
6039
6052
6065
6079
6092
6105
6119
6125
6131
6137
6143
6149
6155
6161
6167
6175
6182
6189
6195
6201
6207
6213
6219
6225
6231
6237
6399
6419
6434
6460
6485
6500
6518
6548
6580
6613
6684
6737
6793
6861
6924
6935
6954
6960
6966
6971
6976
6984
7001
7013
7023
7028
7034
7039
7044
7052
7057
7065
7077
7083
7089
7095
7101
7128
7160
7190
7254
7411
7454
7472
7497
7522
7547
7559
7564
7569
7574
7587
7592
7597
7602
7607
7612
7617
7622
7627
7632
7637
7642
7648
7653
7659
7665
7671
7676
7682
7687
7693
7698
7704
7709
7715
7720
7726
7731
7737
7742
7748
7753
7759
7764
7770
7775
7782
7787
7793
7798
7812
7820
7828
7836
7844
7852
7860
7868
7876
7884
7892
7900
7908
7916
7924
7932
7940
7948
7956
7964
7972
7980
7988
7995
8044
8099
8118
8153
8180
8199
8227
8252
8267
8285
8315
8350
8384
8395
8419
8428
8439
8461
8468
8486
8498
8504
8509
8516
8523
8530
8544
8550
8555
8560
8565
8570
8575
8580
8585
8590
8595
8600
8612
8618
8624
8630
8636
8642
8648
8750
8767
8784
8796
8855
8882
9019
9058
9067
9086
9124
9152
9173
9202
9217
9236
9266
9315
9379
9445
9551
9694
9736
9766
9794
9834
9843
9849
9882
9888
9894
9923
9939
9946
9959
9964
9970
9975
9983
9998
10003
10011
10022
10029
10036
10105
10113
10127
10139
10151
10164
10173
10182
10191
10200
10211
10222
10231
10240
10249
10260
10269
10279
10289
10299
10308
10317
10326
10335
10344
10353
10362
10371
10380
10389
10398
10407
10416
10425
10434
10443
10452
10464
10473
10482
10492
10501
10511
10521
10529
10538
10547
10558
10563
10568
10584
10594
10599
10607
10612
10617
10622
10631
10638
10646
10695
10701
10707
10713
10719
10724
10729
10734
10739
10744
10749
10754
10759
10764
10769
10774
10779
10784
10789
10794
10799
10804
10809
10814
10819
10829
10835
10840
10845
10855
10860
10865
10870
10881
10887
10893
10899
10905
10911
10917
10923
10929
10935
10941
10946
10959
10966
10973
10981
10988
10995
11001
11007
11013
11019
11025
11031
11037
11043
11049
11079
11088
11095
11108
11113
11130
11152
11170
11184
11230
11249
11359
11366
11407
11429
11477
11570
11597
11640
11686
11723
11812
11825
11832
11839
11846
11853
11860
11866
11953
12074
12949
12996
13031
13074
13092
13342
13358
13367
13376
13386
13395
13404
13414
13424
13433
13442
13451
13460
13470
13484
13495
13508
13515
13523
13530
13539
13548
13557
13567
13578
13593
13617
13635
13659
13665
13669
13673
13680
13695
13711
13728
13748
13762
13808
13819
13830
13844
13855
13866
13877
13888
13944
13995
14087
14179
14186
14211
14236
14244
14252
14260
14268
14276
14284
14292
14300
14308
14316
14324
14332
14340
14348
14356
14364
14381
14401
14439
14456
14480
14499
14518
14538
14569
14593
14612
14631
14660
14689
14709
14730
14753
14767
14789
14805
14810
14815
14824
14829
14834
14839
14845
14850
14855
14861
int celfree(struct celprm *cel)
Destructor for the celprm struct.
int celset(struct celprm *cel)
Setup routine for the celprm struct.
int prjfree(struct prjprm *prj)
Destructor for the prjprm struct.
int bonset(struct prjprm *prj)
Set up a prjprm struct for Bonne's (BON) projection.
int prjset(struct prjprm *prj)
Generic setup routine for the prjprm struct.
Error message handling.
Definition wcserr.h:243
int wcsfree(struct wcsprm *wcs)
Destructor for the wcsprm struct.
int wcsperr(const struct wcsprm *wcs, const char *prefix)
Print error messages from a wcsprm struct.
int wcsinit(int alloc, int naxis, struct wcsprm *wcs, int npvmax, int npsmax, int ndpmax)
Default constructor for the wcsprm struct.
int wcsset(struct wcsprm *wcs)
Setup routine for the wcsprm struct.
int wcserr_enable(int enable)
Enable/disable error messaging.
int wcsprintf_set(FILE *wcsout)
Set output disposition for wcsprintf() and wcsfprintf().