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 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
|
<!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: spc.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 Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>spc.h File Reference</h1><code>#include "<a class="el" href="spx_8h-source.html">spx.h</a>"</code><br>
<code>#include "<a class="el" href="wcserr_8h-source.html">wcserr.h</a>"</code><br>
<p>
<a href="spc_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 </td><td class="memItemRight" valign="bottom"><a class="el" href="structspcprm.html">spcprm</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spectral transformation parameters. <a href="structspcprm.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 </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#4e195ae6c61da3608692a3c7f2395599">SPCLEN</a> (sizeof(struct <a class="el" href="structspcprm.html">spcprm</a>)/sizeof(int))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Size of the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct in <em>int</em> units. <a href="#4e195ae6c61da3608692a3c7f2395599"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#4d66edc63bfc8a39adc6bac9e88c8e81">spcini_errmsg</a> <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <a href="#4d66edc63bfc8a39adc6bac9e88c8e81"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#c39694faccdd56850677999d714cd14a">spcprt_errmsg</a> <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <a href="#c39694faccdd56850677999d714cd14a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#49807752ce4e223d4095cf6ad13bac0a">spcset_errmsg</a> <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <a href="#49807752ce4e223d4095cf6ad13bac0a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#ab517aed3ee9f8d5a5ca1f990d310b61">spcx2s_errmsg</a> <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <a href="#ab517aed3ee9f8d5a5ca1f990d310b61"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#f0e4274b242fd41625b6ad4f4376b8da">spcs2x_errmsg</a> <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <a href="#f0e4274b242fd41625b6ad4f4376b8da"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b">spc_errmsg_enum</a> { <br>
<a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b0b84f38d1e903eacda3122ce55bff741">SPCERR_SUCCESS</a> = 0,
<a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b7c5e0d09fac9f441e39f3cf28801961f">SPCERR_NULL_POINTER</a> = 1,
<a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b0653e60411a641a326492c65d257daa8">SPCERR_BAD_SPEC_PARAMS</a> = 2,
<a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b3ba9183c7c3dace15eef0606980fd615">SPCERR_BAD_X</a> = 3,
<br>
<a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b7e218c5bd52bd6a45d8ad66573653007">SPCERR_BAD_SPEC</a> = 4
<br>
}</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#30c95d776068ef3cc959a50af9995fa9">spcini</a> (struct <a class="el" href="structspcprm.html">spcprm</a> *spc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor for the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct. <a href="#30c95d776068ef3cc959a50af9995fa9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#2e04fc3ccd8aceebb4bfef56c5399a7d">spcfree</a> (struct <a class="el" href="structspcprm.html">spcprm</a> *spc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor for the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct. <a href="#2e04fc3ccd8aceebb4bfef56c5399a7d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#7304d0d00bcf9d2bad1f56ba6d8322ea">spcprt</a> (const struct <a class="el" href="structspcprm.html">spcprm</a> *spc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print routine for the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct. <a href="#7304d0d00bcf9d2bad1f56ba6d8322ea"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#f2ee6399a65f2467841be79e4bbb41c3">spcset</a> (struct <a class="el" href="structspcprm.html">spcprm</a> *spc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup routine for the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct. <a href="#f2ee6399a65f2467841be79e4bbb41c3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#e7fe86ae85a1a3bd19c2d78c3dba58f6">spcx2s</a> (struct <a class="el" href="structspcprm.html">spcprm</a> *spc, int nx, int sx, int sspec, const double x[], double spec[], int stat[])</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Transform to spectral coordinates. <a href="#e7fe86ae85a1a3bd19c2d78c3dba58f6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#e6e89217a5eca87a2101ae195da74347">spcs2x</a> (struct <a class="el" href="structspcprm.html">spcprm</a> *spc, int nspec, int sspec, int sx, const double spec[], double x[], int stat[])</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Transform spectral coordinates. <a href="#e6e89217a5eca87a2101ae195da74347"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#eb46b7cc0b8e5a01be7862b3c446204a">spctype</a> (const char ctype[], char stype[], char scode[], char sname[], char units[], char *ptype, char *xtype, int *restreq, struct <a class="el" href="structwcserr.html">wcserr</a> **err)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spectral <code><b>CTYPE</b>ia</code> keyword analysis. <a href="#eb46b7cc0b8e5a01be7862b3c446204a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#300fdb21c6e53aca6749db3455e531b2">spcspxe</a> (const char ctypeS[], double crvalS, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalX, double *dXdS, struct <a class="el" href="structwcserr.html">wcserr</a> **err)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spectral keyword analysis. <a href="#300fdb21c6e53aca6749db3455e531b2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#99689938e16d737f26bf6504f2e1599a">spcxpse</a> (const char ctypeS[], double crvalX, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalS, double *dSdX, struct <a class="el" href="structwcserr.html">wcserr</a> **err)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spectral keyword synthesis. <a href="#99689938e16d737f26bf6504f2e1599a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#cc0b7b9e5bc5495f24129492e4ff5218">spctrne</a> (const char ctypeS1[], double crvalS1, double cdeltS1, double restfrq, double restwav, char ctypeS2[], double *crvalS2, double *cdeltS2, struct <a class="el" href="structwcserr.html">wcserr</a> **err)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spectral keyword translation. <a href="#cc0b7b9e5bc5495f24129492e4ff5218"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#615d3ef3a505a8be7da1578d9338d218">spcaips</a> (const char ctypeA[], int velref, char ctype[], char specsys[])</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Translate AIPS-convention spectral keywords. <a href="#615d3ef3a505a8be7da1578d9338d218"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#6f88e6f1a549bffa0d0ab2b9523d2000">spctyp</a> (const char ctype[], char stype[], char scode[], char sname[], char units[], char *ptype, char *xtype, int *restreq)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#b9fc42d8e1d281839a0a42ac00bcd180">spcspx</a> (const char ctypeS[], double crvalS, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalX, double *dXdS)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#49f16254df0e3498ae2c1eb641f5232c">spcxps</a> (const char ctypeS[], double crvalX, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalS, double *dSdX)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#96e8686daa13255e36506c3bfc213e46">spctrn</a> (const char ctypeS1[], double crvalS1, double cdeltS1, double restfrq, double restwav, char ctypeS2[], double *crvalS2, double *cdeltS2)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> []</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Status return messages. <a href="#96978fec523018fd6898301a3452c166"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
These routines implement the part of the FITS WCS standard that deals with spectral coordinates. They define methods to be used for computing spectral world coordinates from intermediate world coordinates (a linear transformation of image pixel coordinates), and vice versa. They are based on the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</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>
Routine <a class="el" href="spc_8h.html#30c95d776068ef3cc959a50af9995fa9" title="Default constructor for the spcprm struct.">spcini()</a> is provided to initialize the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct with default values, <a class="el" href="spc_8h.html#2e04fc3ccd8aceebb4bfef56c5399a7d" title="Destructor for the spcprm struct.">spcfree()</a> reclaims any memory that may have been allocated to store an error message, and <a class="el" href="spc_8h.html#7304d0d00bcf9d2bad1f56ba6d8322ea" title="Print routine for the spcprm struct.">spcprt()</a> prints its contents.<p>
A setup routine, <a class="el" href="spc_8h.html#f2ee6399a65f2467841be79e4bbb41c3" title="Setup routine for the spcprm struct.">spcset()</a>, computes intermediate values in the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</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="spc_8h.html#f2ee6399a65f2467841be79e4bbb41c3" title="Setup routine for the spcprm struct.">spcset()</a> but it need not be called explicitly - refer to the explanation of <a class="el" href="structspcprm.html#feeb5f4056f271fd37291a712a7b6791">spcprm::flag</a>.<p>
<a class="el" href="spc_8h.html#e7fe86ae85a1a3bd19c2d78c3dba58f6" title="Transform to spectral coordinates.">spcx2s()</a> and <a class="el" href="spc_8h.html#e6e89217a5eca87a2101ae195da74347" title="Transform spectral coordinates.">spcs2x()</a> implement the WCS spectral coordinate transformations. In fact, they are high level driver routines for the lower level spectral coordinate transformation routines described in <a class="el" href="spx_8h.html">spx.h</a>.<p>
A number of routines are provided to aid in analysing or synthesising sets of FITS spectral axis keywords:<p>
<ul>
<li>
<a class="el" href="spc_8h.html#eb46b7cc0b8e5a01be7862b3c446204a" title="Spectral CTYPEia keyword analysis.">spctype()</a> checks a spectral <code><b>CTYPE</b>ia</code> keyword for validity and returns information derived from it.<p>
</li>
<li>
Spectral keyword analysis routine <a class="el" href="spc_8h.html#300fdb21c6e53aca6749db3455e531b2" title="Spectral keyword analysis.">spcspxe()</a> computes the values of the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variables for the <img class="formulaInl" alt="$S$" src="form_32.png">-type variables supplied.<p>
</li>
<li>
Spectral keyword synthesis routine, <a class="el" href="spc_8h.html#99689938e16d737f26bf6504f2e1599a" title="Spectral keyword synthesis.">spcxpse()</a>, computes the <img class="formulaInl" alt="$S$" src="form_32.png">-type variables for the <img class="formulaInl" alt="$X$" src="form_10.png">-types supplied.<p>
</li>
<li>
Given a set of spectral keywords, a translation routine, <a class="el" href="spc_8h.html#cc0b7b9e5bc5495f24129492e4ff5218" title="Spectral keyword translation.">spctrne()</a>, produces the corresponding set for the specified spectral <code><b>CTYPE</b>ia</code>.<p>
</li>
<li>
<a class="el" href="spc_8h.html#615d3ef3a505a8be7da1578d9338d218" title="Translate AIPS-convention spectral keywords.">spcaips()</a> translates AIPS-convention spectral keywords, <code><b>CTYPE</b>n</code> and <code><b>VELREF</b></code>, into <code><b>CTYPE</b>ia</code> and <code><b>SPECSYS</b>a</code>. </li>
</ul>
<p>
<b>Spectral variable types - <img class="formulaInl" alt="$S$" src="form_32.png">, <img class="formulaInl" alt="$P$" src="form_33.png">, and <img class="formulaInl" alt="$X$" src="form_10.png">:</b> <br>
A few words of explanation are necessary regarding spectral variable types in FITS.<p>
Every FITS spectral axis has three associated spectral variables:<p>
<img class="formulaInl" alt="$S$" src="form_32.png">-type: the spectral variable in which coordinates are to be expressed. Each <img class="formulaInl" alt="$S$" src="form_32.png">-type is encoded as four characters and is linearly related to one of four basic types as follows:<p>
F: frequency '<code><b>FREQ</b></code>': frequency '<code><b>AFRQ</b></code>': angular frequency '<code><b>ENER</b></code>': photon energy '<code><b>WAVN</b></code>': wave number '<code><b>VRAD</b></code>': radio velocity<p>
W: wavelength in vacuo '<code><b>WAVE</b></code>': wavelength '<code><b>VOPT</b></code>': optical velocity '<code><b>ZOPT</b></code>': redshift<p>
A: wavelength in air '<code><b>AWAV</b></code>': wavelength in air<p>
V: velocity '<code><b>VELO</b></code>': relativistic velocity '<code><b>BETA</b></code>': relativistic beta factor<p>
The <img class="formulaInl" alt="$S$" src="form_32.png">-type forms the first four characters of the <code><b>CTYPE</b>ia</code> keyvalue, and <code><b>CRVAL</b>ia</code> and <code><b>CDELT</b>ia</code> are expressed as <img class="formulaInl" alt="$S$" src="form_32.png">-type quantities so that they provide a first-order approximation to the <img class="formulaInl" alt="$S$" src="form_32.png">-type variable at the reference point.<p>
Note that '<code><b>AFRQ</b></code>', angular frequency, is additional to the variables defined in WCS Paper III.<p>
<img class="formulaInl" alt="$P$" src="form_33.png">-type: the basic spectral variable (F, W, A, or V) with which the <img class="formulaInl" alt="$S$" src="form_32.png">-type variable is associated (see list above).<p>
For non-grism axes, the <img class="formulaInl" alt="$P$" src="form_33.png">-type is encoded as the eighth character of <code><b>CTYPE</b>ia</code>.<p>
<img class="formulaInl" alt="$X$" src="form_10.png">-type: the basic spectral variable (F, W, A, or V) for which the spectral axis is linear, grisms excluded (see below).<p>
For non-grism axes, the <img class="formulaInl" alt="$X$" src="form_10.png">-type is encoded as the sixth character of <code><b>CTYPE</b>ia</code>.<p>
Grisms: Grism axes have normal <img class="formulaInl" alt="$S$" src="form_32.png">-, and <img class="formulaInl" alt="$P$" src="form_33.png">-types but the axis is linear, not in any spectral variable, but in a special "grism parameter". The <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable is either W or A for grisms in vacuo or air respectively, but is encoded as 'w' or 'a' to indicate that an additional transformation is required to convert to or from the grism parameter. The spectral algorithm code for grisms also has a special encoding in <code><b>CTYPE</b>ia</code>, either '<code><b>GRI</b></code>' (in vacuo) or '<code><b>GRA</b></code>' (in air).<p>
In the algorithm chain, the non-linear transformation occurs between the <img class="formulaInl" alt="$X$" src="form_10.png">-type and the <img class="formulaInl" alt="$P$" src="form_33.png">-type variables; the transformation between <img class="formulaInl" alt="$P$" src="form_33.png">-type and <img class="formulaInl" alt="$S$" src="form_32.png">-type variables is always linear.<p>
When the <img class="formulaInl" alt="$P$" src="form_33.png">-type and <img class="formulaInl" alt="$X$" src="form_10.png">-type variables are the same, the spectral axis is linear in the <img class="formulaInl" alt="$S$" src="form_32.png">-type variable and the second four characters of <code><b>CTYPE</b>ia</code> are blank. This can never happen for grism axes.<p>
As an example, correlating radio spectrometers always produce spectra that are regularly gridded in frequency; a redshift scale on such a spectrum is non-linear. The required value of <code><b>CTYPE</b>ia</code> would be <code><b>'ZOPT-F2W'</b></code>, where the desired <img class="formulaInl" alt="$S$" src="form_32.png">-type is '<code><b>ZOPT</b></code>' (redshift), the <img class="formulaInl" alt="$P$" src="form_33.png">-type is necessarily 'W' (wavelength), and the <img class="formulaInl" alt="$X$" src="form_10.png">-type is 'F' (frequency) by the nature of the instrument.<p>
<b>Argument checking:</b> <br>
The input spectral values are only checked for values that would result in floating point exceptions. In particular, negative frequencies and wavelengths are allowed, as are velocities greater than the speed of light. The same is true for the spectral parameters - rest frequency and wavelength.<p>
<b>Accuracy:</b> <br>
No warranty is given for the accuracy of these routines (refer to the copyright notice); intending users must satisfy for themselves their adequacy for the intended purpose. However, closure effectively to within double precision rounding error was demonstrated by test routine tspc.c which accompanies this software. <hr><h2>Define Documentation</h2>
<a class="anchor" name="4e195ae6c61da3608692a3c7f2395599"></a><!-- doxytag: member="spc.h::SPCLEN" ref="4e195ae6c61da3608692a3c7f2395599" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SPCLEN (sizeof(struct <a class="el" href="structspcprm.html">spcprm</a>)/sizeof(int)) </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Size of the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct in <em>int</em> units, used by the Fortran wrappers.
</div>
</div><p>
<a class="anchor" name="4d66edc63bfc8a39adc6bac9e88c8e81"></a><!-- doxytag: member="spc.h::spcini_errmsg" ref="4d66edc63bfc8a39adc6bac9e88c8e81" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define spcini_errmsg <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000019">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166" title="Status return messages.">spc_errmsg</a> directly now instead. </dd></dl>
</div>
</div><p>
<a class="anchor" name="c39694faccdd56850677999d714cd14a"></a><!-- doxytag: member="spc.h::spcprt_errmsg" ref="c39694faccdd56850677999d714cd14a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define spcprt_errmsg <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000020">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166" title="Status return messages.">spc_errmsg</a> directly now instead. </dd></dl>
</div>
</div><p>
<a class="anchor" name="49807752ce4e223d4095cf6ad13bac0a"></a><!-- doxytag: member="spc.h::spcset_errmsg" ref="49807752ce4e223d4095cf6ad13bac0a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define spcset_errmsg <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000021">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166" title="Status return messages.">spc_errmsg</a> directly now instead. </dd></dl>
</div>
</div><p>
<a class="anchor" name="ab517aed3ee9f8d5a5ca1f990d310b61"></a><!-- doxytag: member="spc.h::spcx2s_errmsg" ref="ab517aed3ee9f8d5a5ca1f990d310b61" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define spcx2s_errmsg <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000022">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166" title="Status return messages.">spc_errmsg</a> directly now instead. </dd></dl>
</div>
</div><p>
<a class="anchor" name="f0e4274b242fd41625b6ad4f4376b8da"></a><!-- doxytag: member="spc.h::spcs2x_errmsg" ref="f0e4274b242fd41625b6ad4f4376b8da" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define spcs2x_errmsg <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_errmsg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000023">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166" title="Status return messages.">spc_errmsg</a> directly now instead. </dd></dl>
</div>
</div><p>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="51ba1ce5380fd2e7693c37554d18fc3b"></a><!-- doxytag: member="spc.h::spc_errmsg_enum" ref="51ba1ce5380fd2e7693c37554d18fc3b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="spc_8h.html#51ba1ce5380fd2e7693c37554d18fc3b">spc_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="51ba1ce5380fd2e7693c37554d18fc3b0b84f38d1e903eacda3122ce55bff741"></a><!-- doxytag: member="SPCERR_SUCCESS" ref="51ba1ce5380fd2e7693c37554d18fc3b0b84f38d1e903eacda3122ce55bff741" args="" -->SPCERR_SUCCESS</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="51ba1ce5380fd2e7693c37554d18fc3b7c5e0d09fac9f441e39f3cf28801961f"></a><!-- doxytag: member="SPCERR_NULL_POINTER" ref="51ba1ce5380fd2e7693c37554d18fc3b7c5e0d09fac9f441e39f3cf28801961f" args="" -->SPCERR_NULL_POINTER</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="51ba1ce5380fd2e7693c37554d18fc3b0653e60411a641a326492c65d257daa8"></a><!-- doxytag: member="SPCERR_BAD_SPEC_PARAMS" ref="51ba1ce5380fd2e7693c37554d18fc3b0653e60411a641a326492c65d257daa8" args="" -->SPCERR_BAD_SPEC_PARAMS</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="51ba1ce5380fd2e7693c37554d18fc3b3ba9183c7c3dace15eef0606980fd615"></a><!-- doxytag: member="SPCERR_BAD_X" ref="51ba1ce5380fd2e7693c37554d18fc3b3ba9183c7c3dace15eef0606980fd615" args="" -->SPCERR_BAD_X</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="51ba1ce5380fd2e7693c37554d18fc3b7e218c5bd52bd6a45d8ad66573653007"></a><!-- doxytag: member="SPCERR_BAD_SPEC" ref="51ba1ce5380fd2e7693c37554d18fc3b7e218c5bd52bd6a45d8ad66573653007" args="" -->SPCERR_BAD_SPEC</em> </td><td>
</td></tr>
</table>
</dl>
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="30c95d776068ef3cc959a50af9995fa9"></a><!-- doxytag: member="spc.h::spcini" ref="30c95d776068ef3cc959a50af9995fa9" args="(struct spcprm *spc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcini </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcini</b>() sets all members of a <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct to default values. It should be used to initialize every <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>spc</em> </td><td>Spectral 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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="2e04fc3ccd8aceebb4bfef56c5399a7d"></a><!-- doxytag: member="spc.h::spcfree" ref="2e04fc3ccd8aceebb4bfef56c5399a7d" args="(struct spcprm *spc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcfree </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcfree</b>() frees any memory that may have been allocated to store an error message in the <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>spc</em> </td><td>Spectral 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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="7304d0d00bcf9d2bad1f56ba6d8322ea"></a><!-- doxytag: member="spc.h::spcprt" ref="7304d0d00bcf9d2bad1f56ba6d8322ea" args="(const struct spcprm *spc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcprt </td>
<td>(</td>
<td class="paramtype">const struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcprt</b>() prints the contents of a <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</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> </td><td valign="top"><em>spc</em> </td><td>Spectral 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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="f2ee6399a65f2467841be79e4bbb41c3"></a><!-- doxytag: member="spc.h::spcset" ref="f2ee6399a65f2467841be79e4bbb41c3" args="(struct spcprm *spc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcset </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcset</b>() sets up a <a class="el" href="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> struct according to information supplied within it.<p>
Note that this routine need not be called directly; it will be invoked by <a class="el" href="spc_8h.html#e7fe86ae85a1a3bd19c2d78c3dba58f6" title="Transform to spectral coordinates.">spcx2s()</a> and <a class="el" href="spc_8h.html#e6e89217a5eca87a2101ae195da74347" title="Transform spectral coordinates.">spcs2x()</a> if <a class="el" href="structspcprm.html#feeb5f4056f271fd37291a712a7b6791">spcprm::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> </td><td valign="top"><em>spc</em> </td><td>Spectral 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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed.</li><li>2: Invalid spectral parameters.</li></ul>
For returns > 1, a detailed error message is set in <a class="el" href="structspcprm.html#6d4124d4db8f7addcbfee99a8634522e">spcprm::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="e7fe86ae85a1a3bd19c2d78c3dba58f6"></a><!-- doxytag: member="spc.h::spcx2s" ref="e7fe86ae85a1a3bd19c2d78c3dba58f6" args="(struct spcprm *spc, int nx, int sx, int sspec, const double x[], double spec[], int stat[])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcx2s </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>nx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sspec</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const double </td>
<td class="paramname"> <em>x</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>spec</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>stat</em>[]</td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcx2s</b>() transforms intermediate world coordinates to spectral 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> </td><td valign="top"><em>spc</em> </td><td>Spectral transformation parameters.</td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>nx</em> </td><td>Vector length. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>sx</em> </td><td>Vector stride. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>sspec</em> </td><td>Vector stride. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>x</em> </td><td>Intermediate world coordinates, in SI units.</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>spec</em> </td><td>Spectral coordinates, in SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>stat</em> </td><td>Status return value status for each vector element:<ul>
<li>0: Success.</li><li>1: Invalid value of x.</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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed.</li><li>2: Invalid spectral parameters.</li><li>3: One or more of the x coordinates were invalid, as indicated by the stat vector.</li></ul>
For returns > 1, a detailed error message is set in <a class="el" href="structspcprm.html#6d4124d4db8f7addcbfee99a8634522e">spcprm::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="e6e89217a5eca87a2101ae195da74347"></a><!-- doxytag: member="spc.h::spcs2x" ref="e6e89217a5eca87a2101ae195da74347" args="(struct spcprm *spc, int nspec, int sspec, int sx, const double spec[], double x[], int stat[])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcs2x </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structspcprm.html">spcprm</a> * </td>
<td class="paramname"> <em>spc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>nspec</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sspec</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>sx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const double </td>
<td class="paramname"> <em>spec</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>x</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>stat</em>[]</td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcs2x</b>() transforms spectral world coordinates to intermediate 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> </td><td valign="top"><em>spc</em> </td><td>Spectral transformation parameters.</td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>nspec</em> </td><td>Vector length. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>sspec</em> </td><td>Vector stride. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>sx</em> </td><td>Vector stride. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>spec</em> </td><td>Spectral coordinates, in SI units.</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>x</em> </td><td>Intermediate world coordinates, in SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>stat</em> </td><td>Status return value status for each vector element:<ul>
<li>0: Success.</li><li>1: Invalid value of spec.</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="structspcprm.html" title="Spectral transformation parameters.">spcprm</a> pointer passed.</li><li>2: Invalid spectral parameters.</li><li>4: One or more of the spec coordinates were invalid, as indicated by the stat vector.</li></ul>
For returns > 1, a detailed error message is set in <a class="el" href="structspcprm.html#6d4124d4db8f7addcbfee99a8634522e">spcprm::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="eb46b7cc0b8e5a01be7862b3c446204a"></a><!-- doxytag: member="spc.h::spctype" ref="eb46b7cc0b8e5a01be7862b3c446204a" args="(const char ctype[], char stype[], char scode[], char sname[], char units[], char *ptype, char *xtype, int *restreq, struct wcserr **err)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spctype </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctype</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>stype</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>scode</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>sname</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>units</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcserr.html">wcserr</a> ** </td>
<td class="paramname"> <em>err</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spctype</b>() checks whether a <code><b>CTYPE</b>ia</code> keyvalue is a valid spectral axis type and if so returns information derived from it relating to the associated <img class="formulaInl" alt="$S$" src="form_32.png">-, <img class="formulaInl" alt="$P$" src="form_33.png">-, and <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variables (see explanation above).<p>
The return arguments are guaranteed not be modified if <code><b>CTYPE</b>ia</code> is not a valid spectral type; zero-pointers may be specified for any that are not of interest.<p>
A deprecated form of this function, <a class="el" href="spc_8h.html#6f88e6f1a549bffa0d0ab2b9523d2000">spctyp()</a>, lacks the wcserr** parameter.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>ctype</em> </td><td>The <code><b>CTYPE</b>ia</code> keyvalue, (eight characters with null termination).</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>stype</em> </td><td>The four-letter name of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable copied or translated from ctype. If a non-zero pointer is given, the array must accomodate a null- terminated string of length 5. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>scode</em> </td><td>The three-letter spectral algorithm code copied or translated from ctype. Logarithmic ('<code><b>LOG</b></code>') and tabular ('<code><b>TAB</b></code>') codes are also recognized. If a non-zero pointer is given, the array must accomodate a null-terminated string of length 4. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>sname</em> </td><td>Descriptive name of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable. If a non-zero pointer is given, the array must accomodate a null-terminated string of length 22. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>units</em> </td><td>SI units of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable. If a non-zero pointer is given, the array must accomodate a null-terminated string of length 8. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>ptype</em> </td><td>Character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable derived from ctype, one of 'F', 'W', 'A', or 'V'. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>xtype</em> </td><td>Character code for the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable derived from ctype, one of 'F', 'W', 'A', or 'V'. Also, 'w' and 'a' are synonymous to 'W' and 'A' for grisms in vacuo and air respectively. Set to 'L' or 'T' for logarithmic ('<code><b>LOG</b></code>') and tabular ('<code><b>TAB</b></code>') axes. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>restreq</em> </td><td>Multivalued flag that indicates whether rest frequency or wavelength is required to compute spectral variables for this <code><b>CTYPE</b>ia</code>:<ul>
<li>0: Not required.</li><li>1: Required for the conversion between <img class="formulaInl" alt="$S$" src="form_32.png">- and <img class="formulaInl" alt="$P$" src="form_33.png">-types (e.g. <code><b>'ZOPT-F2W'</b></code>).</li><li>2: Required for the conversion between <img class="formulaInl" alt="$P$" src="form_33.png">- and <img class="formulaInl" alt="$X$" src="form_10.png">-types (e.g. <code><b>'BETA-W2V'</b></code>).</li><li>3: Required for the conversion between <img class="formulaInl" alt="$S$" src="form_32.png">- and <img class="formulaInl" alt="$P$" src="form_33.png">-types, and between <img class="formulaInl" alt="$P$" src="form_33.png">- and <img class="formulaInl" alt="$X$" src="form_10.png">-types, but not between <img class="formulaInl" alt="$S$" src="form_32.png">- and <img class="formulaInl" alt="$X$" src="form_10.png">-types (this applies only for <code><b>'VRAD-V2F'</b></code>, <code><b>'VOPT-V2W'</b></code>, and <code><b>'ZOPT-V2W'</b></code>).</li></ul>
Thus the rest frequency or wavelength is required for spectral coordinate computations (i.e. between <img class="formulaInl" alt="$S$" src="form_32.png">- and <img class="formulaInl" alt="$X$" src="form_10.png">-types) only if <div class="fragment"><pre class="fragment"> restreq%3 != 0
</pre></div>. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>err</em> </td><td>For function return values > 1, this struct will contain a detailed error message. May be NULL if an error message is not desired.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>2: Invalid spectral parameters (not a spectral <code><b>CTYPE</b>ia</code>). </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="300fdb21c6e53aca6749db3455e531b2"></a><!-- doxytag: member="spc.h::spcspxe" ref="300fdb21c6e53aca6749db3455e531b2" args="(const char ctypeS[], double crvalS, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalX, double *dXdS, struct wcserr **err)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcspxe </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalS</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>dXdS</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcserr.html">wcserr</a> ** </td>
<td class="paramname"> <em>err</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcspxe</b>() analyses the <code><b>CTYPE</b>ia</code> and <code><b>CRVAL</b>ia</code> FITS spectral axis keyword values and returns information about the associated <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable.<p>
A deprecated form of this function, <a class="el" href="spc_8h.html#b9fc42d8e1d281839a0a42ac00bcd180">spcspx()</a>, lacks the wcserr** parameter.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>ctypeS</em> </td><td>Spectral axis type, i.e. the <code><b>CTYPE</b>ia</code> keyvalue, (eight characters with null termination). For non-grism axes, the character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable in the algorithm code (i.e. the eighth character of <code><b>CTYPE</b>ia</code>) may be set to '?' (it will not be reset). </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>crvalS</em> </td><td>Value of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point, i.e. the <code><b>CRVAL</b>ia</code> keyvalue, SI units. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>restfrq,restwav</em> </td><td>Rest frequency [Hz] and rest wavelength in vacuo [m], only one of which need be given, the other should be set to zero. Neither are required if the translation is between wave-characteristic types, or between velocity-characteristic types. E.g., required for '<code><b>FREQ</b></code>' -> <code><b>'ZOPT-F2W'</b></code>, but not required for <code><b>'VELO-F2V'</b></code> -> <code><b>'ZOPT-F2W'</b></code>.</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>ptype</em> </td><td>Character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable derived from ctypeS, one of 'F', 'W', 'A', or 'V'. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>xtype</em> </td><td>Character code for the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable derived from ctypeS, one of 'F', 'W', 'A', or 'V'. Also, 'w' and 'a' are synonymous to 'W' and 'A' for grisms in vacuo and air respectively; crvalX and dXdS (see below) will conform to these. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>restreq</em> </td><td>Multivalued flag that indicates whether rest frequency or wavelength is required to compute spectral variables for this <code><b>CTYPE</b>ia</code>, as for <a class="el" href="spc_8h.html#eb46b7cc0b8e5a01be7862b3c446204a" title="Spectral CTYPEia keyword analysis.">spctype()</a>. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>crvalX</em> </td><td>Value of the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable at the reference point, SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>dXdS</em> </td><td>The derivative, <img class="formulaInl" alt="$dX/dS$" src="form_34.png">, evaluated at the reference point, SI units. Multiply the <code><b>CDELT</b>ia</code> keyvalue by this to get the pixel spacing in the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral coordinate. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>err</em> </td><td>For function return values > 1, this struct will contain a detailed error message. May be NULL if an error message is not desired.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>2: Invalid spectral parameters. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="99689938e16d737f26bf6504f2e1599a"></a><!-- doxytag: member="spc.h::spcxpse" ref="99689938e16d737f26bf6504f2e1599a" args="(const char ctypeS[], double crvalX, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalS, double *dSdX, struct wcserr **err)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcxpse </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalS</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>dSdX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcserr.html">wcserr</a> ** </td>
<td class="paramname"> <em>err</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcxpse</b>(), for the spectral axis type specified and the value provided for the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable at the reference point, deduces the value of the FITS spectral axis keyword <code><b>CRVAL</b>ia</code> and also the derivative <img class="formulaInl" alt="$dS/dX$" src="form_35.png"> which may be used to compute <code><b>CDELT</b>ia</code>. See above for an explanation of the <img class="formulaInl" alt="$S$" src="form_32.png">-, <img class="formulaInl" alt="$P$" src="form_33.png">-, and <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variables.<p>
A deprecated form of this function, <a class="el" href="spc_8h.html#49f16254df0e3498ae2c1eb641f5232c">spcxps()</a>, lacks the wcserr** parameter.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>ctypeS</em> </td><td>The required spectral axis type, i.e. the <code><b>CTYPE</b>ia</code> keyvalue, (eight characters with null termination). For non-grism axes, the character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable in the algorithm code (i.e. the eighth character of <code><b>CTYPE</b>ia</code>) may be set to '?' (it will not be reset). </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>crvalX</em> </td><td>Value of the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable at the reference point (N.B. NOT the <code><b>CRVAL</b>ia</code> keyvalue), SI units. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>restfrq,restwav</em> </td><td>Rest frequency [Hz] and rest wavelength in vacuo [m], only one of which need be given, the other should be set to zero. Neither are required if the translation is between wave-characteristic types, or between velocity-characteristic types. E.g., required for '<code><b>FREQ</b></code>' -> <code><b>'ZOPT-F2W'</b></code>, but not required for <code><b>'VELO-F2V'</b></code> -> <code><b>'ZOPT-F2W'</b></code>.</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>ptype</em> </td><td>Character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable derived from ctypeS, one of 'F', 'W', 'A', or 'V'. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>xtype</em> </td><td>Character code for the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral variable derived from ctypeS, one of 'F', 'W', 'A', or 'V'. Also, 'w' and 'a' are synonymous to 'W' and 'A' for grisms; crvalX and cdeltX must conform to these. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>restreq</em> </td><td>Multivalued flag that indicates whether rest frequency or wavelength is required to compute spectral variables for this <code><b>CTYPE</b>ia</code>, as for <a class="el" href="spc_8h.html#eb46b7cc0b8e5a01be7862b3c446204a" title="Spectral CTYPEia keyword analysis.">spctype()</a>. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>crvalS</em> </td><td>Value of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point (i.e. the appropriate <code><b>CRVAL</b>ia</code> keyvalue), SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>dSdX</em> </td><td>The derivative, <img class="formulaInl" alt="$dS/dX$" src="form_35.png">, evaluated at the reference point, SI units. Multiply this by the pixel spacing in the <img class="formulaInl" alt="$X$" src="form_10.png">-type spectral coordinate to get the <code><b>CDELT</b>ia</code> keyvalue. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>err</em> </td><td>For function return values > 1, this struct will contain a detailed error message. May be NULL if an error message is not desired.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>2: Invalid spectral parameters. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="cc0b7b9e5bc5495f24129492e4ff5218"></a><!-- doxytag: member="spc.h::spctrne" ref="cc0b7b9e5bc5495f24129492e4ff5218" args="(const char ctypeS1[], double crvalS1, double cdeltS1, double restfrq, double restwav, char ctypeS2[], double *crvalS2, double *cdeltS2, struct wcserr **err)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spctrne </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS1</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalS1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>cdeltS1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>ctypeS2</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalS2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>cdeltS2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcserr.html">wcserr</a> ** </td>
<td class="paramname"> <em>err</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spctrne</b>() translates a set of FITS spectral axis keywords into the corresponding set for the specified spectral axis type. For example, a '<code><b>FREQ</b></code>' axis may be translated into <code><b>'ZOPT-F2W'</b></code> and vice versa.<p>
A deprecated form of this function, <a class="el" href="spc_8h.html#96e8686daa13255e36506c3bfc213e46">spctrn()</a>, lacks the wcserr** parameter.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>ctypeS1</em> </td><td>Spectral axis type, i.e. the <code><b>CTYPE</b>ia</code> keyvalue, (eight characters with null termination). For non-grism axes, the character code for the <img class="formulaInl" alt="$P$" src="form_33.png">-type spectral variable in the algorithm code (i.e. the eighth character of <code><b>CTYPE</b>ia</code>) may be set to '?' (it will not be reset). </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>crvalS1</em> </td><td>Value of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point, i.e. the <code><b>CRVAL</b>ia</code> keyvalue, SI units. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>cdeltS1</em> </td><td>Increment of the <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point, SI units. </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>restfrq,restwav</em> </td><td>Rest frequency [Hz] and rest wavelength in vacuo [m], only one of which need be given, the other should be set to zero. Neither are required if the translation is between wave-characteristic types, or between velocity-characteristic types. E.g., required for '<code><b>FREQ</b></code>' -> <code><b>'ZOPT-F2W'</b></code>, but not required for <code><b>'VELO-F2V'</b></code> -> <code><b>'ZOPT-F2W'</b></code>.</td></tr>
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>ctypeS2</em> </td><td>Required spectral axis type (eight characters with null termination). The first four characters are required to be given and are never modified. The remaining four, the algorithm code, are completely determined by, and must be consistent with, ctypeS1 and the first four characters of ctypeS2. A non-zero status value will be returned if they are inconsistent (see below). However, if the final three characters are specified as "???", or if just the eighth character is specified as '?', the correct algorithm code will be substituted (applies for grism axes as well as non-grism).</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>crvalS2</em> </td><td>Value of the new <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point, i.e. the new <code><b>CRVAL</b>ia</code> keyvalue, SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>cdeltS2</em> </td><td>Increment of the new <img class="formulaInl" alt="$S$" src="form_32.png">-type spectral variable at the reference point, i.e. the new <code><b>CDELT</b>ia</code> keyvalue, SI units. </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>err</em> </td><td>For function return values > 1, this struct will contain a detailed error message. May be NULL if an error message is not desired.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>0: Success.</li><li>2: Invalid spectral parameters.</li></ul>
A status value of 2 will be returned if restfrq or restwav are not specified when required, or if ctypeS1 or ctypeS2 are self-inconsistent, or have different spectral <img class="formulaInl" alt="$X$" src="form_10.png">-type variables. </dd></dl>
</div>
</div><p>
<a class="anchor" name="615d3ef3a505a8be7da1578d9338d218"></a><!-- doxytag: member="spc.h::spcaips" ref="615d3ef3a505a8be7da1578d9338d218" args="(const char ctypeA[], int velref, char ctype[], char specsys[])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcaips </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeA</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>velref</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>ctype</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>specsys</em>[]</td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>spcaips</b>() translates AIPS-convention spectral keywords, <code><b>CTYPE</b>n</code> and <code><b>VELREF</b></code>, into <code><b>CTYPE</b>ia</code> and <code><b>SPECSYS</b>a</code>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>ctypeA</em> </td><td><code><b>CTYPE</b>ia</code> keyvalue (eight characters, need not be null- terminated). </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>velref</em> </td><td>AIPS-convention <code><b>VELREF</b></code> code. It has the following integer values:<ul>
<li>1: LSR kinematic, originally described simply as "LSR" without distinction between the kinematic and dynamic definitions.</li><li>2: Barycentric, originally described as "HEL" meaning heliocentric.</li><li>3: Topocentric, originally described as "OBS" meaning geocentric but widely interpreted as topocentric.</li></ul>
AIPS++ extensions to <code><b>VELREF</b></code> are also recognized:<ul>
<li>4: LSR dynamic.</li><li>5: Geocentric.</li><li>6: Source rest frame.</li><li>7: Galactocentric.</li></ul>
For an AIPS '<code><b>VELO</b></code>' axis, a radio convention velocity is denoted by adding 256 to <code><b>VELREF</b></code>, otherwise an optical velocity is indicated (not applicable to '<code><b>FELO</b></code>' axes). Unrecognized values of <code><b>VELREF</b></code> are simply ignored. <br>
<code><b>VELREF</b></code> takes precedence over <code><b>CTYPE</b>ia</code> in defining the Doppler frame, e.g. if <div class="fragment"><pre class="fragment"> CTYPEn = <span class="stringliteral">'VELO-HEL'</span>
VELREF = 1
</pre></div> <br>
the Doppler frame is set to LSRK.</td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>ctype</em> </td><td>Translated <code><b>CTYPE</b>ia</code> keyvalue, or a copy of ctypeA if no translation was performed (null-filled). </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>specsys</em> </td><td>Doppler reference frame indicated by <code><b>VELREF</b></code> or else by <code><b>CTYPE</b>n</code>.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Status return value:<ul>
<li>-1: No translation required (not an error).</li><li>0: Success. </li></ul>
</dd></dl>
</div>
</div><p>
<a class="anchor" name="6f88e6f1a549bffa0d0ab2b9523d2000"></a><!-- doxytag: member="spc.h::spctyp" ref="6f88e6f1a549bffa0d0ab2b9523d2000" args="(const char ctype[], char stype[], char scode[], char sname[], char units[], char *ptype, char *xtype, int *restreq)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spctyp </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctype</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>stype</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>scode</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>sname</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>units</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="b9fc42d8e1d281839a0a42ac00bcd180"></a><!-- doxytag: member="spc.h::spcspx" ref="b9fc42d8e1d281839a0a42ac00bcd180" args="(const char ctypeS[], double crvalS, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalX, double *dXdS)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcspx </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalS</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>dXdS</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="49f16254df0e3498ae2c1eb641f5232c"></a><!-- doxytag: member="spc.h::spcxps" ref="49f16254df0e3498ae2c1eb641f5232c" args="(const char ctypeS[], double crvalX, double restfrq, double restwav, char *ptype, char *xtype, int *restreq, double *crvalS, double *dSdX)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcxps </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>ptype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>xtype</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>restreq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalS</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>dSdX</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="96e8686daa13255e36506c3bfc213e46"></a><!-- doxytag: member="spc.h::spctrn" ref="96e8686daa13255e36506c3bfc213e46" args="(const char ctypeS1[], double crvalS1, double cdeltS1, double restfrq, double restwav, char ctypeS2[], double *crvalS2, double *cdeltS2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spctrn </td>
<td>(</td>
<td class="paramtype">const char </td>
<td class="paramname"> <em>ctypeS1</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>crvalS1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>cdeltS1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restfrq</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>restwav</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char </td>
<td class="paramname"> <em>ctypeS2</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>crvalS2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double * </td>
<td class="paramname"> <em>cdeltS2</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="96978fec523018fd6898301a3452c166"></a><!-- doxytag: member="spc.h::spc_errmsg" ref="96978fec523018fd6898301a3452c166" args="[]" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char * <a class="el" href="spc_8h.html#96978fec523018fd6898301a3452c166">spc_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
<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>
|