Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

1375

1376

1377

1378

1379

1380

1381

1382

1383

1384

1385

1386

1387

1388

1389

1390

1391

1392

1393

1394

1395

1396

1397

1398

1399

1400

1401

1402

1403

1404

1405

1406

1407

1408

1409

1410

1411

1412

1413

1414

1415

1416

1417

1418

1419

1420

1421

1422

1423

1424

1425

1426

1427

1428

1429

1430

1431

1432

1433

1434

1435

1436

1437

1438

1439

1440

1441

1442

1443

1444

1445

1446

1447

1448

1449

1450

1451

1452

1453

1454

1455

1456

1457

1458

1459

1460

1461

1462

1463

1464

1465

1466

1467

1468

1469

1470

1471

1472

1473

1474

1475

1476

1477

1478

1479

1480

1481

1482

1483

1484

1485

1486

1487

1488

1489

1490

1491

1492

1493

1494

1495

1496

1497

1498

1499

1500

1501

1502

1503

1504

1505

1506

1507

1508

1509

1510

1511

1512

1513

1514

1515

1516

1517

1518

1519

1520

1521

1522

1523

1524

1525

1526

1527

1528

1529

1530

1531

1532

1533

1534

1535

1536

1537

1538

1539

1540

1541

1542

1543

1544

1545

1546

1547

1548

1549

1550

1551

1552

1553

1554

1555

1556

1557

1558

1559

1560

1561

1562

1563

1564

1565

1566

1567

1568

1569

1570

1571

1572

1573

1574

1575

1576

1577

1578

1579

1580

1581

1582

1583

1584

1585

1586

1587

1588

1589

1590

1591

1592

1593

1594

1595

1596

1597

1598

1599

1600

1601

1602

1603

1604

1605

1606

1607

1608

1609

1610

1611

1612

1613

1614

1615

1616

1617

1618

1619

1620

1621

1622

1623

1624

1625

1626

1627

1628

1629

1630

1631

1632

1633

1634

1635

1636

1637

1638

1639

1640

1641

1642

1643

1644

1645

1646

1647

1648

1649

1650

1651

1652

1653

1654

1655

1656

1657

1658

1659

1660

1661

1662

1663

1664

1665

1666

1667

1668

1669

1670

1671

1672

1673

1674

1675

1676

1677

1678

1679

1680

1681

1682

1683

1684

1685

1686

1687

1688

1689

1690

1691

1692

1693

1694

1695

1696

1697

1698

1699

1700

1701

1702

1703

1704

1705

1706

1707

1708

1709

1710

1711

1712

1713

1714

1715

1716

1717

1718

1719

1720

1721

1722

1723

1724

1725

1726

1727

1728

1729

1730

1731

1732

1733

1734

1735

1736

1737

1738

1739

1740

1741

1742

1743

1744

1745

1746

1747

1748

1749

1750

1751

1752

1753

1754

1755

1756

1757

1758

1759

1760

1761

1762

1763

1764

1765

1766

1767

1768

1769

1770

1771

1772

1773

1774

1775

1776

1777

1778

1779

1780

1781

1782

1783

1784

1785

1786

1787

1788

1789

1790

1791

1792

1793

1794

1795

1796

1797

1798

1799

1800

1801

1802

1803

1804

1805

1806

1807

1808

1809

1810

1811

1812

1813

1814

1815

1816

1817

1818

1819

1820

1821

1822

1823

1824

1825

1826

1827

1828

1829

1830

1831

1832

1833

1834

1835

1836

1837

1838

1839

1840

1841

1842

1843

1844

1845

1846

1847

1848

1849

1850

1851

1852

1853

1854

1855

1856

1857

1858

1859

1860

1861

1862

1863

1864

1865

1866

1867

1868

1869

1870

1871

1872

1873

1874

1875

1876

1877

1878

1879

1880

1881

1882

1883

1884

1885

1886

1887

1888

1889

1890

1891

1892

1893

1894

1895

1896

1897

1898

1899

1900

1901

1902

1903

1904

1905

1906

1907

1908

1909

1910

1911

1912

1913

1914

1915

1916

1917

1918

1919

1920

1921

1922

1923

1924

1925

1926

1927

1928

1929

1930

1931

1932

1933

1934

1935

1936

1937

1938

1939

1940

1941

1942

1943

1944

1945

1946

1947

1948

1949

1950

1951

1952

1953

1954

1955

1956

1957

1958

1959

1960

1961

1962

1963

1964

1965

1966

1967

1968

1969

1970

1971

1972

1973

1974

1975

1976

1977

1978

1979

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

1990

1991

1992

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

2027

2028

2029

2030

2031

2032

2033

2034

2035

2036

2037

2038

2039

2040

2041

2042

2043

2044

2045

2046

2047

2048

2049

2050

2051

2052

2053

2054

2055

2056

2057

2058

2059

2060

2061

2062

2063

2064

2065

2066

2067

2068

2069

2070

2071

2072

2073

2074

2075

2076

2077

2078

2079

2080

2081

2082

2083

2084

2085

2086

2087

2088

2089

2090

2091

2092

2093

2094

2095

2096

2097

2098

2099

2100

2101

2102

2103

2104

2105

2106

2107

2108

2109

2110

2111

2112

2113

2114

2115

2116

2117

2118

2119

2120

2121

2122

2123

2124

2125

2126

2127

2128

2129

2130

2131

2132

2133

2134

2135

2136

2137

2138

2139

2140

2141

2142

2143

2144

2145

2146

2147

2148

2149

2150

2151

2152

2153

2154

2155

2156

2157

2158

2159

2160

2161

2162

2163

2164

2165

2166

2167

2168

2169

2170

2171

2172

2173

2174

2175

2176

2177

2178

2179

2180

2181

2182

2183

2184

2185

2186

2187

2188

2189

2190

2191

2192

2193

2194

2195

2196

2197

2198

2199

2200

2201

2202

2203

2204

2205

2206

2207

2208

2209

2210

2211

2212

2213

2214

2215

2216

2217

2218

2219

2220

2221

2222

2223

2224

2225

2226

2227

2228

2229

2230

2231

2232

2233

2234

2235

2236

2237

2238

2239

2240

2241

2242

2243

2244

2245

2246

2247

2248

2249

2250

2251

2252

2253

2254

2255

2256

2257

2258

2259

2260

2261

2262

2263

2264

2265

2266

2267

2268

2269

2270

2271

2272

2273

2274

2275

2276

2277

2278

2279

2280

2281

2282

2283

2284

2285

2286

2287

2288

2289

2290

2291

2292

2293

2294

2295

2296

2297

2298

2299

2300

2301

2302

2303

2304

2305

2306

2307

2308

2309

2310

2311

2312

2313

2314

2315

2316

2317

2318

2319

2320

2321

2322

2323

2324

2325

2326

2327

2328

2329

2330

2331

2332

2333

2334

2335

2336

2337

2338

2339

2340

2341

2342

2343

2344

2345

2346

2347

2348

2349

2350

2351

2352

2353

2354

2355

2356

2357

2358

2359

2360

2361

2362

2363

2364

2365

2366

2367

2368

2369

2370

2371

2372

2373

2374

2375

2376

2377

2378

2379

2380

2381

2382

2383

2384

2385

2386

2387

2388

2389

2390

2391

2392

2393

2394

2395

2396

2397

2398

2399

2400

2401

2402

2403

2404

2405

2406

2407

2408

2409

2410

2411

2412

2413

2414

2415

2416

2417

2418

2419

2420

2421

2422

2423

2424

2425

2426

2427

2428

2429

2430

2431

2432

2433

2434

2435

2436

2437

2438

2439

2440

2441

2442

2443

2444

2445

2446

2447

2448

2449

2450

2451

2452

2453

2454

2455

2456

2457

2458

2459

2460

2461

2462

2463

2464

2465

2466

2467

2468

2469

2470

2471

2472

2473

2474

2475

2476

2477

2478

2479

2480

2481

2482

2483

2484

2485

2486

2487

2488

2489

2490

2491

2492

2493

2494

2495

2496

2497

2498

2499

2500

2501

2502

2503

2504

2505

2506

2507

2508

2509

2510

2511

2512

2513

2514

2515

2516

2517

2518

2519

2520

2521

2522

2523

2524

2525

2526

2527

2528

2529

2530

2531

2532

2533

2534

2535

2536

2537

2538

2539

2540

2541

2542

2543

2544

2545

2546

2547

2548

2549

2550

2551

2552

2553

2554

2555

2556

2557

2558

2559

2560

2561

2562

2563

2564

2565

2566

2567

2568

2569

2570

2571

2572

2573

2574

2575

2576

2577

2578

2579

2580

2581

2582

2583

2584

2585

2586

2587

2588

2589

2590

2591

2592

2593

2594

2595

2596

2597

2598

2599

2600

2601

2602

2603

2604

2605

2606

2607

2608

2609

2610

2611

2612

2613

2614

2615

2616

2617

2618

2619

2620

2621

2622

2623

2624

2625

2626

2627

2628

2629

2630

2631

2632

2633

2634

2635

2636

2637

2638

2639

2640

2641

2642

2643

2644

2645

2646

2647

2648

2649

2650

2651

2652

2653

2654

2655

2656

2657

2658

2659

2660

2661

2662

2663

2664

2665

2666

2667

2668

2669

2670

2671

2672

2673

2674

2675

2676

2677

2678

2679

2680

2681

2682

2683

2684

2685

2686

2687

2688

2689

2690

2691

2692

2693

2694

2695

2696

2697

2698

2699

2700

2701

2702

2703

2704

2705

2706

2707

2708

2709

2710

2711

2712

2713

2714

2715

2716

2717

2718

2719

2720

2721

2722

2723

2724

2725

2726

2727

2728

2729

2730

2731

2732

2733

2734

2735

2736

2737

2738

2739

2740

2741

2742

2743

2744

2745

2746

2747

2748

2749

2750

2751

2752

2753

2754

2755

2756

2757

2758

2759

2760

2761

2762

2763

2764

2765

2766

2767

2768

2769

2770

2771

2772

2773

2774

2775

2776

2777

2778

2779

2780

2781

2782

2783

2784

2785

2786

2787

2788

2789

2790

2791

2792

2793

2794

2795

2796

2797

2798

2799

2800

2801

2802

2803

2804

2805

2806

2807

2808

2809

2810

2811

2812

2813

2814

2815

2816

2817

2818

2819

2820

2821

2822

2823

2824

2825

2826

2827

2828

2829

2830

2831

2832

2833

2834

2835

2836

2837

2838

2839

2840

2841

2842

2843

2844

2845

2846

2847

2848

2849

2850

2851

2852

2853

2854

2855

2856

2857

2858

2859

2860

2861

2862

2863

2864

2865

2866

2867

2868

2869

2870

2871

2872

2873

2874

2875

2876

2877

2878

2879

2880

2881

2882

2883

2884

2885

2886

2887

2888

2889

2890

2891

2892

2893

2894

2895

2896

2897

2898

2899

2900

2901

2902

2903

2904

2905

2906

2907

2908

2909

2910

2911

2912

2913

2914

2915

2916

2917

2918

2919

2920

2921

2922

2923

2924

2925

2926

2927

2928

2929

2930

2931

2932

2933

2934

2935

2936

2937

2938

2939

2940

2941

2942

2943

2944

2945

2946

2947

2948

2949

2950

2951

2952

2953

2954

2955

2956

2957

2958

2959

2960

2961

2962

2963

2964

2965

2966

2967

2968

2969

2970

2971

2972

2973

2974

2975

2976

2977

2978

2979

2980

2981

2982

2983

2984

2985

2986

2987

2988

2989

2990

2991

2992

2993

2994

2995

2996

2997

2998

2999

3000

3001

3002

3003

3004

3005

3006

3007

3008

3009

3010

3011

3012

3013

3014

3015

3016

3017

3018

3019

3020

3021

3022

3023

3024

3025

3026

3027

3028

3029

3030

3031

3032

3033

3034

3035

3036

3037

3038

3039

3040

3041

3042

3043

3044

3045

3046

3047

3048

3049

3050

3051

3052

3053

3054

3055

3056

3057

3058

3059

3060

3061

3062

3063

3064

3065

3066

3067

3068

3069

3070

3071

3072

3073

3074

3075

3076

3077

3078

3079

3080

3081

3082

3083

3084

3085

3086

3087

3088

3089

3090

3091

3092

3093

3094

3095

3096

3097

3098

3099

3100

3101

3102

3103

3104

3105

3106

3107

3108

3109

3110

3111

3112

3113

3114

3115

3116

3117

3118

3119

3120

3121

3122

3123

3124

3125

3126

3127

3128

3129

3130

3131

3132

3133

3134

3135

3136

3137

3138

3139

3140

3141

3142

3143

3144

3145

3146

3147

3148

3149

3150

3151

3152

3153

3154

3155

3156

3157

3158

3159

3160

3161

3162

3163

3164

3165

3166

3167

3168

3169

3170

3171

3172

3173

3174

3175

3176

3177

3178

3179

3180

3181

3182

3183

3184

3185

3186

3187

3188

3189

3190

3191

3192

3193

3194

3195

3196

3197

3198

3199

3200

3201

3202

3203

3204

3205

3206

3207

3208

3209

3210

3211

3212

3213

3214

3215

3216

3217

3218

3219

3220

3221

3222

3223

3224

3225

3226

3227

3228

3229

3230

3231

3232

3233

3234

3235

3236

3237

3238

3239

3240

3241

3242

3243

3244

3245

3246

3247

3248

3249

3250

3251

3252

3253

3254

3255

3256

3257

3258

3259

3260

3261

3262

3263

3264

3265

3266

3267

3268

3269

3270

3271

3272

3273

3274

3275

3276

3277

3278

3279

3280

3281

3282

3283

3284

3285

3286

3287

3288

3289

3290

3291

3292

3293

3294

3295

3296

3297

3298

3299

3300

3301

3302

3303

3304

3305

3306

3307

3308

3309

3310

3311

3312

3313

3314

3315

3316

3317

3318

3319

3320

3321

3322

3323

3324

3325

3326

3327

3328

3329

3330

3331

3332

3333

3334

3335

3336

3337

3338

3339

3340

3341

3342

3343

3344

3345

3346

3347

3348

3349

3350

3351

3352

3353

3354

3355

3356

3357

3358

3359

3360

3361

3362

3363

3364

3365

3366

3367

3368

3369

3370

3371

3372

3373

3374

3375

3376

3377

3378

3379

3380

3381

3382

3383

3384

3385

3386

3387

3388

3389

3390

3391

3392

3393

3394

3395

3396

3397

3398

3399

3400

3401

3402

3403

3404

3405

3406

3407

3408

3409

3410

3411

3412

3413

3414

3415

3416

3417

3418

3419

3420

3421

3422

3423

3424

3425

3426

3427

3428

3429

3430

3431

3432

3433

3434

3435

3436

3437

3438

3439

3440

3441

3442

3443

3444

3445

3446

3447

3448

3449

3450

3451

3452

3453

3454

3455

3456

3457

3458

3459

3460

3461

3462

3463

3464

3465

3466

3467

3468

3469

3470

3471

3472

3473

3474

3475

3476

3477

3478

3479

3480

3481

3482

3483

3484

3485

3486

3487

3488

3489

3490

3491

3492

3493

3494

3495

3496

3497

3498

3499

3500

3501

3502

3503

3504

3505

3506

3507

3508

3509

3510

3511

3512

3513

3514

3515

3516

3517

3518

3519

3520

3521

3522

3523

3524

3525

3526

3527

3528

3529

3530

3531

3532

3533

3534

3535

3536

3537

3538

3539

3540

3541

3542

3543

3544

3545

3546

3547

3548

3549

3550

3551

3552

3553

3554

3555

3556

3557

3558

3559

3560

3561

3562

3563

3564

3565

3566

3567

3568

3569

3570

3571

3572

3573

3574

3575

3576

3577

3578

3579

3580

3581

3582

3583

3584

3585

3586

3587

3588

3589

3590

3591

3592

3593

3594

3595

3596

3597

3598

3599

3600

3601

3602

3603

