File: wcs_8h.html

package info (click to toggle)
python-pywcs 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 11,888 kB
  • sloc: ansic: 31,441; lex: 6,170; fortran: 6,080; sh: 3,478; python: 3,122; sed: 408; makefile: 76
file content (1166 lines) | stat: -rw-r--r-- 92,516 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>WCSLIB 4.8.2: wcs.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>wcs.h File Reference</h1><code>#include &quot;<a class="el" href="lin_8h-source.html">lin.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="cel_8h-source.html">cel.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="spc_8h-source.html">spc.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="tab_8h-source.html">tab.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="wcserr_8h-source.html">wcserr.h</a>&quot;</code><br>

<p>
<a href="wcs_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpvcard.html">pvcard</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Store for <code><b>PV</b>i<b>_</b>ma</code> keyrecords.  <a href="structpvcard.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpscard.html">pscard</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Store for <code><b>PS</b>i<b>_</b>ma</code> keyrecords.  <a href="structpscard.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwtbarr.html">wtbarr</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Extraction of coordinate lookup tables from BINTABLE.  <a href="structwtbarr.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwcsprm.html">wcsprm</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Coordinate transformation parameters.  <a href="structwcsprm.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#0653c98b8a1bee5755740ae3f4854094">WCSSUB_LONGITUDE</a>&nbsp;&nbsp;&nbsp;0x1001</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of longitude axis by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#0653c98b8a1bee5755740ae3f4854094"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#5d377c202850ee0eaf44b3e989d0736e">WCSSUB_LATITUDE</a>&nbsp;&nbsp;&nbsp;0x1002</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of latitude axis by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#5d377c202850ee0eaf44b3e989d0736e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#22bbac394b025c4cfc7bd73b6d6e3962">WCSSUB_CUBEFACE</a>&nbsp;&nbsp;&nbsp;0x1004</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of <b><code>CUBEFACE</code></b> axis by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#22bbac394b025c4cfc7bd73b6d6e3962"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#b9885b02031ff7aa7b094f4a1edee2cd">WCSSUB_CELESTIAL</a>&nbsp;&nbsp;&nbsp;0x1007</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of celestial axes by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#b9885b02031ff7aa7b094f4a1edee2cd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#4b2dfca2e80fe80ba85dc830cd9c377b">WCSSUB_SPECTRAL</a>&nbsp;&nbsp;&nbsp;0x1008</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of spectral axis by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#4b2dfca2e80fe80ba85dc830cd9c377b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#6ba6d2640572b12a11e3558fa75a01ed">WCSSUB_STOKES</a>&nbsp;&nbsp;&nbsp;0x1010</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Mask for extraction of <b><code>STOKES</code></b> axis by <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.  <a href="#6ba6d2640572b12a11e3558fa75a01ed"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#6852f6dd2883c82296f1108b897d337e">WCSLEN</a>&nbsp;&nbsp;&nbsp;(sizeof(struct <a class="el" href="structwcsprm.html">wcsprm</a>)/sizeof(int))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Size of the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct in int units.  <a href="#6852f6dd2883c82296f1108b897d337e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#c55946dadc53ac592cb686275902ae7b">wcscopy</a>(alloc, wcssrc, wcsdst)&nbsp;&nbsp;&nbsp;wcssub(alloc, wcssrc, 0, 0, wcsdst)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy routine for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#c55946dadc53ac592cb686275902ae7b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#1bcf49cfe1ed1bb2bc4c930f98d808fa">wcsini_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#1bcf49cfe1ed1bb2bc4c930f98d808fa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#465ef3c77aaf546324dae0692e6de7fe">wcssub_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#465ef3c77aaf546324dae0692e6de7fe"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#e1738854472218541bda531653ef2709">wcscopy_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#e1738854472218541bda531653ef2709"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#3d64b57cec404114c75bd25a562e8053">wcsfree_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#3d64b57cec404114c75bd25a562e8053"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#8f5c31a6983b17abbe2fead61550d55c">wcsprt_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#8f5c31a6983b17abbe2fead61550d55c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#84a67c964e212bbf004c264b3ca70fee">wcsset_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#84a67c964e212bbf004c264b3ca70fee"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#de3959355dc9d0987e7ccc4070795c38">wcsp2s_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#de3959355dc9d0987e7ccc4070795c38"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#37c4884cf58baf25b2984ec3bccb80a5">wcss2p_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#37c4884cf58baf25b2984ec3bccb80a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#cfbadc770489b6b5186b95eaa35467f1">wcsmix_errmsg</a>&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deprecated.  <a href="#cfbadc770489b6b5186b95eaa35467f1"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f">wcs_errmsg_enum</a> { <br>
&nbsp;&nbsp;<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f8b87c21d4a2cab41d4eea0a95378fca8">WCSERR_SUCCESS</a> =  0, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25fc51c733d8a719dd698f9e96e9a4fa83f">WCSERR_NULL_POINTER</a> =  1, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f5c58d5530bc7577a70185376c15180af">WCSERR_MEMORY</a> =  2, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f2904278d916c820236347783312a7ce0">WCSERR_SINGULAR_MTX</a> =  3, 
<br>
&nbsp;&nbsp;<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f598db0fcc4961aa3c5e0a296bec2b313">WCSERR_BAD_CTYPE</a> =  4, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25ffe9ed842ea8f525c7b8fed2f60015dd9">WCSERR_BAD_PARAM</a> =  5, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f71cb7eaa633d9e0f560555a016f1f007">WCSERR_BAD_COORD_TRANS</a> =  6, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25fdfa2a8cf8021827378091315b8e0a020">WCSERR_ILL_COORD_TRANS</a> =  7, 
<br>
&nbsp;&nbsp;<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f08306533cf0c7555dad662e82e8a4a69">WCSERR_BAD_PIX</a> =  8, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f03824b7b5c22e5f0cc91363eb695a804">WCSERR_BAD_WORLD</a> =  9, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f5d662102c172495df1f9bb03cedd701d">WCSERR_BAD_WORLD_COORD</a> =  10, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f832122bb304560f92df91e391d55948a">WCSERR_NO_SOLUTION</a> =  11, 
<br>
&nbsp;&nbsp;<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f88e600163f719a759d3569bf1548109e">WCSERR_BAD_SUBIMAGE</a> =  12, 
<a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f37c8aa0aedc12c63df08f39cb7177ff7">WCSERR_NON_SEPARABLE</a> =  13
<br>
 }</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#42b2578d76ace7ca6114d82b7ae46a89">wcsnpv</a> (int n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory allocation for <code><b>PV</b>i<b>_</b>ma</code>.  <a href="#42b2578d76ace7ca6114d82b7ae46a89"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#e790c9ce6c9b7a4845cf1c3c97b1e97a">wcsnps</a> (int n)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory allocation for <code><b>PS</b>i<b>_</b>ma</code>.  <a href="#e790c9ce6c9b7a4845cf1c3c97b1e97a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45">wcsini</a> (int alloc, int naxis, struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#2afc8255fde0965dddaa374463666d45"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64">wcssub</a> (int alloc, const struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcssrc, int *nsub, int axes[], struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcsdst)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Subimage extraction routine for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#864c99fef9f3eee29085ce42d0ee0d64"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#4ab38bc642c4656f62c43acf84a849f1">wcsfree</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#4ab38bc642c4656f62c43acf84a849f1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#b9aeb8cf1afb1bfb22e989580d90fca8">wcsprt</a> (const struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print routine for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#b9aeb8cf1afb1bfb22e989580d90fca8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#8fe5dcd9927240dc0348b850ee662367">wcsperr</a> (const struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, const char *prefix)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print error messages from a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#8fe5dcd9927240dc0348b850ee662367"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91">wcsset</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Setup routine for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct.  <a href="#e5cc3f5d249755583403cdf54d2ebb91"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#27d3dd209db3e76cf4c50f48c01ba986">wcsp2s</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int ncoord, int nelem, const double pixcrd[], double imgcrd[], double phi[], double theta[], double world[], int stat[])</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pixel-to-world transformation.  <a href="#27d3dd209db3e76cf4c50f48c01ba986"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#60673d05a3513659ac848a9cb3d0cb07">wcss2p</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int ncoord, int nelem, const double world[], double phi[], double theta[], double imgcrd[], double pixcrd[], int stat[])</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">World-to-pixel transformation.  <a href="#60673d05a3513659ac848a9cb3d0cb07"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#f3f00b876c8212d43f32a51feeadaa81">wcsmix</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int mixpix, int mixcel, const double vspan[], double vstep, int viter, double world[], double phi[], double theta[], double imgcrd[], double pixcrd[])</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Hybrid coordinate transformation.  <a href="#f3f00b876c8212d43f32a51feeadaa81"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#57975833fe0588eb7c7b6d79f13a7693">wcssptr</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int *i, char ctype[9])</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Spectral axis translation.  <a href="#57975833fe0588eb7c7b6d79f13a7693"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a> []</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Status return messages.  <a href="#d16bd8db875ee05b014429efdc1f3471"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
