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 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
|
*=======================================================================
*
* PGSBOX 8.4 - draw curvilinear coordinate axes for PGPLOT.
* Copyright (C) 1997-2024, Mark Calabretta
*
* This file is part of PGSBOX.
*
* PGSBOX is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PGSBOX is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with PGSBOX. If not, see http://www.gnu.org/licenses.
*
* Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
* http://www.atnf.csiro.au/people/Mark.Calabretta
* $Id: pgtest.f,v 8.4 2024/10/28 13:56:18 mcalabre Exp $
*=======================================================================
PROGRAM PGTEST
*=======================================================================
LOGICAL LARGE
INTEGER C0(7), CI(7), GCODE(2), IC, IERR, J, NAXIS(2),
: NLIPRM(2), STATUS
REAL BLC(2), SCL, TRC(2)
DOUBLE PRECISION CACHE(4,0:256), DEC0, GRID1(0:8), GRID2(0:8),
: NLDPRM(8), ROTN, TIKLEN
CHARACTER CTYPE(2)*72, DEVTYP*16, ESCAPE*1, FCODE(2)*4,
: IDENTS(3)*80, NLCPRM(1)*1, OPT(2)*1
DOUBLE PRECISION D2R, PI
PARAMETER (PI = 3.141592653589793238462643D0)
PARAMETER (D2R = PI/180D0)
INCLUDE 'wcs.inc'
INTEGER WCS(WCSLEN)
EXTERNAL LNGVEL
EXTERNAL FSCAN
EXTERNAL PGCRFN
EXTERNAL PGWCSL
*-----------------------------------------------------------------------
* Setup.
NAXIS(1) = 512
NAXIS(2) = 512
BLC(1) = 0.5
BLC(2) = 0.5
TRC(1) = NAXIS(1) + 0.5
TRC(2) = NAXIS(2) + 0.5
ESCAPE = CHAR(92)
* CALL PGBEG (0, '?', 1, 1)
call pgbeg (0, '/null', 1, 1)
CALL PGQINF ('TYPE', DEVTYP, J)
IF (DEVTYP.EQ.'PS' .OR.
: DEVTYP.EQ.'VPS' .OR.
: DEVTYP.EQ.'CPS' .OR.
: DEVTYP.EQ.'VCPS') THEN
* Switch black and white.
CALL PGSCR (0, 1.0, 1.0, 1.0)
CALL PGSCR (1, 0.0, 0.0, 0.0)
END IF
LARGE = DEVTYP.EQ.'XWINDOW'
IF (LARGE) THEN
SCL = 1.0
CALL PGVSTD ()
ELSE
SCL = 0.7
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
* Yellow.
CALL PGSCR (2, 1.0, 1.0, 0.0)
* White.
CALL PGSCR (3, 1.0, 1.0, 1.0)
* Pale blue.
CALL PGSCR (4, 0.5, 0.5, 0.8)
* Pale red.
CALL PGSCR (5, 0.8, 0.5, 0.5)
* Grey.
CALL PGSCR (6, 0.7, 0.7, 0.7)
* Dark green.
CALL PGSCR (7, 0.3, 0.5, 0.3)
C0(1) = -1
C0(2) = -1
C0(3) = -1
C0(4) = -1
C0(5) = -1
C0(6) = -1
C0(7) = -1
CALL PGWNAD (0.0, 1.0, 0.0, 1.0)
CALL PGASK (.TRUE.)
CALL PGPAGE ()
STATUS = WCSPTI (WCS, WCS_FLAG, -1, 0, 0)
*-----------------------------------------------------------------------
* Longitude-velocity map; the y-axis is regularly spaced in
* frequency but is to be labelled as a true relativistic velocity.
* - PGSBOX uses subroutine LNGVEL.
* - Separable (i.e. orthogonal), non-linear coordinate system.
* - Automatic choice of coordinate increments.
* - Extraction of a common scaling factor.
* - Automatic choice of what edges to label.
* - Request for tickmarks (internal) for one coordinate and grid
* lines for the other.
* - Simple two-colour grid using two calls with deferred
* labelling on the first call.
* - Degree labelling.
* - Suppression of zero arcmin and arcsec fields in sexagesimal
* degree format.
WRITE (*, '(/,A)') 'Longitude-velocity map'
* Reference pixel coordinates.
NLDPRM(1) = 1D0
NLDPRM(2) = 256D0
* Reference pixel values.
NLDPRM(3) = 0D0
NLDPRM(4) = 1.420D9
* Coordinate increments.
NLDPRM(5) = 360D0/(NAXIS(1)-1)
NLDPRM(6) = 4D6
* Rest frequency.
NLDPRM(7) = 1.420D9
* Annotation.
IDENTS(1) = 'galactic longitude'
IDENTS(2) = 'velocity (m/s)'
IDENTS(3) = 'HI line'
OPT(1) = 'F'
OPT(2) = ' '
* Normal size lettering.
CALL PGSCH (1.0*SCL)
* Yellow tick marks for longitude and grid lines for velocity.
CALL PGSCI (2)
GCODE(1) = 1
GCODE(2) = 2
* Defer labelling.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., LNGVEL, 1, 1, 7, ' ', NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw fiducial grid lines in white and do labelling.
CALL PGSCI (1)
GCODE(1) = 2
GCODE(2) = 2
GRID1(1) = 180D0
GRID2(1) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 0, C0, GCODE, 0D0,
: 1, GRID1, 1, GRID2, .FALSE., LNGVEL, 1, 1, 7, ' ', NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Azimuth-frequency scan; this sort of output might be obtained from
* an antenna that scans in azimuth with a receiver that scans
* simultaneously in frequency.
* - PGSBOX uses subroutine FSCAN.
* - Non-separable (i.e. non-orthogonal) non-linear coordinate
* system.
* - Automatic choice of what edges to label; results in labelling
* the bottom, left and right sides of the plot.
* - Cyclic labelling. FSCAN returns the azimuth in the range
* 0 - 720 degrees but PGSBOX is set to normalize this to two
* cycles of 0 - 360 degrees.
* - Logarithmic labelling.
* - Automatic choice of coordinate increments but with request
* for all grid lines for the logarithmic coordinate.
* - Degree labelling.
* - Suppression of common zero arcmin and arcsec fields in
* sexagesimal degree format.
WRITE (*, '(/,A)') 'Azimuth-frequency scan'
* Reference pixel coordinates.
NLDPRM(1) = 0.5D0
NLDPRM(2) = 0.5D0
* Reference pixel values.
NLDPRM(3) = 0D0
NLDPRM(4) = 8.5D0
* Coordinate increments.
NLDPRM(5) = 720D0/(NAXIS(1)+1)
NLDPRM(6) = 0.002D0
* Rate of change of NLDPRM(4) with x-pixel.
NLDPRM(7) = -0.002D0
* Annotation.
IDENTS(1) = 'azimuth'
IDENTS(2) = ESCAPE // 'gn/Hz'
IDENTS(3) = 'Frequency/azimuth scan'
OPT(1) = 'D'
OPT(2) = 'L'
* Normal size lettering.
CALL PGSCH (1.0*SCL)
* Draw full grid lines.
CALL PGSCI (1)
GCODE(1) = 2
GCODE(2) = 2
* Setting LABDEN = 9900 forces all logarithmic grid lines to be
* drawn.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 9900, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., FSCAN, 1, 1, 7, ' ', NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Z versus time plot.
* - PGSBOX uses subroutine PGCRFN.
* - Separable (i.e. orthogonal), non-linear coordinate system.
* - Use of function PGCRFN for separable axis types.
* - Automatic choice of what edges to label; results in labelling
* the bottom and left sides of the plot.
* - Automatic choice of coordinate increments.
* - Logarithmic labelling over many orders of magnitude.
* - Single-character annotation on a vertical axis is upright.
WRITE (*, '(/,A)') 'Z versus time plot'
* Function types.
FCODE(1) = 'Lin '
FCODE(2) = 'Log '
* Reference pixel coordinates.
NLDPRM(1) = 0.5D0
NLDPRM(2) = -50D0
* Coordinate increments.
NLDPRM(3) = 0.04D0
NLDPRM(4) = 0.02D0
* Reference pixel values.
NLDPRM(5) = -3.0D0
NLDPRM(6) = 1.0D0
* Annotation.
IDENTS(1) = 'Age of universe (sec)'
IDENTS(2) = 'Y'
IDENTS(3) = ' '
OPT(1) = 'L'
OPT(2) = ' '
* Normal size lettering.
CALL PGSCH (1.0*SCL)
* Draw ticks for the first coordinate, grid lines for the second.
CALL PGSCI (1)
GCODE(1) = 1
GCODE(2) = 2
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., PGCRFN, 8, 2, 4, FCODE, NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Simple SIN projection near the south celestial pole.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - Non-separable (i.e. non-orthogonal) curvilinear coordinate
* system.
* - Demonstrate parameter definition for PGWCSL.
* - Discovery of grid lines that do not cross any axis.
* - Automatic choice of what edges to label; results in labelling
* all sides of the plot.
* - Automatic choice of coordinate increments but with request
* for increased grid density for each coordinate.
* - Double precision accuracy.
* - Cyclic coordinates. PGWCSL returns the right ascension in
* the range -180 to +180 degrees, i.e. with a discontinuity
* at +/- 180 degrees.
* - Labelling of degrees as time in the range 0 - 24h.
* - Suppression of labels that would overlap one another.
* - Sexagesimal degree labelling with automatically determined
* precision.
* - Suppression of common zero minute and second fields in
* sexagesimal time format.
WRITE (*, '(/,A)') 'Simple SIN projection'
STATUS = WCSINI (2, WCS)
* Set projection type to SIN.
CTYPE(1) = 'RA---SIN'
CTYPE(2) = 'DEC--SIN'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 384D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 256D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0/3600000D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0/3600000D0, 2, 0)
* Spherical coordinate references.
DEC0 = -89.99995D0
STATUS = WCSPTD (WCS, WCS_CRVAL, 25D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, DEC0, 2, 0)
* Set parameters for an NCP projection.
DEC0 = DEC0*D2R
STATUS = WCSPTD (WCS, WCS_PV, 0D0, 2, 1)
STATUS = WCSPTD (WCS, WCS_PV, COS(DEC0)/SIN(DEC0), 2, 2)
* Annotation.
IDENTS(1) = 'Right ascension'
IDENTS(2) = 'Declination'
IDENTS(3) = 'WCS SIN projection'
OPT(1) = 'G'
OPT(2) = 'E'
* Reduced size lettering.
CALL PGSCH (0.8*SCL)
* Draw full grid lines.
CALL PGSCI (1)
GCODE(1) = 2
GCODE(2) = 2
* Draw the celestial grid. The grid density is set for each world
* coordinate by specifying LABDEN = 1224.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 1224, C0, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .FALSE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Conic equal area projection.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - Non-separable (i.e. non-orthogonal) curvilinear coordinate
* system.
* - Coordinate system undefined in areas of the plot.
* - Demonstrate parameter definition for PGWCSL.
* - Discontinuous grid lines handled by PGWCSL.
* - Discovery of grid lines that do not cross any axis.
* - Colour control for grid and labelling.
* - Reduced size lettering.
* - Automatic choice of what edges to label; results in labelling
* all sides of the plot.
* - Automatic choice of coordinate increments.
* - Cyclic coordinates. PGWCSL returns the longitude in the
* range -180 to +180 degrees, i.e. with a discontinuity at
* +/- 180 degrees.
* - Suppression of labels that would overlap one another.
* - Suppression of common zero arcmin and arcsec fields in
* sexagesimal degree format.
WRITE (*, '(/,A)') 'Conic equal area projection'
STATUS = WCSINI (2, WCS)
* Set projection type to conic equal-area.
CTYPE(1) = 'RA---COE'
CTYPE(2) = 'DEC--COE'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 256D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 256D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0/3D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0/3D0, 2, 0)
* Spherical coordinate references.
STATUS = WCSPTD (WCS, WCS_CRVAL, 90D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 30D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 150D0, 0, 0)
* Middle latitude and offset from standard parallels.
STATUS = WCSPTD (WCS, WCS_PV, 60D0, 2, 1)
STATUS = WCSPTD (WCS, WCS_PV, 15D0, 2, 2)
* Annotation.
IDENTS(1) = 'longitude'
IDENTS(2) = 'latitude'
IDENTS(3) = 'WCS conic equal area projection'
OPT(1) = 'E'
OPT(2) = 'E'
* Reduced size lettering.
CALL PGSCH (0.8*SCL)
* Draw full grid lines.
GCODE(1) = 2
GCODE(2) = 2
* Use colour to associate grid lines and labels.
* Meridians in red.
CALL PGSCR (10, 0.5, 0.0, 0.0)
* Parallels in blue.
CALL PGSCR (11, 0.0, 0.2, 0.5)
* Longitudes in red.
CALL PGSCR (12, 0.8, 0.3, 0.0)
* Latitudes in blue.
CALL PGSCR (13, 0.0, 0.4, 0.7)
* Longitude labels in red.
CALL PGSCR (14, 0.8, 0.3, 0.0)
* Latitude labels in blue.
CALL PGSCR (15, 0.0, 0.4, 0.7)
* Title in cyan.
CALL PGSCR (16, 0.3, 1.0, 1.0)
CI(1) = 10
CI(2) = 11
CI(3) = 12
CI(4) = 13
CI(5) = 14
CI(6) = 15
CI(7) = 16
* Draw the celestial grid letting PGSBOX choose the increments.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 0, CI, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Set parameters to draw the native grid.
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 60D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 999D0, 0, 0)
STATUS = WCSPTD (WCS, WCS_LATPOLE, 999D0, 0, 0)
* We just want to delineate the boundary, in green.
CALL PGSCI (7)
GRID1(1) = -180D0
GRID1(2) = 180D0
GRID2(1) = -90D0
GRID2(2) = 90D0
IC = -1
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 2, GRID1, 2, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGSCI (1)
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Polyconic projection with colour-coded grid.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - Non-separable (i.e. non-orthogonal) curvilinear coordinate
* system.
* - Coordinate system undefined in areas of the plot.
* - Demonstrate parameter definition for PGWCSL.
* - Discontinuous grid lines handled by PGWCSL.
* - Colour coded labelling.
* - Colour coded grid implemented by the caller.
* - Basic management of the axis-crossing table (see code).
* - Reduced size lettering.
* - Tick marks external to the frame.
* - User selection of what edges to label with request for both
* coordinates to be labelled on bottom, left and top edges.
* - User selection of grid lines to plot.
* - Concatenation of annotation at bottom and left; automatically
* suppressed at the top since only one coordinate is labelled
* there.
* - Suppression of labels that would overlap one another.
* - Degree labelling.
* - Labelling of degrees as time in the range -12 - +12h.
* - Suppression of common zero minute and second fields in
* sexagesimal time format.
WRITE (*, '(/,A)') 'Polyconic projection with colour-coded grid'
STATUS = WCSINI (2, WCS)
* Set projection type to polyconic.
CTYPE(1) = 'RA---PCO'
CTYPE(2) = 'DEC--PCO'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 192D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 640D0, 2, 0)
* Rotate 30 degrees.
ROTN = 30D0*D2R
STATUS = WCSPTD (WCS, WCS_PC, COS(ROTN), 1, 1)
STATUS = WCSPTD (WCS, WCS_PC, SIN(ROTN), 1, 2)
STATUS = WCSPTD (WCS, WCS_PC, -SIN(ROTN), 2, 1)
STATUS = WCSPTD (WCS, WCS_PC, COS(ROTN), 2, 2)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0/5D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0/5D0, 2, 0)
* Spherical coordinate references.
STATUS = WCSPTD (WCS, WCS_CRVAL, 332D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 40D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, -30D0, 0, 0)
* Annotation.
IDENTS(1) = 'Hour angle'
IDENTS(2) = 'Declination'
IDENTS(3) = 'WCS polyconic projection'
OPT(1) = 'H'
OPT(2) = 'B'
* Reduced size lettering.
CALL PGSCH (0.9*SCL)
* Draw external (TIKLEN < 0) tick marks every 5 degrees.
CALL PGSCI (6)
GCODE(1) = 1
GCODE(2) = 1
TIKLEN = -2D0
IC = -1
GRID1(0) = 5D0
GRID2(0) = 5D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, TIKLEN,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Resetting the table index to zero causes information about the
* tick marks to be discarded.
IC = 0
* Draw full grid lines in yellow rather than tick marks.
CALL PGSCI (2)
GCODE(1) = 2
GCODE(2) = 2
* Draw the primary meridian and equator.
GRID1(1) = 0D0
GRID2(1) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 1, GRID1, 1, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* At this point the axis-crossing table will have entries for the
* primary meridian and equator. Labelling was deferred in the
* previous call, and the table is passed intact on the second call
* to accumulate further axis-crossings.
* Draw 90 degree meridians and poles in white.
CALL PGSCI (3)
GRID1(1) = 90D0
GRID1(2) = 180D0
GRID1(3) = 270D0
GRID2(1) = -90D0
GRID2(2) = 90D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 3, GRID1, 2, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the first set of 15 degree meridians and parallels in blue.
CALL PGSCI (4)
GRID1(1) = 15D0
GRID1(2) = 60D0
GRID1(3) = 105D0
GRID1(4) = 150D0
GRID1(5) = 195D0
GRID1(6) = 240D0
GRID1(7) = 285D0
GRID1(8) = 330D0
GRID2(1) = -75D0
GRID2(2) = -30D0
GRID2(3) = 15D0
GRID2(4) = 60D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 8, GRID1, 4, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the second set of 15 degree meridians and parallels in red.
CALL PGSCI (5)
GRID1(1) = 30D0
GRID1(2) = 75D0
GRID1(3) = 120D0
GRID1(4) = 165D0
GRID1(5) = 210D0
GRID1(6) = 255D0
GRID1(7) = 300D0
GRID1(8) = 345D0
GRID2(1) = -60D0
GRID2(2) = -15D0
GRID2(3) = 30D0
GRID2(4) = 75D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 8, GRID1, 4, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* The axis-crossing table has now accumulated information for all of
* the preceding meridians and parallels but no labels have been
* produced. It will acquire information for the the next set of
* meridians and parallels before being processed by this call to
* PGSBOX which finally produces the labels.
* Draw the 45 degree meridians and parallels in grey and use colour
* to differentiate grid labels.
* Meridians and parallels in grey.
CALL PGSCR (10, 0.7, 0.7, 0.7)
CALL PGSCR (11, 0.7, 0.7, 0.7)
* Longitudes tinged red.
CALL PGSCR (12, 1.0, 0.9, 0.6)
* Latitudes tinged green.
CALL PGSCR (13, 0.8, 1.0, 0.9)
* Longitude labels tinged red.
CALL PGSCR (14, 1.0, 0.9, 0.6)
* Latitude labels tinged green.
CALL PGSCR (15, 0.8, 1.0, 0.9)
* Title in white.
CALL PGSCR (16, 1.0, 1.0, 1.0)
CI(1) = 10
CI(2) = 11
CI(3) = 12
CI(4) = 13
CI(5) = 14
CI(6) = 15
CI(7) = 16
CALL PGSCI (6)
* Tell PGSBOX what edges to label.
GRID1(1) = 45D0
GRID1(2) = 135D0
GRID1(3) = 225D0
GRID1(4) = 315D0
GRID2(1) = -45D0
GRID2(2) = 45D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 2333, 0, CI, GCODE, 0D0,
: 4, GRID1, 2, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Native grid in green (delineates boundary).
CALL PGSCI (7)
GRID1(1) = -180D0
GRID1(2) = 180D0
GRID2(1) = -999D0
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 999D0, 0, 0)
IC = -1
CALL PGSBOX (BLC, TRC, IDENTS, OPT, -1, 0, C0, GCODE, 0D0,
: 2, GRID1, 1, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGSCI (1)
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Plate Carree projection.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - Rectangular image.
* - Dual coordinate grids.
* - Non-separable (i.e. non-orthogonal) curvilinear coordinate
* system.
* - Demonstrate parameter definition for PGWCSL.
* - Discontinuous grid lines handled by PGWCSL.
* - Colour coding of grid and labelling.
* - Reduced size lettering.
* - Manual labelling control.
* - Manual and automatic choice of coordinate increments.
* - Cyclic coordinates. PGWCSL returns the longitude in the
* range -180 to +180 degrees, i.e. with a discontinuity at
* +/- 180 degrees.
* - Suppression of labels that would overlap one another.
WRITE (*, '(/,A)') 'Plate Carree projection'
NAXIS(1) = 181
NAXIS(2) = 91
BLC(1) = 0.5
BLC(2) = 0.5
TRC(1) = NAXIS(1) + 0.5
TRC(2) = NAXIS(2) + 0.5
* Reset viewport for rectangular image.
IF (LARGE) THEN
CALL PGVSTD ()
ELSE
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
CALL PGWNAD (0.0, 1.0, 0.0, REAL(NAXIS(2))/REAL(NAXIS(1)))
STATUS = WCSINI (2, WCS)
* Set projection type to plate carree.
CTYPE(1) = 'GLON-CAR'
CTYPE(2) = 'GLAT-CAR'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 226D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 46D0, 2, 0)
* Linear transformation matrix.
ROTN = 15D0*D2R
STATUS = WCSPTD (WCS, WCS_PC, COS(ROTN), 1, 1)
STATUS = WCSPTD (WCS, WCS_PC, SIN(ROTN), 1, 2)
STATUS = WCSPTD (WCS, WCS_PC, -SIN(ROTN), 2, 1)
STATUS = WCSPTD (WCS, WCS_PC, COS(ROTN), 2, 2)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0, 2, 0)
* Set parameters to draw the native grid.
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 2, 0)
* The reference pixel was defined so that the native longitude runs
* from 225 deg to 45 deg and this will cause the grid to be
* truncated at the 180 deg boundary. However, being a cylindrical
* projection it is possible to recentre it in longitude. CYLFIX
* will modify CRPIX, CRVAL, and LONPOLE to suit.
CALL CYLFIX (NAXIS, WCS)
* Annotation.
IDENTS(1) = ' '
IDENTS(2) = ' '
IDENTS(3) = 'WCS plate caree projection'
OPT(1) = 'C'
OPT(2) = 'C'
* Reduced size lettering.
CALL PGSCH (0.8*SCL)
* Draw full grid lines.
GCODE(1) = 2
GCODE(2) = 2
* Draw native grid in green.
CALL PGSCR (16, 0.0, 0.2, 0.0)
* Title in cyan.
CALL PGSCR (17, 0.3, 1.0, 1.0)
CI(1) = 16
CI(2) = 16
CI(3) = 7
CI(4) = 7
CI(5) = -1
CI(6) = -1
CI(7) = 17
IC = -1
GRID1(0) = 15D0
GRID2(0) = 15D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 2100, 0, CI, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Reset CRPIX previously modified by CYLFIX.
STATUS = WCSPTD (WCS, WCS_CRPIX, 226D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 46D0, 2, 0)
* Galactic reference coordinates.
STATUS = WCSPTD (WCS, WCS_CRVAL, 30D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 35D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 999D0, 0, 0)
CALL CYLFIX (NAXIS, WCS)
* Annotation.
IDENTS(1) = 'longitude'
IDENTS(2) = 'latitude'
IDENTS(3) = ' '
OPT(1) = 'E'
OPT(2) = 'E'
* Use colour to associate grid lines and labels.
* Meridians in red.
CALL PGSCR (10, 0.5, 0.0, 0.0)
* Parallels in blue.
CALL PGSCR (11, 0.0, 0.2, 0.5)
* Longitudes in red.
CALL PGSCR (12, 0.8, 0.3, 0.0)
* Latitudes in blue.
CALL PGSCR (13, 0.0, 0.4, 0.7)
* Longitude labels in red.
CALL PGSCR (14, 0.8, 0.3, 0.0)
* Latitude labels in blue.
CALL PGSCR (15, 0.0, 0.4, 0.7)
CI(1) = 10
CI(2) = 11
CI(3) = 12
CI(4) = 13
CI(5) = 14
CI(6) = 15
CI(7) = -1
* Draw the celestial grid letting PGSBOX choose the increments.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 21, 0, CI, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGSCI (1)
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Plate Carree projection.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - BLC, TRC unrelated to pixel coordinates.
* - Demonstrate parameter definition for PGWCSL.
* - Poles and 180 meridian projected along edges of the frame.
* - Reduced size lettering.
* - Manual and automatic choice of coordinate increments.
* - Suppression of common zero minute and second fields in
* sexagesimal time format.
WRITE (*, '(/,A)') 'Plate Carree projection'
BLC(1) = -180.0
BLC(2) = -90.0
TRC(1) = 180.0
TRC(2) = +90.0
* Reset viewport for rectangular image.
IF (LARGE) THEN
CALL PGVSTD ()
ELSE
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
CALL PGWNAD (BLC(1), TRC(1), BLC(2), TRC(2))
STATUS = WCSINI (2, WCS)
* Set projection type to plate carree.
CTYPE(1) = 'RA---CAR'
CTYPE(2) = 'DEC--CAR'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 0D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0, 2, 0)
* Set parameters to draw the native grid.
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 0D0, 2, 0)
* Annotation.
IDENTS(1) = 'Right ascension'
IDENTS(2) = 'Declination'
IDENTS(3) = 'WCS plate caree projection'
OPT(1) = 'G'
OPT(2) = 'E'
* Reduced size lettering.
CALL PGSCH (0.7*SCL)
* Draw full grid lines.
GCODE(1) = 2
GCODE(2) = 2
CALL PGSCI (1)
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 2121, 1212, C0, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Cylindrical perspective projection.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - BLC, TRC unrelated to pixel coordinates.
* - Demonstrate parameter definition for PGWCSL.
* - Reduced size lettering.
* - Manual and automatic choice of coordinate increments.
* - Suppression of common zero minute and second fields in
* sexagesimal time format.
WRITE (*, '(/,A)') 'Cylindrical perspective projection'
BLC(1) = -180.0
BLC(2) = -90.0
TRC(1) = 180.0
TRC(2) = +90.0
* Reset viewport for rectangular image.
IF (LARGE) THEN
CALL PGVSTD ()
ELSE
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
CALL PGWNAD (BLC(1), TRC(1), BLC(2), TRC(2))
STATUS = WCSINI (2, WCS)
* Set projection type to cylindrical perspective.
CTYPE(1) = 'RA---CYP'
CTYPE(2) = 'DEC--CYP'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 0D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, -1D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0, 2, 0)
* Set parameters to draw the native grid.
STATUS = WCSPTD (WCS, WCS_CRVAL, 45D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, -90D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 999D0, 0, 0)
* mu and lambda projection parameters.
STATUS = WCSPTD (WCS, WCS_PV, 0D0, 2, 1)
STATUS = WCSPTD (WCS, WCS_PV, 1D0, 2, 2)
* Annotation.
IDENTS(1) = 'Right ascension'
IDENTS(2) = 'Declination'
IDENTS(3) = 'WCS cylindrical perspective projection'
OPT(1) = 'G'
OPT(2) = 'E'
* Reduced size lettering.
CALL PGSCH (0.7*SCL)
* Draw full grid lines.
GCODE(1) = 2
GCODE(2) = 2
CALL PGSCI (1)
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 2121, 1212, C0, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .TRUE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Gnomonic projection.
* - PGSBOX uses subroutine PGWCSL to interface to WCSLIB.
* - Demonstrate parameter definition for PGWCSL.
* - Reduced size lettering.
* - Manual and automatic choice of coordinate increments.
* - Suppression of common zero minute and second fields in
* sexagesimal time format.
WRITE (*, '(/,A)') 'TAN projection'
NAXIS(1) = 100
NAXIS(2) = 100
BLC(1) = 0.5
BLC(2) = 0.5
TRC(1) = NAXIS(1) + 0.5
TRC(2) = NAXIS(2) + 0.5
* Reset viewport for rectangular image.
IF (LARGE) THEN
CALL PGVSTD ()
ELSE
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
CALL PGWNAD (0.0, 1.0, 0.0, REAL(NAXIS(2))/REAL(NAXIS(1)))
STATUS = WCSINI (2, WCS)
* Set projection type to gnomonic.
CTYPE(1) = 'RA---TAN'
CTYPE(2) = 'DEC--TAN'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 50.5D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 1.0D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, 1D-3, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D-3, 2, 0)
* Set parameters to draw the native grid.
STATUS = WCSPTD (WCS, WCS_CRVAL, -45.0D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, -89.7D0, 2, 0)
STATUS = WCSPTD (WCS, WCS_LONPOLE, 999D0, 0, 0)
* Annotation.
IDENTS(1) = 'Right ascension'
IDENTS(2) = 'Declination'
IDENTS(3) = 'WCS TAN projection'
OPT(1) = 'E'
OPT(2) = 'E'
* Reduced size lettering.
CALL PGSCH (0.7*SCL)
* Draw full grid lines.
GCODE(1) = 2
GCODE(2) = 2
CALL PGSCI (1)
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 1212, C0, GCODE, 0D0,
: 0, GRID1, 0, GRID2, .FALSE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Linear-linear plot with two types of alternative labelling.
* - PGSBOX uses subroutine PGCRFN.
* - Separable (i.e. orthogonal), linear coordinate system.
* - Use of function PGCRFN for separable axis types.
* - Alternative labelling and axis annotation.
* - Direct manipulation of the axis-crossing table.
* - Tick mark and grid line control.
* - User selection of what edges to label.
* - Automatic choice of coordinate increments.
WRITE (*, '(/,A)') 'Linear plot with alternative labelling'
IF (LARGE) THEN
CALL PGVSTD ()
ELSE
CALL PGVSIZ (1.0, 3.0, 1.0, 3.0)
END IF
CALL PGWNAD (0.0, 1.0, 0.0, 1.0)
NAXIS(1) = 512
NAXIS(2) = 512
BLC(1) = 0.5
BLC(2) = 0.5
TRC(1) = NAXIS(1) + 0.5
TRC(2) = NAXIS(2) + 0.5
* Function types.
FCODE(1) = 'Lin '
FCODE(2) = 'Lin '
* Reference pixel coordinates.
NLDPRM(1) = 0.5D0
NLDPRM(2) = 0.5D0
* Coordinate increments.
NLDPRM(3) = 0.03D0
NLDPRM(4) = 0.03D0
* Reference pixel values.
NLDPRM(5) = 20D0
NLDPRM(6) = 0D0
* Annotation.
IDENTS(1) = 'temperature of frog (' // ESCAPE // 'uo' //
: ESCAPE // 'dC)'
IDENTS(2) = 'distance hopped (m)'
IDENTS(3) = ' '
OPT(1) = ' '
OPT(2) = ' '
* Reduced size lettering.
CALL PGSCH (0.8*SCL)
* Draw tick marks at the bottom for the first coordinate, grid lines
* for the second. Setting GCODE(1) = -1 inhibits information being
* stored for labels on the top edge while GCODE(2) = 2 causes
* information to be stored for labels on the right edge even if
* those labels are not actually produced.
CALL PGSCI (1)
GCODE(1) = -1
GCODE(2) = 2
* Set LABCTL = 21 to label the bottom and left edges only.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 21, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., PGCRFN, 8, 2, 4, FCODE, NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Information for labels on the right edge was stored in the
* crossing table on the first call to PGSBOX. We now want to
* manipulate it to convert metres to feet. Note that while it's
* a simple matter to draw alternative sets of tick marks on opposite
* edges of the frame, as with the two temperature scales, we have
* the slightly more difficult requirement of labelling grid lines
* with different values at each end.
DO 10 J = 1, IC
* Look for entries associated with the right edge of the frame.
IF (CACHE(1,J).EQ.4D0) THEN
* Convert to feet, rounding to the nearest 0.1.
CACHE(4,J) = CACHE(4,J) * 1D3/(25.4*12D0)
CACHE(4,J) = AINT(CACHE(4,J)*10D0 + 0.5D0)/10D0
END IF
10 CONTINUE
* Annotation for the right edge.
IDENTS(1) = ' '
IDENTS(2) = '(feet)'
* Set LABCTL = 12000 to label the right edge with the second
* coordinate without redrawing the grid lines.
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 12000, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., PGCRFN, 8, 2, 4, FCODE, NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* The alternative temperature scale in Fahrenheit is to be
* constructed with a new set of tick marks.
NLDPRM(3) = NLDPRM(3)*1.8D0
NLDPRM(5) = NLDPRM(5)*1.8D0 + 32D0
* Draw tick marks at the top for the first coordinate, don't redo
* grid lines for the second.
GCODE(1) = -100
GCODE(2) = 0
* Annotation for the top edge.
IDENTS(1) = '(' // ESCAPE // 'uo' // ESCAPE // 'dF)'
IDENTS(2) = ' '
* Set LABCTL = 100 to label the top edge; Set IC = -1 to redetermine
* the coordinate extrema.
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 100, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., PGCRFN, 8, 2, 4, FCODE, NLIPRM,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Calendar axes using subroutine PGLBOX.
* - Separable (i.e. orthogonal), linear coordinate system.
* - Use of PGLBOX for simple linear axis types.
* - Automatic choice of what edges to label; results in labelling
* the bottom and left sides of the plot.
* - Automatic choice of coordinate increments.
* - Calendar date axis labelling.
* - Single-character annotation on a vertical axis is upright.
WRITE (*, '(/,A)') 'Calendar axes using subroutine PGLBOX'
CALL PGSWIN (51900.0, 52412.0, 51900.0, 57020.0)
* Annotation.
IDENTS(1) = 'Date started'
IDENTS(2) = 'Date finished'
IDENTS(3) = 'Calendar axes using subroutine PGLBOX'
OPT(1) = 'Y'
OPT(2) = 'Y'
* Reduced size lettering.
CALL PGSCH (0.7*SCL)
* Draw tick marks on each axis.
CALL PGSCI (1)
GCODE(1) = 1
GCODE(2) = 1
IC = -1
CALL PGLBOX (IDENTS, OPT, 0, 0, C0, GCODE, 2D0, 0, 0D0, 0, 0D0,
: .FALSE., 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
* Simple linear axes handled by PGWCSL.
* - Separable (i.e. orthogonal), linear coordinate system.
* - Automatic choice of what edges to label; results in labelling
* the bottom and left sides of the plot.
* - Automatic choice of coordinate increments.
* - Tick marks and labels at the edges of the frame.
* - Single-character annotation on a vertical axis is upright.
WRITE (*, '(/,A)') 'Simple linear axes handled by pgwcsl()'
NAXIS(1) = 3
NAXIS(2) = 3
BLC(1) = 0.5
BLC(2) = 0.5
TRC(1) = NAXIS(1) + 0.5
TRC(2) = NAXIS(2) + 0.5
STATUS = WCSINI (2, WCS)
CTYPE(1) = 'X'
CTYPE(2) = 'Y'
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(1), 1, 0)
STATUS = WCSPTC (WCS, WCS_CTYPE, CTYPE(2), 2, 0)
* Reference pixel coordinates.
STATUS = WCSPTD (WCS, WCS_CRPIX, 2D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRPIX, 2D0, 2, 0)
* Coordinate increments.
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CDELT, 1D0, 2, 0)
* Spherical coordinate references.
STATUS = WCSPTD (WCS, WCS_CRVAL, 2D0, 1, 0)
STATUS = WCSPTD (WCS, WCS_CRVAL, 2D0, 2, 0)
* Annotation.
IDENTS(1) = 'X'
IDENTS(2) = 'Y'
IDENTS(3) = 'Simple linear axes handled by pgwcsl()'
OPT(1) = ' '
OPT(2) = ' '
* Reduced size lettering.
CALL PGSCH (0.8*SCL)
* Draw tick marks only.
CALL PGSCI (1)
GCODE(1) = 1
GCODE(2) = 1
IC = -1
GRID1(0) = 0D0
GRID2(0) = 0D0
CALL PGSBOX (BLC, TRC, IDENTS, OPT, 0, 0, C0, GCODE, 2D0,
: 0, GRID1, 0, GRID2, .FALSE., PGWCSL, 1, WCSLEN, 1, NLCPRM, WCS,
: NLDPRM, 256, IC, CACHE, IERR)
* Draw the frame.
CALL PGBOX ('BC', 0.0, 0, 'BC', 0.0, 0)
CALL WCSLEEP (250)
CALL PGPAGE ()
*-----------------------------------------------------------------------
STATUS = WCSFREE (WCS)
CALL PGASK (.FALSE.)
CALL PGEND ()
END
|