3604

3605

3606

3607

3608

3609

3610

3611

3612

3613

3614

3615

3616

3617

3618

3619

3620

3621

3622

3623

3624

3625

3626

3627

3628

3629

3630

3631

3632

3633

3634

3635

3636

3637

3638

3639

3640

3641

3642

3643

3644

3645

3646

3647

3648

3649

3650

3651

3652

3653

3654

3655

3656

3657

3658

3659

3660

3661

3662

3663

3664

3665

3666

3667

3668

3669

3670

3671

3672

3673

3674

3675

3676

3677

3678

3679

3680

3681

3682

3683

3684

3685

3686

3687

3688

3689

3690

3691

3692

3693

3694

3695

3696

3697

3698

3699

3700

3701

3702

3703

3704

3705

3706

3707

3708

3709

3710

3711

3712

3713

3714

3715

3716

3717

3718

3719

3720

3721

3722

3723

3724

3725

3726

3727

3728

3729

3730

3731

3732

3733

3734

3735

3736

3737

3738

3739

3740

3741

3742

3743

3744

3745

3746

3747

3748

3749

3750

3751

3752

3753

3754

3755

3756

3757

3758

3759

3760

3761

3762

3763

3764

3765

3766

3767

3768

3769

3770

3771

3772

3773

3774

3775

3776

3777

3778

3779

3780

3781

3782

3783

3784

3785

3786

3787

3788

3789

3790

3791

3792

3793

3794

3795

3796

3797

3798

3799

3800

3801

3802

3803

3804

3805

3806

3807

3808

3809

3810

3811

3812

3813

3814

3815

3816

3817

3818

3819

3820

3821

3822

3823

3824

3825

3826

3827

3828

3829

3830

3831

3832

3833

3834

3835

3836

3837

3838

3839

3840

3841

3842

3843

3844

3845

3846

3847

3848

3849

3850

3851

3852

3853

3854

3855

3856

3857

3858

3859

3860

3861

3862

3863

3864

3865

3866

3867

3868

3869

3870

3871

3872

3873

3874

3875

3876

3877

3878

3879

3880

3881

3882

3883

3884

3885

3886

3887

3888

3889

3890

3891

3892

3893

3894

3895

3896

3897

3898

3899

3900

3901

3902

3903

3904

3905

3906

3907

3908

3909

3910

3911

3912

3913

3914

3915

3916

3917

3918

3919

3920

3921

3922

3923

3924

3925

3926

3927

3928

3929

3930

3931

3932

3933

3934

3935

3936

3937

3938

3939

3940

3941

3942

3943

3944

3945

3946

3947

3948

3949

3950

3951

3952

3953

3954

3955

3956

3957

3958

3959

3960

3961

3962

3963

3964

3965

3966

3967

3968

3969

3970

3971

3972

3973

3974

3975

3976

3977

3978

3979

3980

3981

# This file was automatically generated by SWIG (http://www.swig.org). 

# Version 2.0.4 

# 

# Do not make changes to this file unless you know what you are doing--modify 

# the SWIG interface file instead. 

 

 

 

from sys import version_info 

if version_info >= (2,6,0): 

    def swig_import_helper(): 

        from os.path import dirname 

        import imp 

        fp = None 

        try: 

            fp, pathname, description = imp.find_module('_coordsys', [dirname(__file__)]) 

        except ImportError: 

            import _coordsys 

            return _coordsys 

        if fp is not None: 

            try: 

                _mod = imp.load_module('_coordsys', fp, pathname, description) 

            finally: 

                fp.close() 

            return _mod 

    _coordsys = swig_import_helper() 

    del swig_import_helper 

else: 

    import _coordsys 

del version_info 

try: 

    _swig_property = property 

except NameError: 

    pass # Python < 2.2 doesn't have 'property'. 

def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 

    if (name == "thisown"): return self.this.own(value) 

    if (name == "this"): 

        if type(value).__name__ == 'SwigPyObject': 

            self.__dict__[name] = value 

            return 

    method = class_type.__swig_setmethods__.get(name,None) 

    if method: return method(self,value) 

    if (not static): 

        self.__dict__[name] = value 

    else: 

        raise AttributeError("You cannot add attributes to %s" % self) 

 

def _swig_setattr(self,class_type,name,value): 

    return _swig_setattr_nondynamic(self,class_type,name,value,0) 

 

def _swig_getattr(self,class_type,name): 

    if (name == "thisown"): return self.this.own() 

    method = class_type.__swig_getmethods__.get(name,None) 

    if method: return method(self) 

    raise AttributeError(name) 

 

def _swig_repr(self): 

    try: strthis = "proxy of " + self.this.__repr__() 

    except: strthis = "" 

    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 

 

try: 

    _object = object 

    _newclass = 1 

except AttributeError: 

    class _object : pass 

    _newclass = 0 

 

 

class coordsys(_object): 

    """Proxy of C++ casac::coordsys class""" 

    __swig_setmethods__ = {} 

    __setattr__ = lambda self, name, value: _swig_setattr(self, coordsys, name, value) 

    __swig_getmethods__ = {} 

    __getattr__ = lambda self, name: _swig_getattr(self, coordsys, name) 

    __repr__ = _swig_repr 

    def __init__(self): 

        """__init__(self) -> coordsys""" 

        this = _coordsys.new_coordsys() 

        try: self.this.append(this) 

        except: self.this = this 

    __swig_destroy__ = _coordsys.delete_coordsys 