These routines implement the FITS World Coordinate System (WCS) standard which defines methods to be used for computing world coordinates from image pixel coordinates, and vice versa. They are based on the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct which contains all information needed for the computations. The struct contains some members that must be set by the user, and others that are maintained by these routines, somewhat like a C++ class but with no encapsulation.<p>
Three routines, <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a>, <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>, and <a class="el" href="wcs_8h.html#4ab38bc642c4656f62c43acf84a849f1" title="Destructor for the wcsprm struct.">wcsfree()</a> are provided to manage the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct and another, <a class="el" href="wcs_8h.html#b9aeb8cf1afb1bfb22e989580d90fca8" title="Print routine for the wcsprm struct.">wcsprt()</a>, to prints its contents. Refer to the description of the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct for an explanation of the anticipated usage of these routines. <a class="el" href="wcs_8h.html#c55946dadc53ac592cb686275902ae7b" title="Copy routine for the wcsprm struct.">wcscopy()</a>, which does a deep copy of one <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct to another, is defined as a preprocessor macro function that invokes <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>.<p>
<a class="el" href="wcs_8h.html#8fe5dcd9927240dc0348b850ee662367" title="Print error messages from a wcsprm struct.">wcsperr()</a> prints the error message(s) (if any) stored in a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct, and the <a class="el" href="structlinprm.html" title="Linear transformation parameters.">linprm</a>, <a class="el" href="structcelprm.html" title="Celestial transformation parameters.">celprm</a>, <a class="el" href="structprjprm.html" title="Projection parameters.">prjprm</a>, <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a>, and <a class="el" href="structtabprm.html" title="Tabular transformation parameters.">tabprm</a> structs that it contains.<p>
A setup routine, <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, computes intermediate values in the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct from parameters in it that were supplied by the user. The struct always needs to be set up by <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> but this need not be called explicitly - refer to the explanation of <a class="el" href="structwcsprm.html#35bff8de85e5a8892e1b68db69ca7a68">wcsprm::flag</a>.<p>
<a class="el" href="wcs_8h.html#27d3dd209db3e76cf4c50f48c01ba986" title="Pixel-to-world transformation.">wcsp2s()</a> and <a class="el" href="wcs_8h.html#60673d05a3513659ac848a9cb3d0cb07" title="World-to-pixel transformation.">wcss2p()</a> implement the WCS world coordinate transformations. In fact, they are high level driver routines for the WCS linear, logarithmic, celestial, spectral and tabular transformation routines described in <a class="el" href="lin_8h.html">lin.h</a>, <a class="el" href="log_8h.html">log.h</a>, <a class="el" href="cel_8h.html">cel.h</a>, <a class="el" href="spc_8h.html">spc.h</a> and <a class="el" href="tab_8h.html">tab.h</a>.<p>
Given either the celestial longitude or latitude plus an element of the pixel coordinate a hybrid routine, <a class="el" href="wcs_8h.html#f3f00b876c8212d43f32a51feeadaa81" title="Hybrid coordinate transformation.">wcsmix()</a>, iteratively solves for the unknown elements.<p>
<a class="el" href="wcs_8h.html#57975833fe0588eb7c7b6d79f13a7693" title="Spectral axis translation.">wcssptr()</a> translates the spectral axis in a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct. For example, a '<code><b>FREQ</b></code>' axis may be translated into <code><b>'ZOPT-F2W'</b></code> and vice versa.<p>
<b>Quadcube projections:</b> <br>
 The quadcube projections (<code><b>TSC</b></code>, <code><b>CSC</b></code>, <code><b>QSC</b></code>) may be represented in FITS in either of two ways:<p>
a: The six faces may be laid out in one plane and numbered as follows: <div class="fragment"><pre class="fragment">                                  0
 
                         4  3  2  1  4  3  2
 
                                  5
</pre></div><p>
Faces 2, 3 and 4 may appear on one side or the other (or both). The world-to-pixel routines map faces 2, 3 and 4 to the left but the pixel-to-world routines accept them on either side.<p>
b: The "COBE" convention in which the six faces are stored in a three-dimensional structure using a <code><b>CUBEFACE</b></code> axis indexed from 0 to 5 as above.<p>
These routines support both methods; <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> determines which is being used by the presence or absence of a <code><b>CUBEFACE</b></code> axis in ctype[]. <a class="el" href="wcs_8h.html#27d3dd209db3e76cf4c50f48c01ba986" title="Pixel-to-world transformation.">wcsp2s()</a> and <a class="el" href="wcs_8h.html#60673d05a3513659ac848a9cb3d0cb07" title="World-to-pixel transformation.">wcss2p()</a> translate the <code><b>CUBEFACE</b></code> axis representation to the single plane representation understood by the lower-level WCSLIB projection routines. <hr><h2>Define Documentation</h2>
<a class="anchor" name="0653c98b8a1bee5755740ae3f4854094"></a><!-- doxytag: member="wcs.h::WCSSUB_LONGITUDE" ref="0653c98b8a1bee5755740ae3f4854094" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_LONGITUDE&nbsp;&nbsp;&nbsp;0x1001          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the longitude axis when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="5d377c202850ee0eaf44b3e989d0736e"></a><!-- doxytag: member="wcs.h::WCSSUB_LATITUDE" ref="5d377c202850ee0eaf44b3e989d0736e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_LATITUDE&nbsp;&nbsp;&nbsp;0x1002          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the latitude axis when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="22bbac394b025c4cfc7bd73b6d6e3962"></a><!-- doxytag: member="wcs.h::WCSSUB_CUBEFACE" ref="22bbac394b025c4cfc7bd73b6d6e3962" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_CUBEFACE&nbsp;&nbsp;&nbsp;0x1004          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the <b><code>CUBEFACE</code></b> axis when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="b9885b02031ff7aa7b094f4a1edee2cd"></a><!-- doxytag: member="wcs.h::WCSSUB_CELESTIAL" ref="b9885b02031ff7aa7b094f4a1edee2cd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_CELESTIAL&nbsp;&nbsp;&nbsp;0x1007          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the celestial axes (longitude, latitude and cubeface) when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="4b2dfca2e80fe80ba85dc830cd9c377b"></a><!-- doxytag: member="wcs.h::WCSSUB_SPECTRAL" ref="4b2dfca2e80fe80ba85dc830cd9c377b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_SPECTRAL&nbsp;&nbsp;&nbsp;0x1008          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the spectral axis when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="6ba6d2640572b12a11e3558fa75a01ed"></a><!-- doxytag: member="wcs.h::WCSSUB_STOKES" ref="6ba6d2640572b12a11e3558fa75a01ed" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSSUB_STOKES&nbsp;&nbsp;&nbsp;0x1010          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Mask to use for extracting the <b><code>STOKES</code></b> axis when sub-imaging, refer to the <em>axes</em> argument of <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a>. 
</div>
</div><p>
<a class="anchor" name="6852f6dd2883c82296f1108b897d337e"></a><!-- doxytag: member="wcs.h::WCSLEN" ref="6852f6dd2883c82296f1108b897d337e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WCSLEN&nbsp;&nbsp;&nbsp;(sizeof(struct <a class="el" href="structwcsprm.html">wcsprm</a>)/sizeof(int))          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Size of the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct in <em>int</em> units, used by the Fortran wrappers. 
</div>
</div><p>
<a class="anchor" name="c55946dadc53ac592cb686275902ae7b"></a><!-- doxytag: member="wcs.h::wcscopy" ref="c55946dadc53ac592cb686275902ae7b" args="(alloc, wcssrc, wcsdst)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcscopy          </td>
          <td>(</td>
          <td class="paramtype">alloc,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wcssrc,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wcsdst&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td>&nbsp;&nbsp;&nbsp;wcssub(alloc, wcssrc, 0, 0, wcsdst)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcscopy</b>() does a deep copy of one <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct to another. As of WCSLIB 3.6, it is implemented as a preprocessor macro that invokes <a class="el" href="wcs_8h.html#864c99fef9f3eee29085ce42d0ee0d64" title="Subimage extraction routine for the wcsprm struct.">wcssub()</a> with the nsub and axes pointers both set to zero. 
</div>
</div><p>
<a class="anchor" name="1bcf49cfe1ed1bb2bc4c930f98d808fa"></a><!-- doxytag: member="wcs.h::wcsini_errmsg" ref="1bcf49cfe1ed1bb2bc4c930f98d808fa" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsini_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000031">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="465ef3c77aaf546324dae0692e6de7fe"></a><!-- doxytag: member="wcs.h::wcssub_errmsg" ref="465ef3c77aaf546324dae0692e6de7fe" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcssub_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000032">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="e1738854472218541bda531653ef2709"></a><!-- doxytag: member="wcs.h::wcscopy_errmsg" ref="e1738854472218541bda531653ef2709" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcscopy_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000033">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="3d64b57cec404114c75bd25a562e8053"></a><!-- doxytag: member="wcs.h::wcsfree_errmsg" ref="3d64b57cec404114c75bd25a562e8053" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsfree_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000034">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="8f5c31a6983b17abbe2fead61550d55c"></a><!-- doxytag: member="wcs.h::wcsprt_errmsg" ref="8f5c31a6983b17abbe2fead61550d55c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsprt_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000035">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="84a67c964e212bbf004c264b3ca70fee"></a><!-- doxytag: member="wcs.h::wcsset_errmsg" ref="84a67c964e212bbf004c264b3ca70fee" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsset_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000036">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="de3959355dc9d0987e7ccc4070795c38"></a><!-- doxytag: member="wcs.h::wcsp2s_errmsg" ref="de3959355dc9d0987e7ccc4070795c38" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsp2s_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000037">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="37c4884cf58baf25b2984ec3bccb80a5"></a><!-- doxytag: member="wcs.h::wcss2p_errmsg" ref="37c4884cf58baf25b2984ec3bccb80a5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcss2p_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000038">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<a class="anchor" name="cfbadc770489b6b5186b95eaa35467f1"></a><!-- doxytag: member="wcs.h::wcsmix_errmsg" ref="cfbadc770489b6b5186b95eaa35467f1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define wcsmix_errmsg&nbsp;&nbsp;&nbsp;<a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000039">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471" title="Status return messages.">wcs_errmsg</a> directly now instead. </dd></dl>

</div>
</div><p>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="158615aa1622d8feedd228795ff9a25f"></a><!-- doxytag: member="wcs.h::wcs_errmsg_enum" ref="158615aa1622d8feedd228795ff9a25f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="wcs_8h.html#158615aa1622d8feedd228795ff9a25f">wcs_errmsg_enum</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f8b87c21d4a2cab41d4eea0a95378fca8"></a><!-- doxytag: member="WCSERR_SUCCESS" ref="158615aa1622d8feedd228795ff9a25f8b87c21d4a2cab41d4eea0a95378fca8" args="" -->WCSERR_SUCCESS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25fc51c733d8a719dd698f9e96e9a4fa83f"></a><!-- doxytag: member="WCSERR_NULL_POINTER" ref="158615aa1622d8feedd228795ff9a25fc51c733d8a719dd698f9e96e9a4fa83f" args="" -->WCSERR_NULL_POINTER</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f5c58d5530bc7577a70185376c15180af"></a><!-- doxytag: member="WCSERR_MEMORY" ref="158615aa1622d8feedd228795ff9a25f5c58d5530bc7577a70185376c15180af" args="" -->WCSERR_MEMORY</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f2904278d916c820236347783312a7ce0"></a><!-- doxytag: member="WCSERR_SINGULAR_MTX" ref="158615aa1622d8feedd228795ff9a25f2904278d916c820236347783312a7ce0" args="" -->WCSERR_SINGULAR_MTX</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f598db0fcc4961aa3c5e0a296bec2b313"></a><!-- doxytag: member="WCSERR_BAD_CTYPE" ref="158615aa1622d8feedd228795ff9a25f598db0fcc4961aa3c5e0a296bec2b313" args="" -->WCSERR_BAD_CTYPE</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25ffe9ed842ea8f525c7b8fed2f60015dd9"></a><!-- doxytag: member="WCSERR_BAD_PARAM" ref="158615aa1622d8feedd228795ff9a25ffe9ed842ea8f525c7b8fed2f60015dd9" args="" -->WCSERR_BAD_PARAM</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f71cb7eaa633d9e0f560555a016f1f007"></a><!-- doxytag: member="WCSERR_BAD_COORD_TRANS" ref="158615aa1622d8feedd228795ff9a25f71cb7eaa633d9e0f560555a016f1f007" args="" -->WCSERR_BAD_COORD_TRANS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25fdfa2a8cf8021827378091315b8e0a020"></a><!-- doxytag: member="WCSERR_ILL_COORD_TRANS" ref="158615aa1622d8feedd228795ff9a25fdfa2a8cf8021827378091315b8e0a020" args="" -->WCSERR_ILL_COORD_TRANS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f08306533cf0c7555dad662e82e8a4a69"></a><!-- doxytag: member="WCSERR_BAD_PIX" ref="158615aa1622d8feedd228795ff9a25f08306533cf0c7555dad662e82e8a4a69" args="" -->WCSERR_BAD_PIX</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f03824b7b5c22e5f0cc91363eb695a804"></a><!-- doxytag: member="WCSERR_BAD_WORLD" ref="158615aa1622d8feedd228795ff9a25f03824b7b5c22e5f0cc91363eb695a804" args="" -->WCSERR_BAD_WORLD</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f5d662102c172495df1f9bb03cedd701d"></a><!-- doxytag: member="WCSERR_BAD_WORLD_COORD" ref="158615aa1622d8feedd228795ff9a25f5d662102c172495df1f9bb03cedd701d" args="" -->WCSERR_BAD_WORLD_COORD</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f832122bb304560f92df91e391d55948a"></a><!-- doxytag: member="WCSERR_NO_SOLUTION" ref="158615aa1622d8feedd228795ff9a25f832122bb304560f92df91e391d55948a" args="" -->WCSERR_NO_SOLUTION</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f88e600163f719a759d3569bf1548109e"></a><!-- doxytag: member="WCSERR_BAD_SUBIMAGE" ref="158615aa1622d8feedd228795ff9a25f88e600163f719a759d3569bf1548109e" args="" -->WCSERR_BAD_SUBIMAGE</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="158615aa1622d8feedd228795ff9a25f37c8aa0aedc12c63df08f39cb7177ff7"></a><!-- doxytag: member="WCSERR_NON_SEPARABLE" ref="158615aa1622d8feedd228795ff9a25f37c8aa0aedc12c63df08f39cb7177ff7" args="" -->WCSERR_NON_SEPARABLE</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="42b2578d76ace7ca6114d82b7ae46a89"></a><!-- doxytag: member="wcs.h::wcsnpv" ref="42b2578d76ace7ca6114d82b7ae46a89" args="(int n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsnpv           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>n</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsnpv</b>() changes the value of NPVMAX (default 64). This global variable controls the number of <code><b>PV</b>i<b>_</b>ma</code> keywords that <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> should allocate space for.<p>
<b>PLEASE NOTE:</b> This function is not thread-safe.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>Value of NPVMAX; ignored if &lt; 0.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current value of NPVMAX. </dd></dl>

</div>
</div><p>
<a class="anchor" name="e790c9ce6c9b7a4845cf1c3c97b1e97a"></a><!-- doxytag: member="wcs.h::wcsnps" ref="e790c9ce6c9b7a4845cf1c3c97b1e97a" args="(int n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsnps           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>n</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsnps</b>() changes the values of NPSMAX (default 8). This global variable controls the number of <code><b>PS</b>i<b>_</b>ma</code> keywords that <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> should allocate space for.<p>
<b>PLEASE NOTE:</b> This function is not thread-safe.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>Value of NPSMAX; ignored if &lt; 0.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current value of NPSMAX. </dd></dl>

</div>
</div><p>
<a class="anchor" name="2afc8255fde0965dddaa374463666d45"></a><!-- doxytag: member="wcs.h::wcsini" ref="2afc8255fde0965dddaa374463666d45" args="(int alloc, int naxis, struct wcsprm *wcs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsini           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>alloc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>naxis</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsini</b>() optionally allocates memory for arrays in a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct and sets all members of the struct to default values. Memory is allocated for up to NPVMAX <code><b>PV</b>i<b>_</b>ma</code> keywords or NPSMAX <code><b>PS</b>i<b>_</b>ma</code> keywords per WCS representation. These may be changed via <a class="el" href="wcs_8h.html#42b2578d76ace7ca6114d82b7ae46a89" title="Memory allocation for PVi_ma.">wcsnpv()</a> and <a class="el" href="wcs_8h.html#e790c9ce6c9b7a4845cf1c3c97b1e97a" title="Memory allocation for PSi_ma.">wcsnps()</a> before <b>wcsini</b>() is called.<p>
<b>PLEASE NOTE:</b> every <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct should be initialized by <b>wcsini</b>(), possibly repeatedly. On the first invokation, and only the first invokation, <a class="el" href="structwcsprm.html#35bff8de85e5a8892e1b68db69ca7a68">wcsprm::flag</a> must be set to -1 to initialize memory management, regardless of whether <b>wcsini</b>() will actually be used to allocate memory.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>alloc</em>&nbsp;</td><td>If true, allocate memory unconditionally for the crpix, etc. arrays. <br>
 If false, it is assumed that pointers to these arrays have been set by the user except if they are null pointers in which case memory will be allocated for them regardless. (In other words, setting alloc true saves having to initalize these pointers to zero.) </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>naxis</em>&nbsp;</td><td>The number of world coordinate axes. This is used to determine the length of the various <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> vectors and matrices and therefore the amount of memory to allocate for them.</td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters. <br>
 Note that, in order to initialize memory management, <a class="el" href="structwcsprm.html#35bff8de85e5a8892e1b68db69ca7a68">wcsprm::flag</a> should be set to -1 when wcs is initialized for the first time (memory leaks may result if it had already been initialized).</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>

</div>
</div><p>
<a class="anchor" name="864c99fef9f3eee29085ce42d0ee0d64"></a><!-- doxytag: member="wcs.h::wcssub" ref="864c99fef9f3eee29085ce42d0ee0d64" args="(int alloc, const struct wcsprm *wcssrc, int *nsub, int axes[], struct wcsprm *wcsdst)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcssub           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>alloc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcssrc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>nsub</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>axes</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcsdst</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcssub</b>() extracts the coordinate description for a subimage from a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct. It does a deep copy, using <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> to allocate memory for its arrays if required. Only the "information to be provided" part of the struct is extracted; a call to <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> is required to set up the remainder.<p>
The world coordinate system of the subimage must be separable in the sense that the world coordinates at any point in the subimage must depend only on the pixel coordinates of the axes extracted. In practice, this means that the <code><b>PC</b>i<b>_</b>ja</code> matrix of the original image must not contain non-zero off-diagonal terms that associate any of the subimage axes with any of the non-subimage axes.<p>
Note that while the required elements of the <a class="el" href="structtabprm.html" title="Tabular transformation parameters.">tabprm</a> array are extracted, the <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE.">wtbarr</a> array is not. (Thus it is not appropriate to call <b>wcssub</b>() after <a class="el" href="wcshdr_8h.html#6dd857f7b61a5b349cc8af5a4b6d8a1c" title="Tabular construction routine.">wcstab()</a> but before filling the <a class="el" href="structtabprm.html" title="Tabular transformation parameters.">tabprm</a> structs - refer to <a class="el" href="wcshdr_8h.html">wcshdr.h</a>.)<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>alloc</em>&nbsp;</td><td>If true, allocate memory for the crpix, etc. arrays in the destination. Otherwise, it is assumed that pointers to these arrays have been set by the user except if they are null pointers in which case memory will be allocated for them regardless. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>wcssrc</em>&nbsp;</td><td>Struct to extract from.</td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>nsub</em>&nbsp;</td><td></td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>axes</em>&nbsp;</td><td>Vector of length *nsub containing the image axis numbers (1-relative) to extract. Order is significant; axes[0] is the axis number of the input image that corresponds to the first axis in the subimage, etc. <br>
 nsub (the pointer) may be set to zero, and so also may nsub, to indicate the number of axes in the input image; the number of axes will be returned if nsub != 0. axes itself (the pointer) may be set to zero to indicate the first *nsub axes in their original order. <br>
 Set both nsub and axes to zero to do a deep copy of one <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct to another. <br>
 Subimage extraction by coordinate axis type may be done by setting the elements of axes[] to the following special preprocessor macro values: <br>
<ul>
<li>WCSSUB_LONGITUDE: Celestial longitude.</li><li>WCSSUB_LATITUDE: Celestial latitude.</li><li>WCSSUB_CUBEFACE: Quadcube <code><b>CUBEFACE</b></code> axis.</li><li>WCSSUB_SPECTRAL: Spectral axis.</li><li>WCSSUB_STOKES: Stokes axis.</li></ul>
Refer to the notes (below) for further usage examples. <br>
 On return, *nsub will contain the number of axes in the subimage; this may be zero if there were no axes of the required type(s) (in which case no memory will be allocated). axes[] will contain the axis numbers that were extracted. The vector length must be sufficient to contain all axis numbers. No checks are performed to verify that the coordinate axes are consistent, this is done by <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>. </td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcsdst</em>&nbsp;</td><td>Struct describing the subimage. <a class="el" href="structwcsprm.html#35bff8de85e5a8892e1b68db69ca7a68">wcsprm::flag</a> should be set to -1 if wcsdst was not previously initialized (memory leaks may result if it was previously initialized).</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>12: Invalid subimage specification.</li><li>13: Non-separable subimage coordinate system.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>.</dd></dl>
<b>Notes:</b> <br>
 Combinations of subimage axes of particular types may be extracted in the same order as they occur in the input image by combining preprocessor codes, for example <div class="fragment"><pre class="fragment">      *nsub = 1;
      axes[0] = <a class="code" href="wcs_8h.html#0653c98b8a1bee5755740ae3f4854094" title="Mask for extraction of longitude axis by wcssub().">WCSSUB_LONGITUDE</a> | <a class="code" href="wcs_8h.html#5d377c202850ee0eaf44b3e989d0736e" title="Mask for extraction of latitude axis by wcssub().">WCSSUB_LATITUDE</a> | <a class="code" href="wcs_8h.html#4b2dfca2e80fe80ba85dc830cd9c377b" title="Mask for extraction of spectral axis by wcssub().">WCSSUB_SPECTRAL</a>;
</pre></div><p>
would extract the longitude, latitude, and spectral axes in the same order as the input image. If one of each were present, *nsub = 3 would be returned.<p>
For convenience, WCSSUB_CELESTIAL is defined as the combination WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_CUBEFACE.<p>
The codes may also be negated to extract all but the types specified, for example <div class="fragment"><pre class="fragment">      *nsub = 4;
      axes[0] = <a class="code" href="wcs_8h.html#0653c98b8a1bee5755740ae3f4854094" title="Mask for extraction of longitude axis by wcssub().">WCSSUB_LONGITUDE</a>;
      axes[1] = <a class="code" href="wcs_8h.html#5d377c202850ee0eaf44b3e989d0736e" title="Mask for extraction of latitude axis by wcssub().">WCSSUB_LATITUDE</a>;
      axes[2] = <a class="code" href="wcs_8h.html#22bbac394b025c4cfc7bd73b6d6e3962" title="Mask for extraction of CUBEFACE axis by wcssub().">WCSSUB_CUBEFACE</a>;
      axes[3] = -(<a class="code" href="wcs_8h.html#4b2dfca2e80fe80ba85dc830cd9c377b" title="Mask for extraction of spectral axis by wcssub().">WCSSUB_SPECTRAL</a> | <a class="code" href="wcs_8h.html#6ba6d2640572b12a11e3558fa75a01ed" title="Mask for extraction of STOKES axis by wcssub().">WCSSUB_STOKES</a>);
</pre></div><p>
The last of these specifies all axis types other than spectral or Stokes. Extraction is done in the order specified by axes[] a longitude axis (if present) would be extracted first (via axes[0]) and not subsequently (via axes[3]). Likewise for the latitude and cubeface axes in this example.<p>
From the foregoing, it is apparent that the value of *nsub returned may be less than or greater than that given. However, it will never exceed the number of axes in the input image. 
</div>
</div><p>
<a class="anchor" name="4ab38bc642c4656f62c43acf84a849f1"></a><!-- doxytag: member="wcs.h::wcsfree" ref="4ab38bc642c4656f62c43acf84a849f1" args="(struct wcsprm *wcs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsfree           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsfree</b>() frees memory allocated for the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> arrays by <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> and/or <a class="el" href="wcs_8h.html#e5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>. <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> records the memory it allocates and <b>wcsfree</b>() will only attempt to free this.<p>
<b>PLEASE NOTE:</b> <b>wcsfree</b>() must not be invoked on a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct that was not initialized by <a class="el" href="wcs_8h.html#2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed. </li></ul>
</dd></dl>

</div>
</div><p>
<a class="anchor" name="b9aeb8cf1afb1bfb22e989580d90fca8"></a><!-- doxytag: member="wcs.h::wcsprt" ref="b9aeb8cf1afb1bfb22e989580d90fca8" args="(const struct wcsprm *wcs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsprt           </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsprt</b>() prints the contents of a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct using <a class="el" href="wcsprintf_8h.html#46950abaf5a27347da8160741f98f973" title="Print function used by WCSLIB diagnostic routines.">wcsprintf()</a>. Mainly intended for diagnostic purposes.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed. </li></ul>
</dd></dl>

</div>
</div><p>
<a class="anchor" name="8fe5dcd9927240dc0348b850ee662367"></a><!-- doxytag: member="wcs.h::wcsperr" ref="8fe5dcd9927240dc0348b850ee662367" args="(const struct wcsprm *wcs, const char *prefix)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsperr           </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>prefix</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsperr</b>() prints the error message(s), if any, stored in a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct, and the <a class="el" href="structlinprm.html" title="Linear transformation parameters.">linprm</a>, <a class="el" href="structcelprm.html" title="Celestial transformation parameters.">celprm</a>, <a class="el" href="structprjprm.html" title="Projection parameters.">prjprm</a>, <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a>, and <a class="el" href="structtabprm.html" title="Tabular transformation parameters.">tabprm</a> structs that it contains. If there are no errors then nothing is printed. It uses <a class="el" href="wcserr_8h.html#6585b9fc3a59b369e3336f3133dd1ca9" title="Print a wcserr struct.">wcserr_prt()</a>, q.v.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>prefix</em>&nbsp;</td><td>If non-NULL, each output line will be prefixed with this string.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed. </li></ul>
</dd></dl>

</div>
</div><p>
<a class="anchor" name="e5cc3f5d249755583403cdf54d2ebb91"></a><!-- doxytag: member="wcs.h::wcsset" ref="e5cc3f5d249755583403cdf54d2ebb91" args="(struct wcsprm *wcs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsset           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsset</b>() sets up a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct according to information supplied within it (refer to the description of the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct).<p>
<b>wcsset</b>() recognizes the <code><b>NCP</b></code> projection and converts it to the equivalent <code><b>SIN</b></code> projection and likewise translates <code><b>GLS</b></code> into <code><b>SFL</b></code>. It also translates the AIPS spectral types (<code><b>'FREQ-LSR'</b></code>, <code><b>'FELO-HEL'</b></code>, etc.), possibly changing the input header keywords <a class="el" href="structwcsprm.html#e1f462606974e1324cd38f143eda691e">wcsprm::ctype</a> and/or <a class="el" href="structwcsprm.html#c089e5d0e3191255ceaea7f8591b27ea">wcsprm::specsys</a> if necessary.<p>
Note that this routine need not be called directly; it will be invoked by <a class="el" href="wcs_8h.html#27d3dd209db3e76cf4c50f48c01ba986" title="Pixel-to-world transformation.">wcsp2s()</a> and <a class="el" href="wcs_8h.html#60673d05a3513659ac848a9cb3d0cb07" title="World-to-pixel transformation.">wcss2p()</a> if the <a class="el" href="structwcsprm.html#35bff8de85e5a8892e1b68db69ca7a68">wcsprm::flag</a> is anything other than a predefined magic value.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>3: Linear transformation matrix is singular.</li><li>4: Inconsistent or unrecognized coordinate axis types.</li><li>5: Invalid parameter value.</li><li>6: Invalid coordinate transformation parameters.</li><li>7: Ill-conditioned coordinate transformation parameters.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>

</div>
</div><p>
<a class="anchor" name="27d3dd209db3e76cf4c50f48c01ba986"></a><!-- doxytag: member="wcs.h::wcsp2s" ref="27d3dd209db3e76cf4c50f48c01ba986" args="(struct wcsprm *wcs, int ncoord, int nelem, const double pixcrd[], double imgcrd[], double phi[], double theta[], double world[], int stat[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsp2s           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>ncoord</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nelem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&nbsp;</td>
          <td class="paramname"> <em>pixcrd</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>imgcrd</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>phi</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>theta</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>world</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>stat</em>[]</td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsp2s</b>() transforms pixel coordinates to world coordinates.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters.</td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ncoord,nelem</em>&nbsp;</td><td>The number of coordinates, each of vector length nelem but containing wcs.naxis coordinate elements. Thus nelem must equal or exceed the value of the <code><b>NAXIS</b></code> keyword unless ncoord == 1, in which case nelem is not used. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pixcrd</em>&nbsp;</td><td>Array of pixel coordinates.</td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>imgcrd</em>&nbsp;</td><td>Array of intermediate world coordinates. For celestial axes, imgcrd[][wcs.lng] and imgcrd[][wcs.lat] are the projected <img class="formulaInl" alt="$x$" src="form_30.png">-, and <img class="formulaInl" alt="$y$" src="form_31.png">-coordinates in pseudo "degrees". For spectral axes, imgcrd[][wcs.spec] is the intermediate spectral coordinate, in SI units. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>phi,theta</em>&nbsp;</td><td>Longitude and latitude in the native coordinate system of the projection [deg]. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>world</em>&nbsp;</td><td>Array of world coordinates. For celestial axes, world[][wcs.lng] and world[][wcs.lat] are the celestial longitude and latitude [deg]. For spectral axes, imgcrd[][wcs.spec] is the intermediate spectral coordinate, in SI units. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>stat</em>&nbsp;</td><td>Status return value for each coordinate:<ul>
<li>0: Success.</li><li>1+: A bit mask indicating invalid pixel coordinate element(s).</li></ul>
</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>3: Linear transformation matrix is singular.</li><li>4: Inconsistent or unrecognized coordinate axis types.</li><li>5: Invalid parameter value.</li><li>6: Invalid coordinate transformation parameters.</li><li>7: Ill-conditioned coordinate transformation parameters.</li><li>8: One or more of the pixel coordinates were invalid, as indicated by the stat vector.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>

</div>
</div><p>
<a class="anchor" name="60673d05a3513659ac848a9cb3d0cb07"></a><!-- doxytag: member="wcs.h::wcss2p" ref="60673d05a3513659ac848a9cb3d0cb07" args="(struct wcsprm *wcs, int ncoord, int nelem, const double world[], double phi[], double theta[], double imgcrd[], double pixcrd[], int stat[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcss2p           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>ncoord</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nelem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&nbsp;</td>
          <td class="paramname"> <em>world</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>phi</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>theta</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>imgcrd</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>pixcrd</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>stat</em>[]</td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcss2p</b>() transforms world coordinates to pixel coordinates.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters.</td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>ncoord,nelem</em>&nbsp;</td><td>The number of coordinates, each of vector length nelem but containing wcs.naxis coordinate elements. Thus nelem must equal or exceed the value of the <code><b>NAXIS</b></code> keyword unless ncoord == 1, in which case nelem is not used. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>world</em>&nbsp;</td><td>Array of world coordinates. For celestial axes, world[][wcs.lng] and world[][wcs.lat] are the celestial longitude and latitude [deg]. For spectral axes, world[][wcs.spec] is the spectral coordinate, in SI units.</td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>phi,theta</em>&nbsp;</td><td>Longitude and latitude in the native coordinate system of the projection [deg]. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>imgcrd</em>&nbsp;</td><td>Array of intermediate world coordinates. For celestial axes, imgcrd[][wcs.lng] and imgcrd[][wcs.lat] are the projected <img class="formulaInl" alt="$x$" src="form_30.png">-, and <img class="formulaInl" alt="$y$" src="form_31.png">-coordinates in pseudo "degrees". For quadcube projections with a <code><b>CUBEFACE</b></code> axis the face number is also returned in imgcrd[][wcs.cubeface]. For spectral axes, imgcrd[][wcs.spec] is the intermediate spectral coordinate, in SI units. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>pixcrd</em>&nbsp;</td><td>Array of pixel coordinates. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>stat</em>&nbsp;</td><td>Status return value for each coordinate:<ul>
<li>0: Success.</li><li>1+: A bit mask indicating invalid world coordinate element(s).</li></ul>
</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>3: Linear transformation matrix is singular.</li><li>4: Inconsistent or unrecognized coordinate axis types.</li><li>5: Invalid parameter value.</li><li>6: Invalid coordinate transformation parameters.</li><li>7: Ill-conditioned coordinate transformation parameters.</li><li>9: One or more of the world coordinates were invalid, as indicated by the stat vector.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>

</div>
</div><p>
<a class="anchor" name="f3f00b876c8212d43f32a51feeadaa81"></a><!-- doxytag: member="wcs.h::wcsmix" ref="f3f00b876c8212d43f32a51feeadaa81" args="(struct wcsprm *wcs, int mixpix, int mixcel, const double vspan[], double vstep, int viter, double world[], double phi[], double theta[], double imgcrd[], double pixcrd[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcsmix           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mixpix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mixcel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&nbsp;</td>
          <td class="paramname"> <em>vspan</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>vstep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>viter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>world</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>phi</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>theta</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>imgcrd</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>pixcrd</em>[]</td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcsmix</b>(), given either the celestial longitude or latitude plus an element of the pixel coordinate, solves for the remaining elements by iterating on the unknown celestial coordinate element using <a class="el" href="wcs_8h.html#60673d05a3513659ac848a9cb3d0cb07" title="World-to-pixel transformation.">wcss2p()</a>. Refer also to the notes below.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Indices for the celestial coordinates obtained by parsing the <a class="el" href="structwcsprm.html#e1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[].</td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mixpix</em>&nbsp;</td><td>Which element of the pixel coordinate is given. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mixcel</em>&nbsp;</td><td>Which element of the celestial coordinate is given:<ul>
<li>1: Celestial longitude is given in world[wcs.lng], latitude returned in world[wcs.lat].</li><li>2: Celestial latitude is given in world[wcs.lat], longitude returned in world[wcs.lng]. </li></ul>
</td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>vspan</em>&nbsp;</td><td>Solution interval for the celestial coordinate [deg]. The ordering of the two limits is irrelevant. Longitude ranges may be specified with any convenient normalization, for example [-120,+120] is the same as [240,480], except that the solution will be returned with the same normalization, i.e. lie within the interval specified. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>vstep</em>&nbsp;</td><td>Step size for solution search [deg]. If zero, a sensible, although perhaps non-optimal default will be used. </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>viter</em>&nbsp;</td><td>If a solution is not found then the step size will be halved and the search recommenced. viter controls how many times the step size is halved. The allowed range is 5 - 10.</td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>world</em>&nbsp;</td><td>World coordinate elements. world[wcs.lng] and world[wcs.lat] are the celestial longitude and latitude [deg]. Which is given and which returned depends on the value of mixcel. All other elements are given.</td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>phi,theta</em>&nbsp;</td><td>Longitude and latitude in the native coordinate system of the projection [deg]. </td></tr>
    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>imgcrd</em>&nbsp;</td><td>Image coordinate elements. imgcrd[wcs.lng] and imgcrd[wcs.lat] are the projected <img class="formulaInl" alt="$x$" src="form_30.png">-, and <img class="formulaInl" alt="$y$" src="form_31.png">-coordinates in pseudo "degrees".</td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>pixcrd</em>&nbsp;</td><td>Pixel coordinate. The element indicated by mixpix is given and the remaining elements are returned.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>3: Linear transformation matrix is singular.</li><li>4: Inconsistent or unrecognized coordinate axis types.</li><li>5: Invalid parameter value.</li><li>6: Invalid coordinate transformation parameters.</li><li>7: Ill-conditioned coordinate transformation parameters.</li><li>10: Invalid world coordinate.</li><li>11: No solution found in the specified interval.</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>.</dd></dl>
<b>Notes:</b> <br>
 Initially the specified solution interval is checked to see if it's a "crossing" interval. If it isn't, a search is made for a crossing solution by iterating on the unknown celestial coordinate starting at the upper limit of the solution interval and decrementing by the specified step size. A crossing is indicated if the trial value of the pixel coordinate steps through the value specified. If a crossing interval is found then the solution is determined by a modified form of "regula falsi" division of the crossing interval. If no crossing interval was found within the specified solution interval then a search is made for a "non-crossing" solution as may arise from a point of tangency. The process is complicated by having to make allowance for the discontinuities that occur in all map projections.<p>
Once one solution has been determined others may be found by subsequent invokations of <b>wcsmix</b>() with suitably restricted solution intervals.<p>
Note the circumstance that arises when the solution point lies at a native pole of a projection in which the pole is represented as a finite curve, for example the zenithals and conics. In such cases two or more valid solutions may exist but <b>wcsmix</b>() only ever returns one.<p>
Because of its generality <b>wcsmix</b>() is very compute-intensive. For compute-limited applications more efficient special-case solvers could be written for simple projections, for example non-oblique cylindrical projections. 
</div>
</div><p>
<a class="anchor" name="57975833fe0588eb7c7b6d79f13a7693"></a><!-- doxytag: member="wcs.h::wcssptr" ref="57975833fe0588eb7c7b6d79f13a7693" args="(struct wcsprm *wcs, int *i, char ctype[9])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wcssptr           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> *&nbsp;</td>
          <td class="paramname"> <em>wcs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>ctype</em>[9]</td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>wcssptr</b>() translates the spectral axis in a <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct. For example, a '<code><b>FREQ</b></code>' axis may be translated into <code><b>'ZOPT-F2W'</b></code> and vice versa.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>wcs</em>&nbsp;</td><td>Coordinate transformation parameters. </td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>i</em>&nbsp;</td><td>Index of the spectral axis (0-relative). If given &lt; 0 it will be set to the first spectral axis identified from the ctype[] keyvalues in the <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> struct. </td></tr>
    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>ctype</em>&nbsp;</td><td>Desired spectral <code><b>CTYPE</b>ia</code>. Wildcarding may be used as for the ctypeS2 argument to <a class="el" href="spc_8h.html#96e8686daa13255e36506c3bfc213e46">spctrn()</a> as described in the prologue of <a class="el" href="spc_8h.html">spc.h</a>, i.e. if the final three characters are specified as "???", or if just the eighth character is specified as '?', the correct algorithm code will be substituted and returned.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>1: Null <a class="el" href="structwcsprm.html" title="Coordinate transformation parameters.">wcsprm</a> pointer passed.</li><li>2: Memory allocation failed.</li><li>3: Linear transformation matrix is singular.</li><li>4: Inconsistent or unrecognized coordinate axis types.</li><li>5: Invalid parameter value.</li><li>6: Invalid coordinate transformation parameters.</li><li>7: Ill-conditioned coordinate transformation parameters.</li><li>12: Invalid subimage specification (no spectral axis).</li></ul>
For returns &gt; 1, a detailed error message is set in <a class="el" href="structwcsprm.html#f54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>

</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="d16bd8db875ee05b014429efdc1f3471"></a><!-- doxytag: member="wcs.h::wcs_errmsg" ref="d16bd8db875ee05b014429efdc1f3471" args="[]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * <a class="el" href="wcs_8h.html#d16bd8db875ee05b014429efdc1f3471">wcs_errmsg</a>[]          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Error messages to match the status value returned from each function. 
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Oct 4 19:02:30 2011 for WCSLIB 4.8.2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>