84    __del__ = lambda self : None; 

    def newcoordsys(self, *args, **kwargs): 

        """ 

        newcoordsys(self, direction = False, spectral = False, stokes = std::vector< string >(1, ""),  

            linear = 0, tabular = False) -> coordsys 

 

        Summary 

                Create a non-default coordsys tool 

 

        Description 

                 

 

        By default, this constructor makes an empty Coordsys    ool.  You can ask 

        it to include various sorts of coordinates through the arguments.  

        Except for Stokes, you don't have any control over the coordinate 

        contents (e.g.  reference value etc.) it does make for you on request.  

        But you can edit the Coordinate System after creation if you wish.  

 

        If you wish to make a Stokes coordinate, then you assign 

        {\stfaf stokes} to a string (or a vector of strings) saying 

        which Stokes you want.  \casa\ allows rather 

        a lot of potential Stokes types.   

 

        Probably most useful is some combination of the 

        basic I, Q, U, V, XX, YY, XY, YX, RR, LL, RL, and LR. 

 

        However, a more esoteric choice is also possible: 

        RX, RY, LX, LY, XR, XL, YR, YL (these are mixed 

        linear and circular),  PP, PQ, QP, QQ (general quasi-orthogonal correlation products) 

        RCircular, LCircular, Linear  (single dish polarization types). 

 

        You can also specify some polarization `Stokes' types: 

        Ptotal (Polarized intensity ($(Q^2+U^2+V^2)^{1/2}$), 

        Plinear (Linearly Polarized intensity ($(Q^2+U^2)^{1/2}$), 

        PFtotal (Polarization Fraction (Ptotal/I)),  

        PFlinear  (Linear Polarization Fraction (Plinear/I)), and 

        Pangle  (Linear Polarization Angle ($0.5~arctan(U/Q)$ in radians)). 

 

        Probably you will find the more unusual types aren't fully 

        supported throughout the system. 

 

        You can make a LinearCoordinate with as many uncoupled axes as you like. 

        Thus, {\stfaf linear=2} makes one LinearCoordinate with 2 axes (think 

        of it like a DirectionCoordinate which also has 2 axes [but coupled in 

        this case], a longitude and a latitude). 

 

        If you make a TabularCoordinate, it is linear to start with. 

        You can change it to a non-linear one by providing 

        a list of pixel and world values to function 

        settabular. 

 

 

 

        Input Parameters: 

                direction        Make a direction coordinate ? false  

                spectral         Make a spectral coordinate ? false  

                stokes           Make a Stokes coordinate with these Stokes I Q U V XX YY XY YX RR LL RL LR  

                linear           Make a linear coordinate with this many axes 0  

                tabular          Make a tabular coordinate false  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     newcoordsys Ex 1       ----' 

        cs1=cs.newcoordsys() 

        print 'ncoordinates =',cs1.ncoordinates() 

        #0 

        cs1.done() 

        #True 

        cs2=cs.newcoordsys(direction=T,stokes=['I','V']) 

        print 'ncoordinates =',cs2.ncoordinates() 

        #2L 

        print cs2.coordinatetype() 

        #['Direction', 'Stokes'] 

        cs2.summary() 

        # 

        ''' 

 

        The second Coordinate System contains a direction coordinate 

        and a Stokes coordinate.   This means that there are three `axes' 

        associated with the 2 coordinates. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_newcoordsys(self, *args, **kwargs) 

 

    def addcoordinate(self, *args, **kwargs): 

        """ 

        addcoordinate(self, direction = False, spectral = False, stokes = std::vector< string >(1, ""),  

            linear = 0, tabular = False) -> bool 

 

        Summary 

                Add default coordinates.  (For assay testing only.) 

 

        Description 

                 

        Add default coordinates of the specified types.  This function allows 

        multiple coordinates of the same type which are not well supported. 

        Use only for assay tests. 

 

 

        Input Parameters: 

                direction        Add a direction coordinate ? false  

                spectral         Add a spectral coordinate ? false  

                stokes           Add a Stokes coordinate with these Stokes I Q U V XX YY XY YX RR LL RL LR  

                linear           Add a linear coordinate with this many axes 0  

                tabular          Add a tabular coordinate false  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     addcoordinate Ex 1     ----' 

        mycs=cs.newcoordsys() 

        mycs.addcoordinate(direction=T) 

        mycs.done() 

        # 

        ''' 

 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_addcoordinate(self, *args, **kwargs) 

 

    def axesmap(self, toworld = True): 

        """ 

        axesmap(self, toworld = True) -> std::vector<(int)> 

 

        Summary 

                Find mapping between world and pixel axes 

 

        Description 

                 

 

        This function returns a vector describing the mapping from pixel to 

        world or world to pixel axes.  It is not for general user use. 

 

        See the \htmlref{discussion}{COORDSYS:PWAXES} about pixel and world axis 

        ordering.  Generally they will be in the same order. 

 

 

 

        Input Parameters: 

                toworld          Map from pixel to world ? true  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     axesmap Ex 1   ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        csys.axesmap(T); 

        #[1L, 2L, 3L] 

        csys.axesmap(F); 

        #[1L, 2L, 3L] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_axesmap(self, toworld) 

 

    def axiscoordinatetypes(self, world = True): 

        """ 

        axiscoordinatetypes(self, world = True) -> std::vector<(std::string)> 

 

        Summary 

                Return types of coordinates for each axis 

 

        Description 

                 

 

        This function  returns a vector string  

        giving the coordinate type for each axis (world or pixel) 

        in the Coordinate System. 

 

        See the \htmlref{discussion}{COORDSYS:PWAXES} about pixel and world axis 

        ordering. 

 

 

 

        Input Parameters: 

                world            World or pixel axes ? true  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     axiscoordinatetypes Ex 1       ----' 

        csys=cs.newcoordsys(direction=T,spectral=T) 

        csys.axiscoordinatetypes() 

        #['Direction', 'Direction', 'Spectral'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_axiscoordinatetypes(self, world) 

 

    def conversiontype(self, *args, **kwargs): 

        """ 

        conversiontype(self, type = string("direction")) -> string 

 

        Summary 

                Get extra reference conversion layer 

 

        Description 

                 

 

        Some coordinates contain a reference code.  Examples of reference codes 

        are B1950 and J2000 for direction coordinates, or LSRK and BARY for 

        spectral coordinates.  When you do conversions between pixel and world 

        coordinate, the coordinates are in the reference frame corresponding to 

        these codes.    

 

        Function  setconversiontype 

        allows you to specify a different reference frame 

        which is used when converting between world and pixel coordinate. 

 

        This function allows you to recover those conversion types.  If no extra 

        conversion layer has been set, you get back the native reference types. 

 

 

 

        Input Parameters: 

                type             Coordinate type, direction, spectral direction  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     conversiontype Ex 1    ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.conversiontype (type='direction'), ' ', csys.conversiontype (type='spectral') 

        #J2000   LSRK 

        csys.setconversiontype (direction='GALACTIC', spectral='BARY') 

        print csys.conversiontype (type='direction'), ' ', csys.conversiontype (type='spectral') 

        #GALACTIC   BARY 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_conversiontype(self, *args, **kwargs) 

 

    def convert(self, *args, **kwargs): 

        """ 

        convert(self, coordin, absin = initialize_vector(1, (bool)true),  

            dopplerin = string("radio"), unitsin = std::vector< string >(1, ""),  

            absout = initialize_vector(1, (bool)true),  

            dopplerout = string("radio"),  

            unitsout = std::vector< string >(1, ""),  

            shape = initialize_vector(1, (int)-1)) -> std::vector<(double)> 

 

        Summary 

                Convert a numeric mixed coordinate  

 

        Description 

                 

 

        This function converts between mixed pixel/world/abs/rel numeric 

        coordinates.  The input and output coordinates are specified via a  

        numeric vector giving coordinate values, a string vector giving units, a 

        boolean vector specifying whether the coordinate is absolute or relative 

        (to the reference pixel) and doppler strings specifying the doppler 

        convention for velocities. 

 

        The units string may include {\cf pix} for pixel coordinates and 

        velocity units (i.e. any unit consistent with {\cf m/s}). 

 

        The allowed doppler strings and definition are described 

        in function summary. 

 

        The {\stfaf shape} argument is optional.  If your Coordinate 

        System is from an image, then assign the image shape to this 

        argument.  It is used only when making mixed (pixel/world) conversions 

        for Direction Coordinates to resolve ambiguity. 

 

        The example clarifies the use of this function. 

 

 

 

        Input Parameters: 

                coordin          Input coordinate, as a numeric vector  

                absin            Are input coordinate elements absolute ? true  

                dopplerin        Input doppler type for velocities radio  

                unitsin          Input units, string vector Native  

                absout           Are output coordinate elements absolute ? true  

                dopplerout       Output doppler type for velocities radio  

                unitsout         Output units Native  

                shape            Image shape, integer vector -1  

                 

        Example: 

                 

        In this example we convert from a vector of absolute pixels 

        to a mixture of pixel/world and abs/rel. 

 

        ''' 

        # 

        print ' ----     convert Ex 1   ----' 

        csys=cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        cout=csys.convert(coordin=[10,20,30],absin=[T,T,T], 

                          unitsin=['pix','pix','pix'], 

                          absout=[T,F,T], dopplerout='optical', 

                          unitsout=['pix','arcsec','km/s']) 

        print cout 

        #[10.0, 1140.0058038878046, 1139.1354056919731] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_convert(self, *args, **kwargs) 

 

    def convertdirection(self, *args, **kwargs): 

        """ 

        convertdirection(self, frame) -> record 

 

        Summary 

                Convert the direction coordinate to the specified frame by rotating as necessary about the reference pixel so the axes line up with the cardinal directions. 

 

        Description 

                 

                Convert the direction coordinate in the coordinate system to the specified frame by 

                rotating about the reference pixel so that the resulting coordinate axes are parallel 

                to the cardinal directions. The resulting coordinate will not have a conversion layer, 

                even if the input direction coordinate does. A conversion layer can be set after by 

                running cs.setconversiontype(). Be aware that if you attach the resulting coordinate 

                system to an image whose pixels have not been rotated around the reference pixel in 

                the same manner, you will likely get an image for which the pixels do not match 

                up to world coordinate values. This method should only be used by experienced users who 

                know what they are doing. It was written originally to facilitate rotating the 

                direction coordinate since the implementation of imregrid requires this in certain 

                circumstances. The conversion is done in place; a new coordinate system tool is not 

                created. The returned record represents an angular quantity through which the old 

                direction coordinate was rotated to create the new coordinate. 

             

 

        Input Parameters: 

                frame            Reference frame to convert to.  

                 

        Example: 

                 

                 

             

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_convertdirection(self, *args, **kwargs) 

 

    def convertmany(self, *args, **kwargs): 

        """ 

        convertmany(self, coordin, absin = initialize_vector(1, (bool)true),  

            dopplerin = string("radio"), unitsin = std::vector< string >(1, ""),  

            absout = initialize_vector(1, (bool)true),  

            dopplerout = string("radio"),  

            unitsout = std::vector< string >(1, ""),  

            shape = initialize_vector(1, (int)-1)) -> variant 

 

        Summary 

                Convert many numeric mixed coordinates 

 

        Description 

                 

 

        This function converts between many mixed pixel/world/abs/rel numeric 

        coordinates.   See function convert 

        for more information. 

 

        The only diffference with that function is that you 

        provide a matrix holding many coordinates to convert 

        and a matrix of many converted coordinates is returned. 

 

 

 

        Input Parameters: 

                coordin          Input coordinate, numeric matrix  

                absin            Are input coordinate elements absolute ? true  

                dopplerin        Input doppler type for velocities radio  

                unitsin          Input units, string vector Native  

                absout           Are output coordinate elements absolute ? true  

                dopplerout       Output doppler type for velocities radio  

                unitsout         Output units Native  

                shape            Image shape, integer array -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     convertmany Ex 1       ----' 

        csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        # absolute pixel coordinates; 10 conversions each of length 3; spectral 

        cin=[(15, 15, 15, 15, 15, 15, 15, 15, 15, 15),  # pixel runs from 1 to 10 

             (20, 20, 20, 20, 20, 20, 20, 20, 20, 20), 

             ( 1,  2,  3,  4,  5,  6,  7,  8,  9, 10)] 

        cout = csys.convertmany (coordin=cin,      

                                 absin=[T,T,T], 

                                 unitsin=['pix','pix','pix'], 

                                 absout=[T,F,T], 

                                 dopplerout='optical', 

                                 unitsout=['pix','deg','km/s']); 

        print cout 

        #[(15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0, 15.0), 

        # (0.31666827885771637, 0.31666827885771637, 0.31666827885771637, 

        #  0.31666827885771637, 0.31666827885771637, 0.31666827885771637, 

        #  0.31666827885771637, 0.31666827885771637, 0.31666827885771637, 

        #  0.31666827885771637), 

        # (1145.3029083129913, 1145.0902316004676, 1144.8775551885467, 

        #  1144.6648790772279, 1144.4522032665102, 1144.2395277563601, 

        #  1144.0268525468437, 1143.8141776379266, 1143.6015030296085, 

        #  1143.3888287218554)] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_convertmany(self, *args, **kwargs) 

 

    def coordinatetype(self, *args, **kwargs): 

        """ 

        coordinatetype(self, which = -1) -> std::vector<(std::string)> 

 

        Summary 

                Return type of specified coordinate 

 

        Description 

                 

 

        This function  returns a string describing 

        the type of the specified coordinate.  If {\stfaf which=unset} the types 

        for all coordinates are returned. 

 

        Possible output values are 'Direction', 'Spectral', 'Stokes', 'Linear', and 

        'Tabular' 

 

 

 

        Input Parameters: 

                which            Which coordinate ? (0-rel) -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     coordinatetype Ex 1    ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        csys.coordinatetype(0) 

        #'Direction' 

        cs.coordinatetype() 

        #['Direction', 'Spectral'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_coordinatetype(self, *args, **kwargs) 

 

    def copy(self): 

        """ 

        copy(self) -> coordsys 

 

        Summary 

                Copy this Coordsys tool 

 

        Description 

                 

 

 

 

        This function returns a copy, not a reference, of the Coordsys  ool. 

        It is your responsibility to call the {\stff done} function 

        on the new      ool. 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     copy Ex 1      ----' 

        cs1 = cs.newcoordsys(direction=T, spectral=T) 

        cs2 = cs1         # Reference 

        print cs1, cs2 

        cs1.summary() 

        cs2.summary() 

        cs1.done()        # done invokes default coordsys tool 

        cs1.summary() 

        cs2.summary()     # cs2 gets doned when cs1 does 

        cs1 = cs.newcoordsys(direction=T, spectral=T) 

        cs2 = cs1.copy()  # Copy 

        cs1.done() 

        cs1.summary()     # cs1 is default coordsys tool 

        cs2.summary()     # cs2 is still viable 

        cs2.done() 

        cs2.summary()     # Now it's done (done just invokes default constructor) 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_copy(self) 

 

    def done(self): 

        """ 

        done(self) -> bool 

 

        Summary 

                Destroy this Coordsys tool, restore default tool 

 

        Description 

                 

 

        If you no longer need to use a Coordsys         ool calling this function 

        will free up its resources and restore the default coordsys tool.  

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     done Ex 1      ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        csys.done() 

        print csys.torecord()            # default tool 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_done(self) 

 

    def epoch(self): 

        """ 

        epoch(self) -> record 

 

        Summary 

                Return the epoch 

 

        Description 

                 

 

        This function  returns the epoch of the observation as a 

        Measure.   

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     epoch Ex 1     ----' 

        csys = cs.newcoordsys() 

        ep = csys.epoch() 

        print ep 

        #{'type': 'epoch', 'm0': {'value': 54151.96481085648, 'unit': 'd'}, 'refer': 'UTC'} 

        time = me.getvalue(ep)           # Extract time with measures 

        print time 

        #{'m0': {'value': 54151.96481085648, 'unit': 'd'}} 

        qa.time(time)                    # Format with quanta 

        #'23:09:20' 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_epoch(self) 

 

    def findaxis(self, world = True, axis = 0): 

        """ 

        findaxis(self, world = True, axis = 0) -> record 

 

        Summary 

                Find specified axis in coordinate system 

 

        Description 

                 

 

        This function  finds the specified axis in 

        the Coordinate System. If the axis does not exist, it throws an exception. 

 

 

 

        Input Parameters: 

                world            is axis a world or pixel axis ? true  

                axis             Axis in coordinate system 0  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     findaxis Ex 1  ----' 

        csys=cs.newcoordsys(direction=T, linear=2)          # RA/DEC/Lin1/Lin2 

        rtn=csys.findaxis(T,1)                              # DEC 

        rtn 

        #{'axisincoordinate': 1L, 'coordinate': 0L} 

        rtn = csys.findaxis(T,2)                            # Lin1 

        rtn 

        #{'axisincoordinate': 0L, 'coordinate': 1L} 

        # 

        ''' 

 

 

        In these examples, the Coordinate System has 2 coordinates and 4 axes 

        (0-rel, both world and pixel the same).  The first example finds the 

        DEC axis (coordinate system axis 1) to be the second axis of the 

        Direction Coordinate (coordinate 0). The second example finds the 

        first linear axis (coordinate system axis 2) to be the first axis of 

        the Linear Coordinate (coordinate 1). 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_findaxis(self, world, axis) 

 

    def findaxisbyname(self, *args, **kwargs): 

        """ 

        findaxisbyname(self, axisname = string(""), allowfriendlyname = True) -> int 

 

        Summary 

                Find specified axis in coordinate system. 

 

        Description 

                 

                Find the world axis based on its name. Matching is not case sensitive and minimal match is supported, eg 'dec' will match 'Declination'. 

                In addition, if allowfriendlyname is True, other common terms will match the expected axis. Currently supported are: 

                'spectral' matches frequency type axes, eg 'Frequency' or 'Velocity', 

                'ra' matches 'Right Ascension'. These names must be spelled out completely; eg 'spectral' rather than simply 'spec'. 

                The first matching axis (zero-based) number is returned. If no axis can be matched, an exception is thrown. 

             

 

        Input Parameters: 

                axisname         Name of axis to find. Minimal match supported  

                allowfriendlyname        Support friendly naming. Eg 'spectral' will match 'frequency' or 'velocity', 'ra' will match 'right ascension' true  

                 

        Example: 

                 

                # Find the declination axis 

                ia.open('myimage') 

                csys = ia.coordsys() 

                ia.done() 

                try: 

                    dec_axis_number = csys.findaxisbyname('dec', False) 

                except Exception 

                    print 'Declination axis not found 

                 

                # find the spectral axis 

                try: 

                    spec_axis_number = csys.findaxisbyname('spectral', True) 

                except Exception: 

                    print 'Spectral axis could not be found. 

                 

              

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_findaxisbyname(self, *args, **kwargs) 

 

    def findcoordinate(self, *args, **kwargs): 

        """ 

        findcoordinate(self, type = string("direction"), which = 0) -> record 

 

        Summary 

                Find axes of specified coordinate 

 

        Description 

                 

 

        This function finds the axes in the 

        Coordinate System for the specified coordinate (minimum match is active 

        for argument {\stfaf type}).  By default it finds the first coordinate, 

        but if there is more than one (can happen for linear coordinates), you 

        can specify which.  It returns a dictionary with 'return', 'pixel', and 

        'world' as keys. The associated value of 'return' is a boolean indicating if 

        the specified coordinate was found. The values of 'pixel' and 'world' are 

        arrays indicating the indices of the associated pixel and world axes, respectively, 

        of the specified coordinate. If the coordinate does not exist, these arrays 

        will be empty. 

 

        See also the function axesmap 

        which returns the mapping between pixel and world axes. 

 

 

 

        Input Parameters: 

                type             Type of coordinate to find: direction, stokes, spectral, linear, or tabular direction  

                which            Which coordinate if more than one 0  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     findcoordinate Ex 1    ----' 

        csys=cs.newcoordsys(direction=T) 

        rtn=cs.findcoordinate('direction') 

        print rtn 

        #{'world': [0L, 1L], 'pixel': [0L, 1L]} 

        print 'pixel, world axes =', rtn['pixel'], rtn['world'] 

        #pixel, world axes = [0 1] [0 1] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_findcoordinate(self, *args, **kwargs) 

 

    def frequencytofrequency(self, *args, **kwargs): 

        """ 

        frequencytofrequency(self, value, frequnit = string(""), velocity = initialize_variant("")) -> std::vector<(double)> 

 

        Summary 

                Apply relativistic Doppler shift to a list of frequencies 

 

        Description 

                 

        This function converts frequencies to frequencies by applying a  

        relativistic Doppler shift:  

        fout = fin * sqrt((1.-v/c)/(1.+v/c)) .  

 

        The input frequencies are specified via a vector of numeric values and 

        a specified unit ({\stfaf frequnit}).  If you don't give a frequency 

        unit, it is assumed that the units are those given by function coordsys units() for 

        the spectral coordinate. 

 

        This function does not make any frame conversions (e.g.  LSR to BARY). 

 

        This function fails if there is no spectral coordinate 

        in the Coordinate System. See also function 

        frequencytovelocity. 

 

 

        Input Parameters: 

                value            Frequencies to convert  

                frequnit         Unit of input frequencies. Default is unit of the spectral coordinate.  

                velocity         Velocity  

                 

        Example: 

                 

        ''' 

          ia.open('M100line.image') 

          mycs = ia.coordsys() 

          ia.close() 

 

          mycs.frequencytofrequency(value=[115271201800.0], frequnit='Hz', velocity='1000km/s') 

        results in 

          array([114887337607.0]) 

 

        Let's see if this is correct 

          print 115271201800.0*sqrt((1.-1000000./299792458.0)/(1.+1000000./299792458.0)) 

        Result: 1.14887337607e+11 

        ''' 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_frequencytofrequency(self, *args, **kwargs) 

 

    def frequencytovelocity(self, *args, **kwargs): 

        """ 

        frequencytovelocity(self, value, frequnit = string(""), doppler = string("radio"),  

            velunit = string("km/s")) -> std::vector<(double)> 

 

        Summary 

                Convert frequency to velocity 

 

        Description 

                 

 

        This function  converts frequencies to 

        velocities.   

 

        The input frequencies are specified via a vector of numeric values and 

        a specified unit ({\stfaf frequnit}).  If you don't give a frequency 

        unit, it is assumed that the units are those given by function coordsys units() for 

        the spectral coordinate. 

 

        This function does not make any frame conversions (e.g. LSR to BARY) 

        but you can specifiy the velocity doppler definition via the {\stfaf 

        doppler} argument (see image summary() for 

        possible values). 

 

        The velocities are returned in a vector for which you specify the 

        units ({\stfaf velunit} - default is km/s). 

 

        This function will return a fail if there is no spectral coordinate 

        in the Coordinate System. See also function 

        velocitytofrequency. 

 

 

 

        Input Parameters: 

                value            Frequency to convert  

                frequnit         Unit of input frequencies. Default is unit of the spectral coordinate.  

                doppler          Velocity doppler definition radio  

                velunit          Unit of output velocities km/s  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     frequencytovelocity Ex 1       ----' 

        im = ia.fromshape(shape=[10,10,10]) 

        csys = ia.coordsys() 

        rtn = csys.findcoordinate('spectral')   # Find spectral axis 

        pa=rtn['pixel'] 

        wa=rtn['world'] 

        pixel = csys.referencepixel();          # Use reference pixel for non-spectral 

        nFreq = ia.shape()[pa];                 # Length of spectral axis 

        freq = []; 

        for i in range(nFreq): 

          pixel[pa] = i            # Assign value for spectral axis of pixel coordinate 

          w = csys.toworld(value=pixel, format='n')   # Convert pixel to world 

          freq.append(w['numeric'][wa]);              # Fish out frequency 

        print 'freq=', freq 

        #freq= [1414995000.0, 1414996000.0, 1414997000.0, 1414998000.0, 

        # 1414999000.0, 1415000000.0, 1415001000.0, 1415002000.0, 1415003000.0, 1415004000.0] 

        vel = csys.frequencytovelocity(value=freq, doppler='optical', velunit='km/s') 

        print 'vel=', vel 

        #vel= [1146.3662963847394, 1146.153618169159, 1145.9409402542183, 1145.7282626398826, 

        # 1145.5155853261515, 1145.3029083129911, 1145.0902316004676, 1144.8775551885467, 

        # 1144.6648790772279, 1144.4522032665104] 

        # 

        ''' 

 

 

        In this example, we find the optical velocity in km/s of every pixel 

        along the spectral axis of our image.  First we  obtain the Coordinate 

        System from the image.  Then we find which axis of the Coordinate System 

        (image) pertain to the spectral coordinate.  Then we loop over each 

        pixel of the spectral axis, and convert a pixel coordinate (one for each 

        axis of the image) to world.  We obtain the value for the spectral axis 

        from that world vector, and add it to the vector of frequencies.  Then 

        we convert that vector of frequencies to velocity. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_frequencytovelocity(self, *args, **kwargs) 

 

    def fromrecord(self, *args, **kwargs): 

        """ 

        fromrecord(self, record) -> bool 

 

        Summary 

                Fill Coordinate System from a record 

 

        Description 

                 

 

        You can convert a Coordinate System to a record 

        (torecord).  This function 

        (fromrecord) allows you to set the contents of an existing Coordinate 

        System from such a record.   In doing so, you overwrite its current 

        contents. 

 

 

 

 

 

        Input Parameters: 

                record           Record containing Coordinate System  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     fromrecord Ex 1        ----' 

        csys = cs.newcoordsys(direction=T, stokes='I Q') 

        print csys.ncoordinates() 

        #2 

        r = csys.torecord() 

        cs2 = cs.newcoordsys() 

        print cs2.ncoordinates() 

        #0 

        cs2.fromrecord(r) 

        print cs2.ncoordinates() 

        #2 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_fromrecord(self, *args, **kwargs) 

 

    def increment(self, *args, **kwargs): 

        """ 

        increment(self, format = string("n"), type = string("")) -> record 

 

        Summary 

                Recover the increments 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function  returns the increment (in 

        world axis order). You can recover  the increments either for all 

        coordinates (leave {\stfaf type} unset) or for a specific coordinate 

        type (mimumum match of the allowed types will do).  If you ask for a 

        non-existent coordinate an exception is generated. 

 

        See the \htmlref{discussion}{COORDSYS:FORMATTING} regarding the 

        formatting possibilities available via argument {\stfaf format}. 

 

        You can set the increment with function 

        setincrement.  

 

 

 

        Input Parameters: 

                format           Format string from combination of 'n', 'q', 's', 'm' n  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     increment Ex 1         ----' 

        csys=cs.newcoordsys(direction=T,spectral=T) 

        print csys.increment(format='q') 

        #{'quantity': {'*1': {'unit': ''', 'value': -1.0}, 

        #              '*2': {'unit': ''', 'value': 1.0}, 

        #              '*3': {'unit': 'Hz', 'value': 1000.0}}} 

        print csys.increment(format='n') 

        #{'numeric': [-1.0, 1.0, 1000.0]} 

        print csys.increment(format='n', type='spectral') 

        #{'numeric': [1000.0]} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_increment(self, *args, **kwargs) 

 

    def lineartransform(self, *args, **kwargs): 

        """ 

        lineartransform(self, type) -> variant 

 

        Summary 

                Recover the linear transform matrix 

 

        Description 

                 

 

        Recover the linear transform component for the specified coordinate type. 

 

        You can set the linear transform with function 

        setlineartransform.  

 

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     lineartransform Ex 1   ----' 

        csys=cs.newcoordsys(direction=T,linear=3) 

        csys.lineartransform('dir')                             # 2 x 2 

        # [(1.0, 0.0), (0.0, 1.0)] 

        csys.lineartransform('lin')                             # 3 x 3 

        # [(1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_lineartransform(self, *args, **kwargs) 

 

    def names(self, *args, **kwargs): 

        """ 

        names(self, type = string("")) -> std::vector<(std::string)> 

 

        Summary 

                Recover the names for each axis 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a name (they don't 

        mean anything fundamental).  This function returns those names in 

        world axis order. 

 

        You can recover the names either for all coordinates (leave {\stfaf 

        type} unset) or for a specific coordinate type (mimumum match of the 

        allowed types will do).  If you ask for a non-existent coordinate an 

        exception is generated. 

 

        You can set the names with function 

        setnames.  

 

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     names Ex 1     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        n = csys.names() 

        print n[0] 

        #Right Ascension  

        print n[1] 

        #Declination  

        print n[2] 

        #Frequency  

        print cs.names('spec') 

        #Frequency 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_names(self, *args, **kwargs) 

 

    def naxes(self, world = True): 

        """ 

        naxes(self, world = True) -> int 

 

        Summary 

                Recover the number of axes 

 

        Description 

                 

 

        Find the number of axes  in the Coordinate System. 

 

        You may find the number of world or pixel axes; these are generally the 

        same and general users can ignore the distinction.  See the 

        \htmlref{discussion}{COORDSYS:PWAXES} about pixel and world axis 

        ordering. 

 

 

 

        Input Parameters: 

                world            Find number of world or pixel axes ? true  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     naxes Ex 1     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        n = csys.naxes(T) 

        print n 

        #3                          # 2 direction axes, 1 spectral 

        n = csys.naxes(F) 

        print n 

        #3 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_naxes(self, world) 

 

    def ncoordinates(self): 

        """ 

        ncoordinates(self) -> int 

 

        Summary 

                Recover the number of coordinates in the Coordinate System 

 

        Description 

                 

 

        This function  recovers the number of 

        coordinates in the Coordinate System. 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     ncoordinates Ex 1      ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.ncoordinates() 

        #2 

        cs2 = cs.newcoordsys(linear=4) 

        print cs2.ncoordinates() 

        #1 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_ncoordinates(self) 

 

    def observer(self): 

        """ 

        observer(self) -> string 

 

        Summary 

                Return the name of the observer 

 

        Description 

                 

 

        This function returns the name of the observer. 

        You can set it with the function setobserver. 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     observer Ex 1  ----' 

        csys = cs.newcoordsys() 

        print csys.observer() 

        #Karl Jansky 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_observer(self) 

 

    def projection(self, *args, **kwargs): 

        """ 

        projection(self, type = string("")) -> record 

 

        Summary 

                Recover the direction coordinate projection 

 

        Description 

                 

 

        If the Coordinate System contains a direction coordinate, this function 

         can be used to recover information about the 

        projection.  For discussion about celestial coordinate systems, 

        including projections, see the papers by Mark Calabretta and Eric 

        Greisen. The initial draft  from 1996 (implemented in 

        \casa.  Background information can be 

        found 

        \htmladdnormallink{here}{http://www.atnf.csiro.au/people/mark.calabretta/WCS}. 

 

        What this function returns depends upon the value 

        you assign to {\stfaf type}. 

 

        egin{itemize} 

 

        \item {\stfaf type=unset}.  In this case (the default), the actual 

        projection type and projection parameters are returned in a 

        record with fields {\cf type} and {\cf parameters}, respectively. 

 

        \item {\stfaf type='all'}.  In this case, a vector of strings 

        containing all of the possible projection codes is returned. 

 

        \item {\stfaf type=code}.  If you specify a valid 

        projection type code (see list by setting {\stfaf type='all'}) 

        then what is returned is the number of parameters required 

        to describe that projection (useful in function 

        setprojection). 

 

        nd{itemize} 

 

        You can change the projection with 

        setprojection.  

 

        If the Coordinate System does not contain a direction coordinate, 

        an exception is generated. 

 

 

 

        Input Parameters: 

                type             Type of projection. Defaults to current projection.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     projection Ex 1        ----' 

        csys = cs.newcoordsys(direction=T) 

        print csys.projection() 

        #{'type': 'SIN', 'parameters': [0.0, 0.0]} 

        print csys.projection('all') 

        #{'all': True, 'types': ['AZP', 'TAN', 'SIN', 'STG', 'ARC', 'ZPN', 'ZEA', 

        # 'AIR', 'CYP', 'CAR', 'MER', 'CEA', 'COP', 'COD', 'COE', 'COO', 'BON', 

        # 'PCO', 'SFL', 'PAR', 'AIT', 'MOL', 'CSC', 'QSC', 'TSC']} 

        print csys.projection('ZPN') 

        #{'nparameters': 100} 

        # 

        ''' 

 

        We first recover the projection type and parameters from 

        the direction coordinate.  Then we find the list of all 

        possible projection types.  FInally, we recover the number of  

        parameters required to describe the 'ZPN' projection. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_projection(self, *args, **kwargs) 

 

    def referencecode(self, *args, **kwargs): 

        """ 

        referencecode(self, type = string(""), list = False) -> std::vector<(std::string)> 

 

        Summary 

                Return specified reference code 

 

        Description 

                 

 

        This function  returns the reference code 

        for all, or the specified coordinate type.    Examples of the reference 

        code are B1950 and J2000 for direction coordinates, or LSRK and BARY for 

        spectral coordinates. 

 

        If {\stfaf type} is left unset, then a vector of strings is returned, 

        one code for each coordinate type in the Coordinate System. 

 

        If you specify {\stfaf type} then select from 

        'direction', 'spectral', 'stokes', and 'linear' 

        (the first two letters will do).  However, only the first two 

        coordinate types will return a non-empty string. 

        If the Coordinate System does not contain a coordinate of 

        the type you specify, an exception is generated. 

 

        The argument {\stfaf list} is ignored unless you specify a specific {\stfaf type}.  

        If {\stfaf list=T}, then this function returns the list of all possible 

        reference  codes for the specified coordinate type.  Otherwise, it just 

        returns the actual code current set in the Coordinate System.     

 

        The list of all possible types is returned as a record  (it is 

        actually generated by the  

        listcodes function in the 

        measures system). This record has two 

        fields.  These are called 'normal'  

        (containing all normal codes) and 'extra' (maybe empty, with all extra 

        codes like planets).  

 

        You can set the reference code with 

        setreferencecode.  

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                list             List all possibilities? false  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     referencecode Ex 1     ----' 

        csys = cs.newcoordsys(direction=T) 

        clist = csys.referencecode('dir', T) 

        print clist 

        #['J2000', 'JMEAN', 'JTRUE', 'APP', 'B1950', 'BMEAN', 'BTRUE', 

        # 'GALACTIC', 'HADEC', 'AZEL', 'AZELSW', 'AZELNE', 'AZELGEO', 

        # 'AZELSWGEO', 'AZELNEGEO', 'JNAT', 'ECLIPTIC', 'MECLIPTIC', 

        # 'TECLIPTIC', 'SUPERGAL', 'ITRF', 'TOPO', 'ICRS', 

        # 'MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', 'URANUS', 

        # 'NEPTUNE', 'PLUTO', 'SUN', 'MOON', 'COMET'] 

        print csys.referencecode('dir') 

        #J2000 

        # 

        ''' 

 

 

        In this example we first get the list of all possible reference codes 

        ofor a direction coordinate. Then we 

        get the actual reference code for the direction coordinate in our 

        Coordinate System. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_referencecode(self, *args, **kwargs) 

 

    def referencepixel(self, *args, **kwargs): 

        """ 

        referencepixel(self, type = string("")) -> record 

 

        Summary 

                Recover the reference pixel 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function  returns the reference pixel 

        (in pixel axis order). You can recover  the reference pixel either for 

        all coordinates (leave {\stfaf type} unset) or for a specific coordinate 

        type (mimumum match of the allowed types will do).  If you ask for a 

        non-existent coordinate an exception is generated. 

 

        You can set the reference pixel with function 

        setreferencepixel.  

 

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     referencepixel Ex 1    ----' 

        csys = cs.newcoordsys(spectral=T, linear=2) 

        csys.setreferencepixel([1.0, 2.0, 3.0]) 

        print csys.referencepixel() 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([ 1.,  2.,  3.])} 

        print csys.referencepixel('lin') 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([ 2.,  3.])} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_referencepixel(self, *args, **kwargs) 

 

    def referencevalue(self, *args, **kwargs): 

        """ 

        referencevalue(self, format = string("n"), type = string("")) -> record 

 

        Summary 

                Recover the reference value 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function  returns the reference value 

        (in world axis order). You can recover  the reference value either for all 

        coordinates (leave {\stfaf type} unset) or for a specific coordinate 

        type (mimumum match of the allowed types will do).  If you ask for a 

        non-existent coordinate an exception is generated. 

 

        See the \htmlref{discussion}{COORDSYS:FORMATTING} regarding the 

        formatting possibilities available via argument {\stfaf format}. 

 

        You can set the reference value with function 

        setreferencevalue.  

 

 

 

        Input Parameters: 

                format           Format string. Combination of 'n', 'q', 's', 'm' n  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     referencevalue Ex 1    ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.referencevalue(format='q') 

        #{'ar_type': 'absolute', 

        # 'pw_type': 'world', 

        # 'quantity': {'*1': {'unit': ''', 'value': 0.0}, 

        #              '*2': {'unit': ''', 'value': 0.0}, 

        #              '*3': {'unit': 'Hz', 'value': 1415000000.0}}} 

        print csys.referencevalue(format='n') 

        #{'ar_type': 'absolute', 

        # 'numeric': array([  0.00000000e+00,   0.00000000e+00,   1.41500000e+09]), 

        # 'pw_type': 'world'} 

        print csys.referencevalue(format='n', type='spec') 

        #{'ar_type': 'absolute', 

        # 'numeric': array([  1.41500000e+09]), 

        # 'pw_type': 'world'} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_referencevalue(self, *args, **kwargs) 

 

    def reorder(self, *args, **kwargs): 

        """ 

        reorder(self, order) -> bool 

 

        Summary 

                Reorder the coordinates 

 

        Description 

                 

 

        This function reorders the coordinates in the Coordinate System. 

        You specify the new order of the coordinates in terms of their old 

        order. 

 

 

 

        Input Parameters: 

                order            New coordinate order  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     reorder Ex 1   ----' 

        csys = cs.newcoordsys(direction=T, spectral=T, linear=2) 

        print csys.coordinatetype() 

        #['Direction', 'Spectral', 'Linear'] 

        csys.reorder([1,2,0]); 

        print csys.coordinatetype() 

        #['Spectral', 'Linear', 'Direction'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_reorder(self, *args, **kwargs) 

 

    def transpose(self, *args, **kwargs): 

        """ 

        transpose(self, order) -> bool 

 

        Summary 

                Transpose the axes. 

 

        Description 

                 

 

        This method transposes the axes (both world and pixel) in the coordinate system. 

        You specify the new order of the axes in terms of their old 

        order, so eg order=[1,0,3,2] means reorder the axes so that the zeroth 

        axis becomes the first axis, the first axis becomes the zeroth axis, 

        the second axis becomes the third axis, and the third axis becomes the 

        second axis. 

 

 

 

        Input Parameters: 

                order            New axis order  

                 

        Example: 

                 

 

        csys = cstool() 

 

        # Create a coordinate system with axes, RA, Dec, Stokes, and Frequency 

        csys.newcoordsys(direction=T, spectral=T, stokes=['I','Q']) 

 

        # transpose the axes so that the order is RA, Dec, Frequency, and Stokes 

        csys.transpose(order=[0, 1, 3, 2]) 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_transpose(self, *args, **kwargs) 

 

    def replace(self, *args, **kwargs): 

        """ 

        replace(self, csys, whichin, whichout) -> bool 

 

        Summary 

                Replace a coordinate 

 

        Description 

                 

 

        This function replaces one coordinate in the current Coordinate System by 

        one coordinate in the given Coordinate System.  The specified 

        coordinates must have the same number of axes. 

 

 

 

        Input Parameters: 

                csys             Coordinate System to replace from. Use coordsys' torecord() to generate required record.  

                whichin          Index of input coordinate (0-rel)  

                whichout         Index of output coordinate  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     replace Ex 1   ----' 

        cs1 = cs.newcoordsys(direction=T, linear=1) 

        print cs1.coordinatetype() 

        #['Direction', 'Linear'] 

        cs2 = cs.newcoordsys(spectral=T) 

        cs1.replace (cs2.torecord(),0,1) 

        print cs1.coordinatetype() 

        #['Direction', 'Spectral'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_replace(self, *args, **kwargs) 

 

    def restfrequency(self): 

        """ 

        restfrequency(self) -> record 

 

        Summary 

                Recover the rest frequency 

 

        Description 

                 

 

        If the Coordinate System contains a spectral coordinate, then 

        it has a rest frequency.  In fact, the spectral coordinate 

        can hold several rest frequencies (to handle for example, 

        an observation where the band covers many lines), although 

        only one is active (for velocity conversions) at a time. 

 

        This function  recovers the rest frequencies 

        as a quantity vector.   The first frequency is the active one. 

 

        You can change the rest frequencies with 

        setrestfrequency.  

 

        If the Coordinate System does not contain a frequency coordinate, 

        an exception is generated. 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     restfrequency Ex 1     ----' 

        csys = cs.newcoordsys(spectral=T) 

        print csys.restfrequency() 

        #{'value': [1420405751.7860003], 'unit': 'Hz'} 

        csys.setrestfrequency (value=qa.quantity([1.2e9, 1.3e9],'Hz'), which=1, append=F) 

        print csys.restfrequency() 

        #{'value': [1300000000.0, 1200000000.0], 'unit': 'Hz'} 

        # 

        ''' 

 

        In the example, the initial spectral coordinate has 1 rest frequency. 

        Then we set it with two, nominating the second as the active rest frequency, 

        and recover them. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_restfrequency(self) 

 

    def setconversiontype(self, *args, **kwargs): 

        """ 

        setconversiontype(self, direction = string(""), spectral = string("")) -> bool 

 

        Summary 

                Set extra reference conversion layer 

 

        Description 

                 

 

        Some coordinates contain a reference code.  Examples of reference codes 

        are B1950 and J2000 for direction coordinates, or LSRK and BARY for 

        spectral coordinates.  When you do conversions between pixel and world 

        coordinate, the coordinates are in the reference frame corresponding to 

        these codes.    

 

        This function allows you to specify a different reference frame which 

        is used when converting between world and pixel coordinate (see 

        function conversiontype 

        to recover the conversion types).  If it returns F, it means that 

        although the conversion machines were successfully created, a trial 

        conversion failed.  This usually means the REST frame was involved 

        which requires a radial velocity (not yet implemented).  If this 

        happens, the conversion type will be left as it was. The function 

        fails if more blatant things are wrong like a missing coordinate, or 

        an incorrect reference code. 

 

        The list of possible reference codes can be obtained via function 

        referencecode. 

 

        With this function, you specify the desired reference code.  Then, 

        when a conversion between pixel and world is requested, an extra 

        conversion is done to ({\stff toWorld}) or from ({\stff toPixel}) the 

        specified reference frame. 

 

        The summary 

        function shows the extra conversion reference system to the right of 

        the native reference system (if it is different) and in parentheses. 

 

        Note that to convert between different spectral reference frames, you 

        need a position, epoch and direction.  The position (telescope) and 

        epoch (date of observation), if not in your coordinate system can be set 

        with functions settelescope and 

        setepoch.  The direction is the 

        reference direction of the {\it required} direction coordinate in the 

        coordinate system.  

 

        igskip\goodbreak 

        As an example, let us say you are working with a spectral coordinate 

        which was constructed with the LSRK reference frame.  You want to convert 

        some pixel coordinates to barycentric velocities (reference code BARY). 

 

        egin{verbatim} 

        ''' 

        # 

        print ' ----     setconversiontype Ex 1         ----' 

        csys = cs.newcoordsys(direction=T, spectral=T); # Create coordinate system 

        rtn=csys.findcoordinate('spectral')             # Find spectral coordinate 

        wa=rtn['world'] 

        pa=rtn['pixel'] 

        u = csys.units()[wa]                            # Spectral unit 

        print csys.referencecode(type='spectral')       # Which is  in LSRK reference frame 

        #LSRK 

        p = [10,20,30] 

        w = csys.toworld(p, format='n')           # Convert a pixel to LSRK world 

        print 'pixel, world = ', p, w['numeric'] 

        #pixel, world =  [10, 20, 30] [21589.999816660376, 20.000112822985134, 1415030000.0] 

        p2 = csys.topixel(w)                      # and back to pixel 

        print 'world, pixel = ', w['numeric'], p2 

        #world, pixel =  [21589.999816660376, 20.000112822985134, 1415030000.0] 

        # [10.00000000000248, 19.999999999999801, 30.0] 

        # Convert LSRK frequency to LSRK velocity 

        v = csys.frequencytovelocity(value=w['numeric'][wa], frequnit=u,  

                                     doppler='RADIO', velunit='m/s'); 

        print 'pixel, frequency, velocity = ', p[pa], w['numeric'][wa], v 

        #pixel, frequency, velocity =  30 1415030000.0 1134612.30321 

        csys.setconversiontype(spectral='BARY')   # Specify BARY reference code 

        w = csys.toworld(p, format='n')           # Convert a pixel to BARY world 

        print 'pixel, world = ', p, w['numeric'] 

        #pixel, world =  [10, 20, 30] [21589.999816660376, 20.000112822985134, 1415031369.0081882] 

        p2 = csys.topixel(w)                      # and back to pixel 

        print 'world, pixel = ', w['numeric'], p2 

        #world, pixel =  [21589.999816660376, 20.000112822985134, 1415031369.0081882] 

        # [10.00000000000248, 19.999999999999801, 30.0] 

        # Convert BARY frequency to BARY velocity 

        v = csys.frequencytovelocity(value=w['numeric'][wa], frequnit=u,  

                                      doppler='RADIO', velunit='m/s'); 

        print 'pixel, frequency, velocity = ', p[pa], w['numeric'][wa], v 

        #pixel, frequency, velocity =  30 1415031369.01 1134323.35878 

        # 

        ''' 

        nd{verbatim} 

 

 

        You must also be aware of when this extra layer is active and when it is 

        not.  It's a bit nasty.  

 

        egin{itemize} 

 

        \item - Whenever you use {\stff toWorld}, {\stff toPixel} 

        {\stff toWorldMany}, or {\stff toPixelMany} the layer is active.    

 

        \item - Whenever you use {\stff convert} or {\stff convertMany} 

        the layer {\it may} be active.   Here are the rules ! 

 

        It is only relevant to spectral and direction coordinates. 

 

        For the direction coordinate part of your conversion, if you request a 

        pure world or pixel conversion it is active.  Any pixel/world mix will 

        not invoke it (because it is ill defined).  

 

        For the spectral coordinate part it is always active (only one axis 

        so must be pixel or world). 

 

        \item - This layer is irrelevant to all functions converting between 

        frequency and velocity, and absolute and relative.  The values are in 

        whatever frame you are working with.  

 

        nd{itemize} 

 

        The summary function 

        lists the reference frame for direction and spectral coordinates.  If 

        you have also set a conversion reference code it also lists that (to 

        the right in parentheses). 

 

 

 

        Input Parameters: 

                direction        Reference code  

                spectral         Reference code  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setconversiontype(self, *args, **kwargs) 

 

    def getconversiontype(self, *args, **kwargs): 

        """ 

        getconversiontype(self, type = string(""), showconversion = True) -> string 

 

        Summary 

                Get extra reference conversion layer 

           (aka conversiontype).   

 

        Description 

                  See conversiontype for more complete description. 

 

 

        Input Parameters: 

                type             Conversion type  

                showconversion   Show the conversion layer true  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_getconversiontype(self, *args, **kwargs) 

 

    def setdirection(self, *args, **kwargs): 

        """ 

        setdirection(self, refcode = string(""), proj = string(""), projpar = initialize_vector(1, (double)-1),  

            refpix = initialize_vector(1, (double)-1),  

            refval = initialize_variant(""),  

            incr = initialize_variant(""),  

            xform = initialize_variant(""), poles = initialize_variant("")) -> bool 

 

        Summary 

                Set direction coordinate values 

 

        Description 

                 

 

        When you construct a Coordsys   ool, if you include a Direction 

        Coordinate, it  will have some default parameters.   

        This function simply allows you to 

        replace the values of the Direction Coordinate. 

 

        You can also change almost all of those parameters (such as projection, reference value 

        etc.) via the individual functions  

        setreferencecode, 

        setprojection, 

        setreferencepixel, 

        setreferencevalue, 

        setincrement, and 

        setlineartransform 

        provided by the Coordsys        ool.    See those functions for more details 

        about the formatting of the above function arguments. 

 

        Bear in mind, that if your Coordinate System came from a real image, then 

        the reference pixel is special and you should not change it. 

 

 

 

        Input Parameters: 

                refcode          Reference code. Default is no change.  

                proj             Projection type. Default is no change.  

                projpar          Projection parameters. Default is no change. -1  

                refpix           Reference pixel. Default is no change. -1  

                refval           Reference value. Default is no change.  

                incr             Increment. Default is no change.  

                xform            Linear transform. Default is no change.  

                poles            Native poles. Default is no change.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setdirection Ex 1      ----' 

        csys = cs.newcoordsys(direction=T); 

        csys.setdirection (refcode='GALACTIC', proj='SIN', projpar=[0,0], 

                           refpix=[-10,20], refval='10deg -20deg'); 

        print csys.projection() 

        #{'type': 'SIN', 'parameters': array([ 0.,  0.])} 

        print csys.referencepixel() 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([-10.,  20.])} 

        print csys.referencevalue(format='s') 

        #{'ar_type': 'absolute', 'pw_type': 'world',  

        # 'string': array(['10.00000000 deg', '-20.00000000 deg'], dtype='|S17')} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setdirection(self, *args, **kwargs) 

 

    def setepoch(self, *args, **kwargs): 

        """ 

        setepoch(self, value) -> bool 

 

        Summary 

                Set a new epoch 

 

        Description 

                 

 

        This function  sets a new epoch (supplied as an 

        epoch measure) of the observation. You 

        can get the current epoch with function 

        epoch.   

 

 

 

        Input Parameters: 

                value            New epoch measure  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setepoch Ex 1  ----' 

        csys = cs.newcoordsys() 

        ep = csys.epoch() 

        print ep 

        #{'type': 'epoch', 'm0': {'value': 54161.766782997685, 'unit': 'd'}, 'refer': 'UTC'} 

        ep = me.epoch('UTC', 'today') 

        csys.setepoch(ep) 

        print csys.epoch() 

        #{'type': 'epoch', 'm0': {'value': 54161.766782997685, 'unit': 'd'}, 'refer': 'UTC'} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setepoch(self, *args, **kwargs) 

 

    def setincrement(self, *args, **kwargs): 

        """ 

        setincrement(self, value = initialize_variant(""), type = string("")) -> bool 

 

        Summary 

                Set the increment 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function  allows you to set a new 

        increment.   You should not do this on 'stokes' axes unless you are an 

        adept or a big risk taker. 

 

        You can set the increments either for all axes ({\stfaf 

        type=unset}) or for just the axes associated with a particular 

        coordinate type. 

 

        You may supply the increments in all of the formats described in 

        the \htmlref{formatting}{COORDSYS:FORMATTING} discussion. 

 

        In addition, you can also supply the increments as  a quantity of vector 

        of doubles.  For example {\stfaf qa.quantity([-1,2],'arcsec')}. 

 

        You can recover the current increments with function 

        increment.  

 

 

 

        Input Parameters: 

                value            Increments  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setincrement Ex 1      ----' 

        csys=cs.newcoordsys(direction=T, spectral=T) 

        rv = csys.increment(format='q') 

        print rv 

        # {'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': -1.0, 'unit': '''}, 

        #              '*2': {'value': 1.0, 'unit': '''}, 

        #              '*3': {'value': 1000.0, 'unit': 'Hz'}}} 

        rv2 = qa.quantity('4kHz'); 

        csys.setincrement(value=rv2, type='spec') 

        print csys.increment(type='spec', format='q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 4000.0, 'unit': 'Hz'}}} 

        csys.setincrement(value='5kHz', type='spec') 

        print csys.increment(type='spec', format='q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 5000.0, 'unit': 'Hz'}}} 

        print csys.increment(format='q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': -1.0, 'unit': '''}, 

        #              '*2': {'value': 1.0, 'unit': '''}, 

        #              '*3': {'value': 5000.0, 'unit': 'Hz'}}} 

        csys.setincrement (value='-2' 2' 2e4Hz') 

        print csys.increment(format='q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': -2.0, 'unit': '''}, 

        #              '*2': {'value': 2.0, 'unit': '''}, 

        #              '*3': {'value': 20000.0, 'unit': 'Hz'}}} 

        # 

        ''' 

 

 

        In the example we first recover the increments as a vector of 

        quantities. We then create a quantity for a new value for the spectral 

        coordinate increment.  Note we use units of kHz whereas the spectral 

        coordinate is currently expressed in units of Hz.  We then set the 

        increment for the spectral coordinate.  We then recover the increment 

        again; you can see 4kHz has been converted to 4000Hz.  We also show 

        how to set the increment using a string interface. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setincrement(self, *args, **kwargs) 

 

    def setlineartransform(self, *args, **kwargs): 

        """ 

        setlineartransform(self, type = string(""), value = initialize_variant("")) -> bool 

 

        Summary 

                Set the linear transform 

 

        Description 

                 

 

        This function set the linear transform component.  For Stokes Coordinates 

        this function will return T but do nothing. 

 

        You can recover the current linear transform with function 

        lineartransform.  

 

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular'. Leave empty for all.  

                value            Linear transform  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setlineartransform Ex 1        ----' 

        csys = cs.newcoordsys(spectral=T, linear=3) 

        xf = csys.lineartransform('lin') 

        print xf 

        #[(1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)] 

        xf[0]=list(xf[0]) 

        xf[0][1]=0.01 

        #xf[0]=tuple(xf[0]) 

        csys.setlineartransform('lin',xf) 

        print csys.lineartransform('lin') 

        #[(1.0, 0.01, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)] 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setlineartransform(self, *args, **kwargs) 

 

    def setnames(self, *args, **kwargs): 

        """ 

        setnames(self, value, type = string("")) -> bool 

 

        Summary 

                Set the axis names 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a name. 

        It isn't used in any fundamental way. 

 

        This function  allows you to set 

        new axis names. 

 

        You can set the names either for all axes ({\stfaf 

        type=unset}) or for just the axes associated with a particular 

        coordinate type. 

 

        You can recover the current axis names with function 

        names.  

 

 

 

        Input Parameters: 

                value            Names  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular' or leave empty for all  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setnames Ex 1  ----' 

        csys = cs.newcoordsys(spectral=T, linear=2) 

        csys.setnames(value='a b c') 

        print csys.names() 

        #['a', 'b', 'c'] 

        csys.setnames('flying fish', 'lin') 

        print csys.names() 

        #['a', 'flying', 'fish'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setnames(self, *args, **kwargs) 

 

    def setobserver(self, *args, **kwargs): 

        """ 

        setobserver(self, value) -> bool 

 

        Summary 

                Set a new observer 

 

        Description 

                 

 

        If you want to grab all the glory, or transfer the blame, this function 

         sets a new observer of the 

        observation. You can get the current observer with function observer.  The 

        observer's name is not fundamental to the Coordinate System ! 

 

 

 

        Input Parameters: 

                value            New observer  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setobserver Ex 1       ----' 

        csys = cs.newcoordsys() 

        print csys.observer() 

        #Karl Jansky  

        csys.setobserver('Ronald Biggs') 

        print csys.observer() 

        #Ronald Biggs  

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setobserver(self, *args, **kwargs) 

 

    def setprojection(self, *args, **kwargs): 

        """ 

        setprojection(self, type, parameters = initialize_vector(1, (double)-1)) -> bool 

 

        Summary 

                Set the direction coordinate projection 

 

        Description 

                 

 

        If the Coordinate System contains a direction coordinate, this 

        function  can be used to set the 

        projection.  For discussion about celestial coordinate systems, 

        including projections, see the papers by Mark Calabretta and Eric 

        Greisen. The initial draft from 1996 (implemented in \casa) can be 

        found 

        \htmladdnormallink{here}{http://www.atnf.csiro.au/people/mark.calabretta/WCS}. 

 

        You can use the function projection 

        to find out all the possible types of projection.  You can also use it 

        to find out how many parameters you need to describe a particular 

        projection.  See Calabretta and Greisen for details about those 

        parameters (see section 4 of their paper); in FITS terms these 

        parameters are what are labelled as PROJP.  

 

        Some brief help here on the more common projections in astronomy. 

 

        egin{itemize} 

 

        \item SIN has either 0 parameters or 2.  For coplanar arrays like 

        East-West arrays, one can use what is widely termed the NCP projection.  

        This is actually a SIN projection where the parameters are 0 and 

        $1/tan(\delta_0)$ where $\delta_0$ is the reference declination.  Images 

        made from the ATNF's Compact Array with \casa\ will have such a 

        projection.  Otherwise, the SIN projection requires no parameters (but 

        you can give it two each of which is zero if you wish). 

 

        \item TAN is used widely in optical astronomy.  It requires 0 

        parameters. 

 

        \item ZEA (zenithal equal area) is used widely in survey work. 

        It requires 0 parameters. 

 

        nd{itemize} 

 

        If the Coordinate System does not contain a direction coordinate, 

        an exception is generated. 

 

 

 

        Input Parameters: 

                type             Type of projection  

                parameters       Projection parameters -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     Ex setprojection 1     ----' 

        im = ia.maketestimage('cena',overwrite=true) 

        csys = ia.coordsys() 

        print csys.projection() 

        #{'type': 'SIN', 'parameters': array([ 0.,  0.])} 

        print csys.projection('ZEA') 

        #{'nparameters': 0} 

        csys.setprojection('ZEA') 

        im2 = ia.regrid('cena.zea', csys=csys.torecord(), overwrite=true) 

        # 

        ''' 

 

        We change the projection of an image from SIN to  

        ZEA (which requires no parameters). 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setprojection(self, *args, **kwargs) 

 

    def setreferencecode(self, *args, **kwargs): 

        """ 

        setreferencecode(self, value, type = string("direction"), adjust = True) -> bool 

 

        Summary 

                Set new reference code 

 

        Description 

                 

 

        This function  sets the reference 

        code for the specified coordinate type.  Examples of reference codes 

        are B1950 and J2000 for direction coordinates, or LSRK and BARY for 

        spectral coordinates. 

 

        You must specify {\stfaf type}, selecting from 'direction',  or 

        'spectral' (the first two letters will do).   If the Coordinate System 

        does not contain a coordinate of the type you specify, an exception is 

        generated. 

 

        Specify the new code with argument {\stfaf value}.  To see the list of 

        possible codes, use the function referencecode 

        (see example). 

 

        If {\stfaf adjust} is T, then the reference value is recomputed. 

        This is invariably the correct thing to do.  If {\stfaf adjust} is F,  

        then the reference code is simply overwritten; do this very carefully. 

 

 

 

        Input Parameters: 

                value            Reference code  

                type             Coordinate type: direction or spectral direction  

                adjust           Adjust reference value ? true  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     Ex setreferencecode 1  ----' 

        csys = cs.newcoordsys(direction=T) 

        clist = csys.referencecode('dir', T)      # See possibilities 

        print clist 

        #['J2000', 'JMEAN', 'JTRUE', 'APP', 'B1950', 'BMEAN', 'BTRUE', 'GALACTIC', 

        # 'HADEC', 'AZEL', 'AZELSW', 'AZELNE', 'AZELGEO', 'AZELSWGEO', 'AZELNEGEO', 

        # 'JNAT', 'ECLIPTIC', 'MECLIPTIC', 'TECLIPTIC', 'SUPERGAL', 'ITRF', 'TOPO', 

        # 'ICRS', 'MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', 'URANUS', 

        # 'NEPTUNE', 'PLUTO', 'SUN', 'MOON', 'COMET'] 

        print cs.referencecode('dir') 

        #J2000 

        cs.setreferencecode('B1950', 'dir', T) 

        # 

        ''' 

 

 

        In this example we first get the list of all possible reference codes 

        for a direction coordinate.  Then we set the actual reference code for the direction 

        coordinate in our Coordinate System. 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     Ex setreferencecode 2  ----' 

        ia.maketestimage('myimage.j2000',overwrite=true)      # Open image 

        csys = ia.coordsys()                                  # Get Coordinate System 

        print csys.referencecode('dir', F) 

        #J2000 

        csys.setreferencecode('B1950', 'dir', T)              # Set new direction system 

        im2 = ia.regrid(outfile='myimage.b1950', csys=csys.torecord(), 

                        overwrite=true)  # Regrid and make new image 

        # 

        ''' 

 

 

        In this example we show how to regrid an image from J2000 

        to B1950.  First we recover the Coordinate System  into the Coordsys 

                ool\ called {\stf cs}.  We then set a new direction reference code, 

        making sure we recompute the reference value.  Then the 

        new Coordinate System is supplied in the regridding process 

        (done with an Image     ool). 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setreferencecode(self, *args, **kwargs) 

 

    def setreferencelocation(self, *args, **kwargs): 

        """ 

        setreferencelocation(self, pixel = initialize_vector(1, (int)-1), world = initialize_variant("-1"),  

            mask = initialize_vector(1, (bool)false)) -> bool 

 

        Summary 

                Set reference pixel and value 

 

        Description 

                 

 

        This function sets the reference pixel and 

        reference value to the specified values.  The world coordinate can be 

        specified in any of the formats that the output world coordinate is 

        returned in by the toworld function.  

 

        You can specify a mask (argument {\stfaf mask}) indicating which pixel 

        axes are set (T) and which are left unchanged (F).  This function will 

        refuse to change the reference location of a Stokes axis (gets you into 

        trouble otherwise).  

 

        This function can be rather useful when regridding 

        images.  It allows you to keep easily a particular feature centered in the  

        regridded image. 

 

 

 

        Input Parameters: 

                pixel            New reference pixel. Defaults to old reference pixel. -1  

                world            New reference value. Defaults to old reference value. -1  

                mask             Indicates which axes to center. Defaults to all. false  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setreferencelocation Ex 1      ----' 

        csys = cs.newcoordsys(linear=2) 

        print csys.referencepixel() 

        #[0.0, 0.0] 

        print csys.referencevalue() 

        #{'numeric': array([ 0.,  0.])} 

        w = csys.toworld([19,19], format='n') 

        shp = [128,128] 

        p = [64, 64] 

        csys.setreferencelocation (pixel=p, world=w) 

        print csys.referencepixel() 

        #[64.0, 64.0]   

        print csys.referencevalue() 

        #{'numeric': array([ 19.,  19.])} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setreferencelocation(self, *args, **kwargs) 

 

    def setreferencepixel(self, *args, **kwargs): 

        """ 

        setreferencepixel(self, value, type = string("")) -> bool 

 

        Summary 

                Set the reference pixel 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function allows you to set a new reference pixel.   You should not 

        do this on 'stokes' axes unless you are an adept or a big risk taker. 

 

        You can set the reference pixel either for all axes ({\stfaf 

        type=unset}) or for just the axes associated with a particular 

        coordinate type. 

 

        Bear in mind, that if your Coordinate System came from a real image, 

        then the reference pixel is special and you should not change it for 

        Direction Coordinates.  

 

        You can recover the current reference pixel with function 

        referencepixel.  

 

 

 

        Input Parameters: 

                value            Reference pixel  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular' or leave unset for all  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setreferencepixel Ex 1         ----' 

        csys = cs.newcoordsys(spectral=T, linear=2) 

        csys.setreferencepixel(value=[1.0, 2.0, 3.0]) 

        print csys.referencepixel() 

        #[1.0, 2.0, 3.0] 

        csys.setreferencepixel([-1, -1], 'lin') 

        print csys.referencepixel() 

        #[1.0, -1.0, -1.0] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setreferencepixel(self, *args, **kwargs) 

 

    def setreferencevalue(self, *args, **kwargs): 

        """ 

        setreferencevalue(self, value, type = string("")) -> bool 

 

        Summary 

                Set the reference value 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a reference value, 

        reference pixel and an increment (per pixel).  These are used in the 

        mapping from pixel to world coordinate.  

 

        This function allows you to set a new 

        reference value.  You should not do this on 'stokes' axes unless you 

        are an adept or a big risk taker. 

 

        You may supply the reference value in all of the formats described in 

        the \htmlref{formatting}{COORDSYS:FORMATTING} discussion. 

 

        You can recover the current reference value with function 

        referencevalue.  

 

        Note that the value argument should be one of the specified 

        possibilitioes. Especially a {\stff measure} will be accepted, but 

        will have a null effect, due to the interpretation as a generic 

        record. 

 

 

 

        Input Parameters: 

                value            Reference value  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabular' or leave empty for all.  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setreferencevalue Ex 1         ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        rv = csys.referencevalue(format='q') 

        print rv 

        #{'quantity': {'*1': {'value': 0.0, 'unit': '''}, 

        # '*2': {'value': 0.0, 'unit': '''}, '*3': {'value': 1415000000.0, 'unit': 'Hz'}}} 

        rv2 = rv['quantity']['*3'] 

        rv2['value'] = 2.0e9 

        print rv2 

        #{'value': 2000000000.0, 'unit': 'Hz'} 

        csys.setreferencevalue(type='spec', value=rv2) 

        print csys.referencevalue(format='n') 

        #{'numeric': array([  0.00000000e+00,   0.00000000e+00,   2.00000000e+09])} 

        # 

        # To set a new direction reference value, the easiest way, given a 

        # direction measure dr would be: 

        dr = me.direction('j2000','30deg','40deg') 

        # SHOULD BE SIMPLIFIED!!! 

        newrv=csys.referencevalue(format='q') 

        newrv['quantity']['*1']=dr['m0'] 

        newrv['quantity']['*2']=dr['m1'] 

        csys.setreferencevalue(value=newrv) 

        print csys.referencevalue(format='q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 1800.0, 'unit': '''}, 

        #              '*2': {'value': 2399.9999999999995, 'unit': '''}, 

        #              '*3': {'value': 1415000000.0, 'unit': 'Hz'}}} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setreferencevalue(self, *args, **kwargs) 

 

    def setrestfrequency(self, *args, **kwargs): 

        """ 

        setrestfrequency(self, value, which = 0, append = False) -> bool 

 

        Summary 

                Set the rest frequency 

 

        Description 

                 

 

        If the Coordinate System contains a spectral coordinate, then 

        it has a rest frequency.  In fact, the spectral coordinate 

        can hold several rest frequencies (to handle for example, 

        an observation where the band covers many lines), although 

        only one is active (for velocity conversions) at a time. 

 

        This function allows you to set new rest 

        frequencies.  You can provide the rest frequency as a quantity, or as 

        a quantity string, or a double (units of current rest frequency assumed). 

 

        You specify whether the list of frequencies will be appended 

        to the current list or whether it will replace that list. 

        You must select which of the frequencies will become the active 

        one.  By default its the first in the list.  The index refers 

        to the final list (either appended or replaced). 

 

        You can recover the current rest frequencies with 

        restfrequency.  

 

        If the Coordinate System does not contain a frequency coordinate, 

        an exception is generated. 

 

 

 

        Input Parameters: 

                value            New rest frequencies  

                which            Which is the active rest frequency 0  

                append           Append this list or overwrite ? false  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setrestfrequency Ex 1  ----' 

        csys = cs.newcoordsys(spectral=T) 

        print csys.restfrequency() 

        #{'value': array([  1.42040575e+09]), 'unit': 'Hz'} 

        csys.setrestfrequency(qa.quantity('1.4GHz')) 

        print csys.restfrequency() 

        #{'value': array([  1.40000000e+09]), 'unit': 'Hz'} 

        csys.setrestfrequency(1.3e9) 

        print csys.restfrequency() 

        #{'value': array([  1.30000000e+09]), 'unit': 'Hz'} 

        csys.setrestfrequency (value=[1.2e9, 1.3e9], which=1) 

        print csys.restfrequency() 

        #{'value': array([  1.30000000e+09,   1.20000000e+09]), 'unit': 'Hz'} 

        csys.setrestfrequency (qa.quantity([1,2],'GHz'), which=3, append=T) 

        print csys.restfrequency() 

        #{'value': array([  2.00000000e+09,   1.20000000e+09,   1.30000000e+09, 

        #         1.00000000e+09]), 'unit': 'Hz'} 

        csys.setrestfrequency ('1.4E9Hz 1667MHz') 

        print csys.restfrequency() 

        #{'value': array([  1.40000000e+09,   1.66700000e+09]), 'unit': 'Hz'} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setrestfrequency(self, *args, **kwargs) 

 

    def setspectral(self, *args, **kwargs): 

        """ 

        setspectral(self, refcode = string(""), restfreq = initialize_variant(""),  

            frequencies = initialize_variant("1GHz"),  

            doppler = string(""), velocities = initialize_variant("1km/s")) -> bool 

 

        Summary 

                Set tabular values for the spectral coordinate 

 

        Description 

                 

 

        When you construct a Coordsys   ool, if you include a Spectral Coordinate, it  

        will be linear in frequency.  This function allows you to replace the 

        Spectral Coordinate by a finite table of values.  Coordinate 

        conversions between pixel and world are then done by interpolation. 

 

        You may specify either a vector of frequencies or velocities.  If you specify 

        frequencies, you can optionally specify a (new) reference code (see 

        function setreferencecode 

        for more details) and rest frequency (else the existing ones will be used). 

 

        If you specify velocities, you can optionally specify a (new) reference code 

        and rest frequency (else the existing ones will be used).  You must also give 

        the doppler type (see 

        function summary for more 

        details).  The velocities are then converted to frequency for creation of the 

        Spectral Coordinate (which is fundamentally described by frequency). 

 

        You may specify the rest frequency as a Quantum or a double (native units 

        of Spectral Coordinate used). 

 

 

 

        Input Parameters: 

                refcode          Reference code. Leave unset for no change.  

                restfreq         Rest frequency. Leave unset for no change.  

                frequencies      Vector of frequencies. Leave unset for no change. 1GHz  

                doppler          Doppler type. Leave unset for no change.  

                velocities       Vector of velocities types. Leave unset for no change. 1km/s  

                 

        Example: 

                 

 

        print ' ----     setspectral Ex 1       ----' 

        csys = cs.newcoordsys(spectral=T); 

        f1 = [1,1.01,1.03,1.4] 

        fq = qa.quantity(f1, 'GHz') 

        csys.setspectral(frequencies=fq) 

        v = csys.frequencytovelocity(f1, 'GHz', 'radio', 'km/s') 

        print 'v=', v 

        #v= [88731.317461076716, 86620.706055687479, 82399.483244909003, 4306.8612455073862] 

        vq = qa.quantity(v, 'km/s') 

        csys.setspectral(velocities=vq, doppler='radio') 

        f2 = csys.velocitytofrequency(v, 'GHz', 'radio', 'km/s') 

        print 'f1 = ', f1 

        #f1 =  [1, 1.01, 1.03, 1.3999999999999999] 

        print 'f2 = ', f2 

        #f2 =  [1.0, 1.01, 1.03, 1.3999999999999999] 

 

        We make a linear Spectral Coordinate.  Then overwrite it with 

        a list of frequenices.  Convert those values to velocity, 

        then overwrite the coordinate starting with a list of 

        velocities. Then convert the velocities to frequency 

        and show we get the original result. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setspectral(self, *args, **kwargs) 

 

    def setstokes(self, *args, **kwargs): 

        """ 

        setstokes(self, stokes) -> bool 

 

        Summary 

                Set the Stokes types 

 

        Description 

                 

 

        If the Coordinate System contains a Stokes Coordinate, this function allows 

        you to change the Stokes types defining it.  If there is no Stokes 

        Coordinate, an exception is generated. 

 

        See the coordsys constructor 

        to see the possible Stokes types you can set. 

 

        You can set the Stokes types with function 

        setstokes.  

 

 

 

        Input Parameters: 

                stokes           Stokes types  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setstokes Ex 1         ----' 

        csys = cs.newcoordsys(stokes='I V') 

        print csys.stokes() 

        #['I', 'V'] 

        csys.setstokes('XX RL') 

        print csys.stokes() 

        #['XX', 'RL'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setstokes(self, *args, **kwargs) 

 

    def settabular(self, *args, **kwargs): 

        """ 

        settabular(self, pixel = initialize_vector(1, (double)-1), world = initialize_vector(1, (double)-1),  

            which = 0) -> bool 

 

        Summary 

                Set tabular values for the tabular coordinate 

 

        Description 

                 

 

        When you construct a Coordsys   ool, if you include a Tabular 

        Coordinate, it will be linear.  This function allows you to replace the 

        Tabular Coordinate by a finite table of values.  Coordinate conversions 

        between pixel and world are then done by interpolation (or extrapolation 

        beyond the end).  The table of values must be at least of length 2 

        or an exception will occur. 

 

        You may specify a vector of pixel and world values (in the current units 

        of the Tabular Coordinate).  These vectors must be the same length.  If 

        you leave one of them unset, then the old values are used, but again, 

        ultimately, the pixel and world vectors must be the same length.  

 

        The new reference pixel will be the first pixel value. 

        The new reference value will be the first world value. 

 

        Presently, there is no way for you to recover the lookup table 

        once you have set it. 

 

        If you have more than one Tabular Coordinate, use argument 

        {\stfaf which} to specify which one you want to modify. 

 

 

 

        Input Parameters: 

                pixel            Vector of (0-rel) pixel values. Default is no change. -1  

                world            Vector of world values. Default is no change. -1  

                which            Which Tabular coordinate 0  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     settabular Ex 1        ----' 

        csys = cs.newcoordsys(tabular=T); 

        print csys.settabular (pixel=[1,10,15,20,100], world=[10,20,50,100,500]) 

        #True 

        # 

        ''' 

 

        We make a linear Tabular Coordinate.  Then overwrite it with 

        a non-linear list of pixel and world values. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_settabular(self, *args, **kwargs) 

 

    def settelescope(self, *args, **kwargs): 

        """ 

        settelescope(self, value) -> bool 

 

        Summary 

                Set a new telescope 

 

        Description 

                 

 

        This function sets a new telescope of the observation.   The telescope 

        position may be needed for reference code conversions; this is why it is 

        maintained in the Coordinate System.    So it is fundamental 

        to the Coordinate System and should be correct. 

 

        You can find a list of the observatory names know to \casa\ with the 

        Measures obslist function. 

 

        You can  get the current telescope with function 

        telescope.    

 

 

 

        Input Parameters: 

                value            New telescope  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     settelescope Ex 1      ----' 

        csys = cs.newcoordsys() 

        print csys.telescope() 

        #ATCA 

        csys.settelescope('VLA') 

        print csys.telescope() 

        #VLA 

        csys.settelescope('The One In My Backyard') 

        #Tue Mar 6 21:41:24 2007      WARN coordsys::settelescope: 

        #This telescope is not known to the casapy system 

        #You can request that it be added 

        print me.obslist() 

        #ALMA ARECIBO ATCA BIMA CLRO DRAO DWL GB GBT GMRT IRAM PDB IRAM_PDB 

        # JCMT MOPRA MOST NRAO12M NRAO_GBT PKS SAO SMA VLA VLBA WSRT 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_settelescope(self, *args, **kwargs) 

 

    def setunits(self, *args, **kwargs): 

        """ 

        setunits(self, value, type = string(""), overwrite = False, which = -10) -> bool 

 

        Summary 

                Set the axis units 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a unit. This 

        function allows you to set new axis units.     

 

        You can set the units either for all axes ({\stfaf 

        type=unset}) or for just the axes associated with a particular 

        coordinate type. 

 

        In general, the units must be consistent with the old units. When you 

        change the units, the increment and reference value will be adjusted 

        appropriately.  However, for a linear or tabular coordinate, and only 

        when you specify {\stfaf type='linear'} or {\stfaf type='tabular'}  

        (i.e. you supply units only for the specified linear of tabular 

        coordinate), and if you set {\stfaf overwrite=T}, you can just overwrite 

        the units with no further adjustments.   Otherwise, the {\stfaf 

        overwrite} argument will be silently ignored.  Use argument 

        {\stfaf which} to specify which coordinate if you have more 

        than one of the specified type. 

 

        You can recover the current axis units with function 

        units.  

 

 

 

        Input Parameters: 

                value            Units  

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear', 'tabules' or leave unset for all.  

                overwrite        Overwrite linear or tabular coordinate units? false  

                which            Which coordinate if more than one of same type. Default is first. -10  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     setunits Ex 1  ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        csys.summary() 

        csys.setunits(value='deg rad mHz'); 

        csys.summary() 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setunits(self, *args, **kwargs) 

 

    def stokes(self): 

        """ 

        stokes(self) -> std::vector<(std::string)> 

 

        Summary 

                Recover the Stokes types 

 

        Description 

                 

 

        If the Coordinate System contains a Stokes Coordinate, this function recovers the 

        Stokes types defining it.  If there is no Stokes 

        Coordinate, an exception is generated. 

 

        You can set the Stokes types with function 

        setstokes.  

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     stokes Ex 1    ----' 

        csys = cs.newcoordsys(stokes=['I','V']) 

        print csys.stokes() 

        #['I', 'V'] 

        csys = cs.newcoordsys(stokes='Q U') 

        print csys.stokes() 

        #['Q', 'U'] 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_stokes(self) 

 

    def summary(self, *args, **kwargs): 

        """ 

        summary(self, doppler = string("RADIO"), list = True) -> std::vector<(std::string)> 

 

        Summary 

                Summarize basic information about the Coordinate System 

 

        Description 

                 

 

        This function summarizes the information 

        contained in the Coordinate System.  

             

        For spectral coordinates, the information is listed as a velocity as well as a 

        frequency.  The argument {\stfaf doppler} allows you to specify what 

        doppler convention it is listed in.  You can choose from {\stfaf radio, 

        optical} and {\stfaf beta}.  Alternative names are {\stfaf z} for 

        {\stfaf optical}, and {\stfaf relativistic} for {\stfaf 

        beta}.  The default is {\stfaf radio}.  The definitions are 

 

        egin{itemize} 

        \item radio: $1 - F$ 

        \item optical: $-1 + 1/F$ 

        \item beta: $(1 - F^2)/(1 + F^2)$ 

        nd{itemize} 

        where $F =  

        u/ 

        u_0$ and $ 

        u_0$ is the rest frequency.  If the rest 

        frequency has not been set in your image, you can set it with 

        the function setrestfrequency. 

 

        These velocity definitions are provided by the measures 

        system via the Doppler measure (see example). 

 

        If you  set {\stfaf list=F}, then the summary will not be written 

        to the global logger.     However, the return value will be a vector of strings 

        holding the summary information, one string per line of the summary. 

 

        For direction and spectral coordinates, the reference frame (e.g.  J2000 

        or LSRK) is also listed.  Along side this, in parentheses, will be the 

        conversion reference frame as well (if it is different from the native 

        reference frame).  See function 

        setconversion to see what this 

        means.  

 

 

 

        Input Parameters: 

                doppler          List velocity information with this doppler definition RADIO  

                list             List to global logger true  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     summary Ex 1   ----' 

        d = me.doppler('beta') 

        print me.listcodes(d) 

        #[normal=RADIO Z RATIO BETA GAMMA OPTICAL TRUE RELATIVISTIC, extra=]  

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.summary(list=F) 

        # 

        #Direction reference : J2000 

        #Spectral  reference : LSRK 

        #Velocity  type      : RADIO 

        #Rest frequency      : 1.42041e+09 Hz 

        #Telescope           : ATCA 

        #Observer            : Karl Jansky 

        #Date observation    : 2007/07/14/04:49:31 

        # 

        #Axis Coord Type      Name             Proj   Coord value at pixel    Coord incr Units 

        #------------------------------------------------------------------------------------- 

        #0    0     Direction Right Ascension   SIN  00:00:00.000     0.00 -6.000000e+01 arcsec 

        #1    0     Direction Declination       SIN +00.00.00.000     0.00  6.000000e+01 arcsec 

        #2    1     Spectral  Frequency                 1.415e+09     0.00  1.000000e+03 Hz 

        #                     Velocity                    1140.94     0.00 -2.110611e-01 km/s 

        # 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_summary(self, *args, **kwargs) 

 

    def telescope(self): 

        """ 

        telescope(self) -> string 

 

        Summary 

                Return the telescope 

 

        Description 

                 

 

        This function returns the telescope 

        contained in the Coordinate System  as a 

        simple string.  

 

        The telescope position may be needed for reference code conversions; this is 

        why it is maintained in the Coordinate System.   

 

        The conversion from string to position is done with 

        Measures observatory. 

        The example shows how.   

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     telescope Ex 1         ----' 

        csys = cs.newcoordsys() 

        print csys.telescope() 

        #ATCA 

        print me.observatory(csys.telescope()) 

        #{'type': 'position', 'refer': 'ITRF', 

        # 'm1': {'value': -0.5261379196128062, 'unit': 'rad'}, 

        # 'm0': {'value': 2.6101423190348916, 'unit': 'rad'}, 

        # 'm2': {'value': 6372960.2577234386, 'unit': 'm'}} 

        # 

        ''' 

 

 

        We get the telescope as a string.  

         The Measures system is used to convert from 

        the simple name to a position Measure. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_telescope(self) 

 

    def toabs(self, *args, **kwargs): 

        """ 

        toabs(self, value, isworld = -1) -> record 

 

        Summary 

                Convert relative coordinate to absolute 

 

        Description 

                 

 

        This function converts a relative coordinate to an absolute coordinate. 

        The coordinate may be a pixel coordinate or a world coordinate. 

 

        If the coordinate is a pixel coordinate, it is supplied as a numeric 

        vector. If the coordinate is a world coordinate,  you may give it in all 

        of the formats described in the 

        \htmlref{formatting}{COORDSYS:FORMATTING} discussion. 

 

        If the coordinate value is supplied by a Coordsys       ool\ function (e.g. 

        toworld) then the coordinate 'knows' 

        whether it is world or pixel (and absolute or relative). However, you 

        might supply the value from some other source as a numeric vector (which 

        could be world or pixel) in which case you must specify whether it is a  

        world or pixel coordinate via the {\stfaf isworld} argument. 

 

 

 

        Input Parameters: 

                value            Relative coordinate  

                isworld          Is coordinate world or pixel? Default is unset. -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toabs Ex 1     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        aw = csys.toworld([100,100,24], 's') 

        rw = csys.torel(aw) 

        aw2 = csys.toabs(rw) 

        print aw 

        #{'ar_type': 'absolute', 'pw_type': 'world',  

        # 'string': array(['23:53:19.77415678', '+01.40.00.84648186', 

        #                  '1.41502400e+09 Hz'], dtype='|S19')} 

        print rw 

        #{'ar_type': 'relative', 'pw_type': 'world', 

        # 'string': array(['-6.00084720e+03 arcsec', '6.00084648e+03 arcsec', 

        #                  '2.40000000e+04 Hz'], dtype='|S23')} 

        print aw2 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['23:53:19.77415672', '+01.40.00.84648000', 

        #                  '1.41502400e+09 Hz'], dtype='|S19')} 

        # 

        ''' 

 

 

        This example uses world coordinates. 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toabs Ex 2     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        ap = csys.topixel()           # Reference value 

        rp = csys.torel(ap) 

        ap2 = csys.toabs(rp) 

        print ap 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([ 0.,  0.,  0.])} 

        print rp 

        #{'ar_type': 'relative', 'pw_type': 'world', 

        #     'numeric': array([  0.00000000e+00,   0.00000000e+00,  -1.41500000e+09])} 

        print ap2 

        #{'ar_type': 'absolute', 'pw_type': 'world', 'numeric': array([ 0.,  0.,  0.])} 

        # 

        ''' 

 

        This example uses pixel coordinates. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_toabs(self, *args, **kwargs) 

 

    def toabsmany(self, *args, **kwargs): 

        """ 

        toabsmany(self, value, isworld = -1) -> record 

 

        Summary 

                Convert many numeric relative coordinates to absolute 

 

        Description 

                 

 

        This function converts many relative coordinates to absolute. It exists 

        so you can efficiently make many conversions (which would be rather slow 

        if you did them all with toabs). Because 

        speed is the object, the interface is purely in terms of numeric 

        matrices, rather than being able to accept strings and quanta etc. like 

        toabs can.   

 

        When dealing with world coordinates, the units of the numeric 

        values must be the native units, given by function 

        units. 

 

 

 

        Input Parameters: 

                value            Relative coordinates  

                isworld          Is coordinate world or pixel? Default is unset. -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toabsmany Ex 1         ----' 

        csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        rv = csys.referencevalue();                 # reference value 

        w = csys.torel(rv)                          # make relative 

        inc = csys.increment();                     # increment 

        off=[] 

        for idx in range(100): 

          off.append(inc['numeric'][2]*idx)         # offset for third axis 

        wrel = ia.makearray(0,[3,100])              # 100 conversions each of length 3 

        for i in range(3): 

          for j in range(100): 

            wrel[i][j]=w['numeric'][i] 

        for j in range(100): 

          wrel[2][j] += off[j]                      # Make spectral axis values change 

        wabs  = csys.toabsmany (wrel, T)['numeric'] # Convert 

        print wabs[0][0],wabs[1][0],wabs[2,0]       # First absolute coordinate 

        #0.0 0.0 1415000000.0 

        print wabs[0][99],wabs[1][99],wabs[2][99]   # 100th absolute coordinate 

        #0.0 0.0 1415099000.0 

        # 

        ''' 

 

        This example uses world coordinates. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_toabsmany(self, *args, **kwargs) 

 

    def topixel(self, *args, **kwargs): 

        """ 

        topixel(self, value) -> record 

 

        Summary 

                Convert from absolute world to pixel coordinate 

 

        Description 

                 

 

        This function converts between world (physical) coordinate and absolute pixel 

        coordinate (0-rel). 

 

        The world coordinate can be provided in one of four formats via the 

        argument {\stfaf world}.  These match the output formats of function 

        toworld. 

 

        If you supply fewer world values than there are axes in the  Coordinate 

        System, your coordinate vector will be padded out with the reference 

        value for the missing axes. Excess values will be silently ignored. 

 

        You may supply the world coordinate in all of the formats described in 

        the \htmlref{formatting}{COORDSYS:FORMATTING} discussion. 

 

 

 

        Input Parameters: 

                value            Absolute world coordinate  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     topixel Ex 1   ----' 

        csys = cs.newcoordsys(direction=T, spectral=T, stokes='I V', linear=2) 

        w = csys.toworld([-2,2,1,2,23,24], 'n') 

        print csys.topixel(w) 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 

        # 'numeric': array([ -2.,   2.,   1.,   2.,  23.,  24.])} 

        w = csys.toworld([-2,2,1,2,23,24], 'q') 

        print csys.topixel(w) 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 

        # 'numeric': array([ -2.,   2.,   1.,   2.,  23.,  24.])} 

        w = csys.toworld([-2,2,1,2,23,24], 'm') 

        print csys.topixel(w) 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 

        # 'numeric': array([ -2.,   2.,   1.,   2.,  23.,  24.])} 

        w = csys.toworld([-2,2,1,2,23,24], 's') 

        print cs.topixel(w) 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 

        # 'numeric': array([ -2.,   2.,   1.,   2.,  23.,  24.])} 

        w = csys.toworld([-2,2,1,2,23,24], 'mnq') 

        print cs.topixel(w)                             

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 

        # 'numeric': array([ -2.,   2.,   1.,   2.,  23.,  24.])} 

        # 

        ''' 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     topixel Ex 2   ----' 

        csys = cs.newcoordsys (stokes='I V', linear=2) 

        print csys.toworld([0,1,2], 's') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['I', '1.00000000e+00 km', '2.00000000e+00 km'], 

        #  dtype='|S18')} 

        print csys.toworld([0,1,2], 'm') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'measure': {'stokes': 'I', 'linear': {'*1': {'value': 1.0, 'unit': 'km'}, 

        # '*2': {'value': 2.0, 'unit': 'km'}}}} 

        print csys.toworld([0,1,2], 'q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 1.0, 'unit': ''}, 

        # '*2': {'value': 1.0, 'unit': 'km'}, '*3': {'value': 2.0, 'unit': 'km'}}} 

        # 

        ''' 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     topixel Ex 3   ----' 

        csys = cs.newcoordsys (spectral=T, linear=1) 

        print csys.toworld([0,1,2], 'q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 1415000000.0, 'unit': 'Hz'}, 

        # '*2': {'value': 1.0, 'unit': 'km'}}} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_topixel(self, *args, **kwargs) 

 

    def topixelmany(self, *args, **kwargs): 

        """ 

        topixelmany(self, value) -> record 

 

        Summary 

                Convert many absolute numeric world coordinates to pixel 

 

        Description 

                 

 

        This function converts many absolute world coordinates to pixel coordinates. It exists 

        so you can efficiently make many conversions (which would be rather slow 

        if you did them all with topixel). Because 

        speed is the object, the interface is purely in terms of numeric 

        matrices, rather than being able to accept strings and quanta etc. like 

        topixel can.   

 

        The units of the numeric values must be the native units, given by 

        function units. 

 

 

 

        Input Parameters: 

                value            Absolute world coordinates  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     topixelmany Ex 1       ----' 

        csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        rv = csys.referencevalue();                 # reference value 

        inc = csys.increment();                     # increment 

        off = [] 

        for idx in range(100): 

          off.append(inc['numeric'][2] * idx)       # offset for third axis 

        wabs = ia.makearray(0, [3,100])             # 100 conversions each of length 3 

        for i in range(3): 

          for j in range(100): 

            wabs[i][j]=rv['numeric'][i] 

        for j in range(100): 

          wabs[2][j] += off[j]                      # Make spectral axis values change 

        pabs  = csys.topixelmany (wabs)['numeric']; # Convert 

        print pabs[0][0], pabs[1][0], pabs[1][2]    # First absolute pixel coordinate 

        #0.0 0.0 0.0 

        print pabs[0][99], pabs[1][99], pabs[2][99] # 100th absolute pixel coordinate 

        #0.0 0.0 99.0 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_topixelmany(self, *args, **kwargs) 

 

    def torecord(self): 

        """ 

        torecord(self) -> record 

 

        Summary 

                Convert Coordinate System to a record 

 

        Description 

                 

 

        You can convert a Coordinate System to a record with this function. 

        There is also fromrecord 

        to set a Coordinate System from a record. 

 

        These functions  allow 

        Coordsys        ools\ to be used as parameters in the methods of other tools. 

 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     torecord Ex 1  ----' 

        csys = cs.newcoordsys(direction=T, stokes='I Q') 

        rec = csys.torecord(); 

        cs2 = cs.newcoordsys(); 

        print cs2.ncoordinates() 

        #0 

        cs2.fromrecord(rec); 

        print csys.ncoordinates(), cs2.ncoordinates() 

        #2 2 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_torecord(self) 

 

    def subimage(self, *args, **kwargs): 

        """ 

        subimage(self, originshft, newshape = std::vector< int >()) -> record 

 

        Summary 

                delivers a coordinate origin re-referenced for a subimage 

 

        Description 

                 

 

          You can convert a Coordinate System to another coordinatesystem applicable to a 

          subImage. The newshape does not matter as this is the coordinatesystem not the  

          image except for Stokes axis; therefore you can ignore {      t newshape} except  

          when your sub-image you are considering has only a section of your original Stokes  

          axis. 

 

 

 

 

        Input Parameters: 

                originshft       The shift value from original reference (vector of values in pixels)  

                newshape         The new shape of the image it will applicable to (pixel shape)  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     subimage Ex 1  ----' 

        ia.open('original.image') 

        csys = ia.coordsys() 

        imshape=ia.shape() 

        #want to make an empty sub image of the 11th channel 

        #keeping other reference pixel as is 

        refshft=[0,0,0,10] 

        subcoordsysrec=csys.subimage(neworigin=refshft) 

        imshape[3]=1 

        ia.fromshape(outfile='Eleventh_chan_template.image', shape=imshape, csys=subcoordsysrec) 

 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_subimage(self, *args, **kwargs) 

 

    def torel(self, *args, **kwargs): 

        """ 

        torel(self, value, isworld = -1) -> record 

 

        Summary 

                Convert absolute coordinate to relative 

 

        Description 

                 

 

        This function converts an absolute coordinate to a relative coordinate. 

        The coordinate may be a pixel coordinate or a world coordinate. 

 

        Relative coordinates are relative to the reference pixel (pixel coordinates) 

        or the reference value (world coordinates) in the sense  

        $relative = absolute - reference$. 

 

        If the coordinate is a pixel coordinate, it is supplied as a numeric 

        vector. If the coordinate is a world coordinate,  you may give it in all 

        of the formats described in the 

        \htmlref{formatting}{COORDSYS:FORMATTING} discussion. 

 

        If the coordinate value is supplied by a Coordsys       ool\ function (e.g. 

        toworld) then the coordinate 'knows' 

        whether it is world or pixel (and absolute or relative). However, you 

        might supply the value from some other source as a numeric vector (which 

        could be world or pixel) in which case you must specify whether it is a  

        world or pixel coordinate via the {\stfaf isworld} argument. 

 

 

 

        Input Parameters: 

                value            Absolute coordinate  

                isworld          Is coordinate world or pixel? Default is unset. -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     torel Ex 1     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        aw = csys.toworld([99,99,23], 's') 

        rw = csys.torel(aw) 

        aw2 = csys.toabs(rw) 

        print aw 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['23:53:23.78086843', '+01.39.00.82133427', 

        # '1.41502300e+09 Hz'], dtype='|S19')} 

        print rw 

        #{'ar_type': 'relative', 'pw_type': 'world', 

        # 'string': array(['-5.94082202e+03 arcsec', '5.94082133e+03 arcsec', 

        # '2.30000000e+04 Hz'], dtype='|S23')} 

        print aw2 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['23:53:23.78086818', '+01.39.00.82133000', 

        # '1.41502300e+09 Hz'], dtype='|S19')} 

        # 

        ''' 

 

 

        This example uses world coordinates. 

 

 

        ''' 

        # 

        print ' ----     torel Ex 2     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        ap = csys.topixel()           # Reference value 

        rp = csys.torel(ap) 

        ap2 = csys.toabs(rp) 

        print ap 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([ 0.,  0.,  0.])} 

        print rp 

        #{'ar_type': 'relative', 'pw_type': 'pixel', 'numeric': array([ 0.,  0.,  0.])} 

        print ap2 

        #{'ar_type': 'absolute', 'pw_type': 'pixel', 'numeric': array([ 0.,  0.,  0.])} 

        # 

        ''' 

 

        This example uses pixel coordinates. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_torel(self, *args, **kwargs) 

 

    def torelmany(self, *args, **kwargs): 

        """ 

        torelmany(self, value, isworld = -1) -> record 

 

        Summary 

                Convert many numeric absolute coordinates to relative 

 

        Description 

                 

 

        This function converts many absolute coordinates to relative. It exists 

        so you can efficiently make many conversions (which would be rather slow 

        if you did them all with torel). Because 

        speed is the object, the interface is purely in terms of numeric 

        matrices, rather than being able to accept strings and quanta etc. like 

        torel can.   

 

        When dealing with world coordinates, the units of the numeric 

        values must be the native units, given by function 

        units. 

 

 

 

        Input Parameters: 

                value            Absolute coordinates  

                isworld          Is coordinate world or pixel? Default is unset. -1  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     torelmany Ex 1         ----' 

        csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        w = csys.referencevalue();                  # reference value 

        inc = csys.increment();                     # increment 

        off = [] 

        for idx in range(100): 

          off.append(inc['numeric'][2] * idx)       # offset for third axis 

        wabs = ia.makearray(0, [3,100])             # 100 conversions each of length 3 

        for i in range(3): 

          for j in range(100): 

            wabs[i][j] = w['numeric'][i] 

        for j in range(100): 

          wabs[2][j] += off[j]                      # Make spectral axis values change 

        wrel  = cs.torelmany (wabs, T)['numeric']   # Convert 

        print wrel[0][0], wrel[1][0], wrel[2][0]    # First relative coordinate 

        #0.0 0.0 0.0 

        print wrel[0][99], wrel[1][99], wrel[2][99] # 100th relative coordinate 

        #0.0 0.0 99000.0 

        # 

        ''' 

 

        This example uses world coordinates. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_torelmany(self, *args, **kwargs) 

 

    def toworld(self, *args, **kwargs): 

        """ 

        toworld(self, value = initialize_variant(""), format = string("n")) -> record 

 

        Summary 

                Convert from absolute pixel coordinate to world 

 

        Description 

                 

 

        This function converts between absolute pixel coordinate (0-rel) 

        and absolute world (physical coordinate). 

 

        If you supply fewer pixel values than there are axes in the  Coordinate 

        System, your coordinate vector will be padded out with the reference 

        pixel for the missing axes. Excess values will be silently ignored. 

 

        You may ask for the world coordinate in all of the formats described in 

        the \htmlref{discussion}{COORDSYS:FORMATTING} regarding the 

        formatting possibilities available via argument {\stfaf format}. 

 

 

 

        Input Parameters: 

                value            Absolute pixel coordinate. Default is reference pixel.  

                format           Format string: combination of 'n', 'q', 's', 'm' n  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toworld Ex 1   ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.toworld([-3,1,1], 'n') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'numeric': array([  3.00000051e+00,   1.00000001e+00,   1.41500100e+09])} 

        print csys.toworld([-3,1,1], 'q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 3.0000005076962117, 'unit': '''}, 

        #              '*2': {'value': 1.0000000141027674, 'unit': '''}, 

        #              '*3': {'value': 1415001000.0, 'unit': 'Hz'}}} 

        print csys.toworld([-3,1,1], 'm') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 'measure': 

        # {'spectral': {'radiovelocity': {'type': 'doppler', 'm0': {'value': 1140733.0762829871, 'unit': 'm/s'}, 'refer': 'RADIO'}, 

        #             'opticalvelocity': {'type': 'doppler', 'm0': {'value': 1145090.2316004676, 'unit': 'm/s'}, 'refer': 'OPTICAL'}, 

        #                 'frequency': {'type': 'frequency', 'm0': {'value': 1415001000.0, 'unit': 'Hz'}, 'refer': 'LSRK'}, 

        #                'betavelocity': {'type': 'doppler', 'm0': {'value': 1142903.3485169839, 'unit': 'm/s'}, 'refer': 'TRUE'}}, 

        # 'direction': {'type': 'direction', 'm1': {'value': 0.0002908882127680503, 'unit': 'rad'}, 

        #                                    'm0': {'value': 0.00087266477368000634, 'unit': 'rad'}, 'refer': 'J2000'}}} 

        print csys.toworld([-3,1,1], 's') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['00:00:12.00000203', '+00.01.00.00000085', '1.41500100e+09 Hz'], dtype='|S19')} 

        # 

        ''' 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toworld Ex 2   ----' 

        csys = cs.newcoordsys (stokes='I V', linear=2) 

        print csys.toworld([0,1,2], 's') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'string': array(['I', '1.00000000e+00 km', '2.00000000e+00 km'], 

        #      dtype='|S18')} 

        print csys.toworld([0,1,2], 'm') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'measure': {'stokes': 'I', 'linear': {'*1': {'value': 1.0, 'unit': 'km'}, 

        #                                       '*2': {'value': 2.0, 'unit': 'km'}}}} 

        print csys.toworld([0,1,2], 'q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 1.0, 'unit': ''}, 

        #              '*2': {'value': 1.0, 'unit': 'km'}, 

        #              '*3': {'value': 2.0, 'unit': 'km'}}} 

        # 

        ''' 

 

 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toworld Ex 3   ----' 

        csys = cs.newcoordsys (spectral=T, linear=1) 

        print cs.toworld([0,1,2], 'q') 

        #{'ar_type': 'absolute', 'pw_type': 'world', 

        # 'quantity': {'*1': {'value': 1415000000.0, 'unit': 'Hz'}, 

        #              '*2': {'value': 1.0, 'unit': 'km'}}} 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_toworld(self, *args, **kwargs) 

 

    def toworldmany(self, *args, **kwargs): 

        """ 

        toworldmany(self, value) -> record 

 

        Summary 

                Convert many absolute pixel coordinates to numeric world 

 

        Description 

                 

 

        This function converts many absolute pixel coordinates to world coordinates. It exists 

        so you can efficiently make many conversions (which would be rather slow 

        if you did them all with toworld). Because 

        speed is the object, the interface is purely in terms of numeric 

        matrices, rather than being able to produce strings and quanta etc. like 

        toworld can.   

 

        The units of the output world values are the native units given by 

        function units. 

 

 

 

        Input Parameters: 

                value            Absolute pixel coordinates  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     toworldmany Ex 1       ----' 

        csys = cs.newcoordsys(direction=T, spectral=T)    # 3 axes 

        rp = csys.referencepixel()['numeric'];            # reference pixel 

        pabs = ia.makearray(0,[3,100])              # 100 conversions each of length 3 

        for i in range(3): 

          for j in range(100): 

            pabs[i][j] = rp[i] 

        for ioff in range(100):                     # offset for third axis 

          pabs[2][ioff] += ioff;                    # Make spectral axis values change 

        wabs  = csys.toworldmany (pabs)['numeric']; # Convert 

        print wabs[0][0], wabs[1][0], wabs[2][0]    # First absolute pixel coordinate 

        #0.0 0.0 1415000000.0 

        print wabs[0][99], wabs[1][99], wabs[2][99] # 100th absolute pixel coordinate 

        #0.0 0.0 1415099000.0 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_toworldmany(self, *args, **kwargs) 

 

    def type(self): 

        """ 

        type(self) -> string 

 

        Summary 

                Return the type of this tool 

 

        Description 

                 

 

        This function returns the string `coordsys'. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_type(self) 

 

    def units(self, *args, **kwargs): 

        """ 

        units(self, type = string("")) -> std::vector<(std::string)> 

 

        Summary 

                Recover the units for each axis 

 

        Description 

                 

 

        Each axis associated with the Coordinate System has a unit. 

        This function returns those units 

        (in world axis order). 

 

        You can recover the units either for all coordinates (leave {\stfaf 

        type} unset) or for a specific coordinate type (mimumum match of the 

        allowed types will do).  If you ask for a non-existent coordinate an 

        exception is generated. 

 

        You can set the units with function 

        setunits. 

 

 

 

        Input Parameters: 

                type             Coordinate type: 'direction', 'stokes', 'spectral', 'linear' or leave unset for all  

                 

        Example: 

                   

 

        ''' 

        # 

        print ' ----     units Ex 1     ----' 

        csys = cs.newcoordsys(direction=T, spectral=T) 

        print csys.units() 

        #[''', ''', 'Hz'] 

        print csys.units('spec') 

        #Hz 

        # 

        ''' 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_units(self, *args, **kwargs) 

 

    def velocitytofrequency(self, *args, **kwargs): 

        """ 

        velocitytofrequency(self, value, frequnit = string(""), doppler = string("radio"),  

            velunit = string("km/s")) -> std::vector<(double)> 

 

        Summary 

                Convert velocity to frequency 

 

        Description 

                 

 

        This function converts velocities 

        to frequencies. 

 

        The input velocities are specified via a vector of numeric values, a 

        specified unit ({\stfaf velunit}), and a  velocity doppler definition ({\stfaf 

        doppler}). 

 

        The frequencies are returned in a vector for which you specify the 

        units ({\stfaf frequnit}).  If you don't give the unit, it is assumed that  

        the units are those given by function units  

        for the spectral coordinate. 

 

        This function will return a fail if there is no spectral coordinate 

        in the Coordinate System. See also the function 

        frequencytovelocity. 

 

 

 

        Input Parameters: 

                value            Velocity to convert  

                frequnit         Unit of output frequencies. Default is intrinisic units.  

                doppler          Velocity doppler definition radio  

                velunit          Unit of input velocities km/s  

                 

        Example: 

                 

 

        ''' 

        # 

        print ' ----     velocitytofrequency Ex 1       ----' 

        ia.fromshape('hcn.cube',[64,64,32,4], overwrite=true) 

        csys = ia.coordsys() 

        rtn = csys.findcoordinate('spectral')   # Find spectral axis 

        pixel = csys.referencepixel();          # Use reference pixel for non-spectral 

        pa = rtn['pixel'] 

        wa = rtn['world'] 

        nFreq = ia.shape()[pa]                  # Length of spectral axis 

        freq = [] 

        for i in range(nFreq): 

          pixel[pa] = i;                        # Assign value for spectral axis of pixel coordinate 

          w = csys.toworld(value=pixel, format='n')# Convert pixel to world 

          freq.append(w['numeric'][wa])         # Fish out frequency 

        print 'freq=', freq 

        vel = csys.frequencytovelocity(value=freq, doppler='optical', velunit='km/s') 

        freq2 = csys.velocitytofrequency(value=vel, doppler='optical', velunit='km/s') 

        print 'vel=',vel 

        print 'freq2=',freq2 

        csys.done() 

        # 

        exit() # This is last example so exit casapy if you wish. 

        # 

        ''' 

 

 

        In this example, we find the optical velocity in km/s of every pixel 

        along the spectral axis of our image.  First we  obtain the Coordinate 

        System from the image.  Then we find which axis of the Coordinate System 

        (image) pertain to the spectral coordinate.  Then we loop over each 

        pixel of the spectral axis, and convert a pixel coordinate (one for each 

        axis of the image) to world.  We obtain the value for the spectral axis 

        from that world vector, and add it to the vector of frequencies.  Then 

        we convert that vector of frequencies to velocity.  Then we convert it 

        back to frequency.  They better agree. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_velocitytofrequency(self, *args, **kwargs) 

 

    def parentname(self): 

        """ 

        parentname(self) -> string 

 

        Summary 

                Get parent image name. 

 

        Description 

                 

 

        This function returns the parent image name for `coordsys'. 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_parentname(self) 

 

    def setparentname(self, *args, **kwargs): 

        """ 

        setparentname(self, imagename) -> bool 

 

        Summary 

                Set the parent image name (normally not needed by end-users) 

 

        Input Parameters: 

                imagename        String named parent image  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _coordsys.coordsys_setparentname(self, *args, **kwargs) 

 

coordsys_swigregister = _coordsys.coordsys_swigregister 

coordsys_swigregister(coordsys) 

 

# This file is compatible with both classic and new-style classes.