Menu

[r6347]: / trunk / toolkits / natgrid / src / _natgrid.c  Maximize  Restore  History

Download this file

1113 lines (1013 with data), 41.6 kB

   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
/* Generated by Cython 0.9.6.12 on Sun Jul 20 11:01:12 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#endif
#if PY_VERSION_HEX < 0x02040000
#define METH_COEXIST 0
#endif
#ifndef WIN32
#define __stdcall
#define __cdecl
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE
#endif
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
static int __pyx_skip_dispatch = 0;
/* Type Conversion Predeclarations */
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x);
static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b);
#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x))
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x);
static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x);
static INLINE char __pyx_PyInt_char(PyObject* x);
static INLINE short __pyx_PyInt_short(PyObject* x);
static INLINE int __pyx_PyInt_int(PyObject* x);
static INLINE long __pyx_PyInt_long(PyObject* x);
static INLINE signed char __pyx_PyInt_signed_char(PyObject* x);
static INLINE signed short __pyx_PyInt_signed_short(PyObject* x);
static INLINE signed int __pyx_PyInt_signed_int(PyObject* x);
static INLINE signed long __pyx_PyInt_signed_long(PyObject* x);
static INLINE long double __pyx_PyInt_long_double(PyObject* x);
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;
static char __pyx_mdoc[] = "\nPyrex wrapper for NCAR natgrid library for interpolation\nof irregularly spaced data to a grid.\n\ncopyright (c) 2007 by Jeffrey Whitaker.\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notices appear in all copies and that\nboth the copyright notices and this permission notice appear in\nsupporting documentation.\nTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO\nEVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR\nCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF\nUSE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n";
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
/* Declarations from _natgrid */
__PYX_EXTERN_C DL_EXPORT(void) c_nnseti(char *, int); /*proto*/
__PYX_EXTERN_C DL_EXPORT(double) *c_natgridd(int, double *, double *, double *, int, int, double *, double *, int *); /*proto*/
__PYX_EXTERN_C DL_EXPORT(void) c_nnsetr(char *, float); /*proto*/
/* Implementation of _natgrid */
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":32
* char *PyString_AsString(object)
*
* def seti(name, value): # <<<<<<<<<<<<<<
* cdef char *pnam
* cdef int ival
*/
static PyObject *__pyx_pf_8_natgrid_seti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_8_natgrid_seti(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_value = 0;
char *__pyx_v_pnam;
int __pyx_v_ival;
PyObject *__pyx_r;
char *__pyx_1;
int __pyx_2;
static char *__pyx_argnames[] = {"name","value",0};
if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 2)) {
__pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 0);
__pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
}
else {
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_name, &__pyx_v_value))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L2;}
}
goto __pyx_L3;
__pyx_L2:;
return NULL;
__pyx_L3:;
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_value);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":35
* cdef char *pnam
* cdef int ival
* pnam = name; ival = value # <<<<<<<<<<<<<<
* c_nnseti(pnam, ival)
*
*/
__pyx_1 = PyString_AsString(__pyx_v_name); if (unlikely((!__pyx_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
__pyx_v_pnam = __pyx_1;
__pyx_2 = __pyx_PyInt_int(__pyx_v_value); if (unlikely((__pyx_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
__pyx_v_ival = __pyx_2;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":36
* cdef int ival
* pnam = name; ival = value
* c_nnseti(pnam, ival) # <<<<<<<<<<<<<<
*
* def setr(name, value):
*/
c_nnseti(__pyx_v_pnam, __pyx_v_ival);
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("_natgrid.seti");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":38
* c_nnseti(pnam, ival)
*
* def setr(name, value): # <<<<<<<<<<<<<<
* cdef char *pnam
* cdef float fval
*/
static PyObject *__pyx_pf_8_natgrid_setr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_8_natgrid_setr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_value = 0;
char *__pyx_v_pnam;
float __pyx_v_fval;
PyObject *__pyx_r;
char *__pyx_1;
float __pyx_2;
static char *__pyx_argnames[] = {"name","value",0};
if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 2)) {
__pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 0);
__pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
}
else {
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_name, &__pyx_v_value))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L2;}
}
goto __pyx_L3;
__pyx_L2:;
return NULL;
__pyx_L3:;
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_value);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":41
* cdef char *pnam
* cdef float fval
* pnam = name; fval = value # <<<<<<<<<<<<<<
* c_nnsetr(pnam, fval)
*
*/
__pyx_1 = PyString_AsString(__pyx_v_name); if (unlikely((!__pyx_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
__pyx_v_pnam = __pyx_1;
__pyx_2 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
__pyx_v_fval = __pyx_2;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":42
* cdef float fval
* pnam = name; fval = value
* c_nnsetr(pnam, fval) # <<<<<<<<<<<<<<
*
* def natgridd(x, y, z, xo, yo, zo):
*/
c_nnsetr(__pyx_v_pnam, __pyx_v_fval);
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("_natgrid.setr");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":44
* c_nnsetr(pnam, fval)
*
* def natgridd(x, y, z, xo, yo, zo): # <<<<<<<<<<<<<<
* cdef int npnts, numxout, numyout, ier
* cdef Py_ssize_t buflenx, bufleny, buflenz, buflenxo, buflenyo, buflenzo
*/
static PyObject *__pyx_n_RuntimeError;
static PyObject *__pyx_k_1p;
static PyObject *__pyx_k_2p;
static PyObject *__pyx_k_3p;
static PyObject *__pyx_k_4p;
static PyObject *__pyx_k_5p;
static PyObject *__pyx_k_6p;
static PyObject *__pyx_k_7p;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_1[] = "error getting buffer for x";
static char __pyx_k_2[] = "error getting buffer for y";
static char __pyx_k_3[] = "error getting buffer for z";
static char __pyx_k_4[] = "error getting buffer for x";
static char __pyx_k_5[] = "error getting buffer for y";
static char __pyx_k_6[] = "error getting buffer for z";
static char __pyx_k_7[] = "error in natgridd - ier =";
static PyObject *__pyx_pf_8_natgrid_natgridd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_8_natgrid_natgridd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
PyObject *__pyx_v_z = 0;
PyObject *__pyx_v_xo = 0;
PyObject *__pyx_v_yo = 0;
PyObject *__pyx_v_zo = 0;
int __pyx_v_npnts;
int __pyx_v_numxout;
int __pyx_v_numyout;
int __pyx_v_ier;
Py_ssize_t __pyx_v_buflenx;
Py_ssize_t __pyx_v_bufleny;
Py_ssize_t __pyx_v_buflenz;
Py_ssize_t __pyx_v_buflenxo;
Py_ssize_t __pyx_v_buflenyo;
Py_ssize_t __pyx_v_buflenzo;
void *__pyx_v_xp;
void *__pyx_v_yp;
void *__pyx_v_zp;
void *__pyx_v_xop;
void *__pyx_v_yop;
void *__pyx_v_zop;
double *__pyx_v_xd;
double *__pyx_v_yd;
double *__pyx_v_zd;
double *__pyx_v_xod;
double *__pyx_v_yod;
double *__pyx_v_zod;
double *__pyx_v_out;
PyObject *__pyx_v_i;
PyObject *__pyx_r;
Py_ssize_t __pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
long __pyx_5;
Py_ssize_t __pyx_6 = 0;
Py_ssize_t __pyx_7 = 0;
static char *__pyx_argnames[] = {"x","y","z","xo","yo","zo",0};
if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 6)) {
__pyx_v_x = PyTuple_GET_ITEM(__pyx_args, 0);
__pyx_v_y = PyTuple_GET_ITEM(__pyx_args, 1);
__pyx_v_z = PyTuple_GET_ITEM(__pyx_args, 2);
__pyx_v_xo = PyTuple_GET_ITEM(__pyx_args, 3);
__pyx_v_yo = PyTuple_GET_ITEM(__pyx_args, 4);
__pyx_v_zo = PyTuple_GET_ITEM(__pyx_args, 5);
}
else {
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOO", __pyx_argnames, &__pyx_v_x, &__pyx_v_y, &__pyx_v_z, &__pyx_v_xo, &__pyx_v_yo, &__pyx_v_zo))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L2;}
}
goto __pyx_L3;
__pyx_L2:;
return NULL;
__pyx_L3:;
Py_INCREF(__pyx_v_x);
Py_INCREF(__pyx_v_y);
Py_INCREF(__pyx_v_z);
Py_INCREF(__pyx_v_xo);
Py_INCREF(__pyx_v_yo);
Py_INCREF(__pyx_v_zo);
__pyx_v_i = Py_None; Py_INCREF(Py_None);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":49
* cdef void *xp, *yp, *zp, *xop, *yop, *zop
* cdef double *xd, *yd, *zd, *xod, *yod, *zod, *out
* npnts = len(x) # <<<<<<<<<<<<<<
* numxout = len(xo)
* numyout = len(yo)
*/
__pyx_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
__pyx_v_npnts = __pyx_1;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":50
* cdef double *xd, *yd, *zd, *xod, *yod, *zod, *out
* npnts = len(x)
* numxout = len(xo) # <<<<<<<<<<<<<<
* numyout = len(yo)
* if PyObject_AsWriteBuffer(x, &xp, &buflenx) <> 0:
*/
__pyx_1 = PyObject_Length(__pyx_v_xo); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_v_numxout = __pyx_1;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":51
* npnts = len(x)
* numxout = len(xo)
* numyout = len(yo) # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(x, &xp, &buflenx) <> 0:
* raise RuntimeError('error getting buffer for x')
*/
__pyx_1 = PyObject_Length(__pyx_v_yo); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_v_numyout = __pyx_1;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":52
* numxout = len(xo)
* numyout = len(yo)
* if PyObject_AsWriteBuffer(x, &xp, &buflenx) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(y, &yp, &bufleny) <> 0:
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_x, (&__pyx_v_xp), (&__pyx_v_buflenx)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":53
* numyout = len(yo)
* if PyObject_AsWriteBuffer(x, &xp, &buflenx) <> 0:
* raise RuntimeError('error getting buffer for x') # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(y, &yp, &bufleny) <> 0:
* raise RuntimeError('error getting buffer for y')
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
Py_INCREF(__pyx_k_1p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_1p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":54
* if PyObject_AsWriteBuffer(x, &xp, &buflenx) <> 0:
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(y, &yp, &bufleny) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(z, &zp, &buflenz) <> 0:
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_y, (&__pyx_v_yp), (&__pyx_v_bufleny)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":55
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(y, &yp, &bufleny) <> 0:
* raise RuntimeError('error getting buffer for y') # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(z, &zp, &buflenz) <> 0:
* raise RuntimeError('error getting buffer for z')
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
Py_INCREF(__pyx_k_2p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_2p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":56
* if PyObject_AsWriteBuffer(y, &yp, &bufleny) <> 0:
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(z, &zp, &buflenz) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for z')
* xd = <double *>xp
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_z, (&__pyx_v_zp), (&__pyx_v_buflenz)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":57
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(z, &zp, &buflenz) <> 0:
* raise RuntimeError('error getting buffer for z') # <<<<<<<<<<<<<<
* xd = <double *>xp
* yd = <double *>yp
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
Py_INCREF(__pyx_k_3p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_3p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":58
* if PyObject_AsWriteBuffer(z, &zp, &buflenz) <> 0:
* raise RuntimeError('error getting buffer for z')
* xd = <double *>xp # <<<<<<<<<<<<<<
* yd = <double *>yp
* zd = <double *>zp
*/
__pyx_v_xd = ((double *)__pyx_v_xp);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":59
* raise RuntimeError('error getting buffer for z')
* xd = <double *>xp
* yd = <double *>yp # <<<<<<<<<<<<<<
* zd = <double *>zp
* if PyObject_AsWriteBuffer(xo, &xop, &buflenxo) <> 0:
*/
__pyx_v_yd = ((double *)__pyx_v_yp);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":60
* xd = <double *>xp
* yd = <double *>yp
* zd = <double *>zp # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(xo, &xop, &buflenxo) <> 0:
* raise RuntimeError('error getting buffer for x')
*/
__pyx_v_zd = ((double *)__pyx_v_zp);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":61
* yd = <double *>yp
* zd = <double *>zp
* if PyObject_AsWriteBuffer(xo, &xop, &buflenxo) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(yo, &yop, &buflenyo) <> 0:
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_xo, (&__pyx_v_xop), (&__pyx_v_buflenxo)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":62
* zd = <double *>zp
* if PyObject_AsWriteBuffer(xo, &xop, &buflenxo) <> 0:
* raise RuntimeError('error getting buffer for x') # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(yo, &yop, &buflenyo) <> 0:
* raise RuntimeError('error getting buffer for y')
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
Py_INCREF(__pyx_k_4p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_4p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
goto __pyx_L7;
}
__pyx_L7:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":63
* if PyObject_AsWriteBuffer(xo, &xop, &buflenxo) <> 0:
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(yo, &yop, &buflenyo) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(zo, &zop, &buflenzo) <> 0:
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_yo, (&__pyx_v_yop), (&__pyx_v_buflenyo)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":64
* raise RuntimeError('error getting buffer for x')
* if PyObject_AsWriteBuffer(yo, &yop, &buflenyo) <> 0:
* raise RuntimeError('error getting buffer for y') # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(zo, &zop, &buflenzo) <> 0:
* raise RuntimeError('error getting buffer for z')
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
Py_INCREF(__pyx_k_5p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_5p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
goto __pyx_L8;
}
__pyx_L8:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":65
* if PyObject_AsWriteBuffer(yo, &yop, &buflenyo) <> 0:
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(zo, &zop, &buflenzo) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error getting buffer for z')
* xod = <double *>xop
*/
__pyx_2 = (PyObject_AsWriteBuffer(__pyx_v_zo, (&__pyx_v_zop), (&__pyx_v_buflenzo)) != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":66
* raise RuntimeError('error getting buffer for y')
* if PyObject_AsWriteBuffer(zo, &zop, &buflenzo) <> 0:
* raise RuntimeError('error getting buffer for z') # <<<<<<<<<<<<<<
* xod = <double *>xop
* yod = <double *>yop
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
Py_INCREF(__pyx_k_6p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k_6p);
__pyx_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
goto __pyx_L9;
}
__pyx_L9:;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":67
* if PyObject_AsWriteBuffer(zo, &zop, &buflenzo) <> 0:
* raise RuntimeError('error getting buffer for z')
* xod = <double *>xop # <<<<<<<<<<<<<<
* yod = <double *>yop
* zod = <double *>zop
*/
__pyx_v_xod = ((double *)__pyx_v_xop);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":68
* raise RuntimeError('error getting buffer for z')
* xod = <double *>xop
* yod = <double *>yop # <<<<<<<<<<<<<<
* zod = <double *>zop
* # output overwrites zo.
*/
__pyx_v_yod = ((double *)__pyx_v_yop);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":69
* xod = <double *>xop
* yod = <double *>yop
* zod = <double *>zop # <<<<<<<<<<<<<<
* # output overwrites zo.
* out = c_natgridd(npnts, yd, xd, zd, numyout, numxout, yod, xod, &ier)
*/
__pyx_v_zod = ((double *)__pyx_v_zop);
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":71
* zod = <double *>zop
* # output overwrites zo.
* out = c_natgridd(npnts, yd, xd, zd, numyout, numxout, yod, xod, &ier) # <<<<<<<<<<<<<<
* for i from 0 <= i < buflenzo/8:
* zod[i] = out[i]
*/
__pyx_v_out = c_natgridd(__pyx_v_npnts, __pyx_v_yd, __pyx_v_xd, __pyx_v_zd, __pyx_v_numyout, __pyx_v_numxout, __pyx_v_yod, __pyx_v_xod, (&__pyx_v_ier));
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":72
* # output overwrites zo.
* out = c_natgridd(npnts, yd, xd, zd, numyout, numxout, yod, xod, &ier)
* for i from 0 <= i < buflenzo/8: # <<<<<<<<<<<<<<
* zod[i] = out[i]
* if ier != 0:
*/
__pyx_1 = (__pyx_v_buflenzo / 8);
for (__pyx_5 = 0; __pyx_5 < __pyx_1; __pyx_5++) {
__pyx_3 = PyInt_FromLong(__pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_3;
__pyx_3 = 0;
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":73
* out = c_natgridd(npnts, yd, xd, zd, numyout, numxout, yod, xod, &ier)
* for i from 0 <= i < buflenzo/8:
* zod[i] = out[i] # <<<<<<<<<<<<<<
* if ier != 0:
* raise RuntimeError('error in natgridd - ier ='%ier)
*/
__pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
__pyx_7 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
(__pyx_v_zod[__pyx_7]) = (__pyx_v_out[__pyx_6]);
}
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":74
* for i from 0 <= i < buflenzo/8:
* zod[i] = out[i]
* if ier != 0: # <<<<<<<<<<<<<<
* raise RuntimeError('error in natgridd - ier ='%ier)
*/
__pyx_2 = (__pyx_v_ier != 0);
if (__pyx_2) {
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":75
* zod[i] = out[i]
* if ier != 0:
* raise RuntimeError('error in natgridd - ier ='%ier) # <<<<<<<<<<<<<<
*/
__pyx_4 = PyInt_FromLong(__pyx_v_ier); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
__pyx_3 = PyNumber_Remainder(__pyx_k_7p, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
goto __pyx_L12;
}
__pyx_L12:;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_natgrid.natgridd");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_i);
Py_DECREF(__pyx_v_x);
Py_DECREF(__pyx_v_y);
Py_DECREF(__pyx_v_z);
Py_DECREF(__pyx_v_xo);
Py_DECREF(__pyx_v_yo);
Py_DECREF(__pyx_v_zo);
return __pyx_r;
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_RuntimeError, "RuntimeError"},
{0, 0}
};
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k_1p, __pyx_k_1, sizeof(__pyx_k_1), 0},
{&__pyx_k_2p, __pyx_k_2, sizeof(__pyx_k_2), 0},
{&__pyx_k_3p, __pyx_k_3, sizeof(__pyx_k_3), 0},
{&__pyx_k_4p, __pyx_k_4, sizeof(__pyx_k_4), 0},
{&__pyx_k_5p, __pyx_k_5, sizeof(__pyx_k_5), 0},
{&__pyx_k_6p, __pyx_k_6, sizeof(__pyx_k_6), 0},
{&__pyx_k_7p, __pyx_k_7, sizeof(__pyx_k_7), 0},
{0, 0, 0, 0}
};
static struct PyMethodDef __pyx_methods[] = {
{"seti", (PyCFunction)__pyx_pf_8_natgrid_seti, METH_VARARGS|METH_KEYWORDS, 0},
{"setr", (PyCFunction)__pyx_pf_8_natgrid_setr, METH_VARARGS|METH_KEYWORDS, 0},
{"natgridd", (PyCFunction)__pyx_pf_8_natgrid_natgridd, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};
static void __pyx_init_filenames(void); /*proto*/
PyMODINIT_FUNC init_natgrid(void); /*proto*/
PyMODINIT_FUNC init_natgrid(void) {
/*--- Libary function declarations ---*/
__pyx_init_filenames();
/*--- Module creation code ---*/
__pyx_m = Py_InitModule4("_natgrid", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_b = PyImport_AddModule("__builtin__");
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Intern code ---*/
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- String init code ---*/
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Builtin init code ---*/
__pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
__pyx_skip_dispatch = 0;
/*--- Global init code ---*/
/*--- Function export code ---*/
/*--- Function import code ---*/
/*--- Type init code ---*/
/*--- Type import code ---*/
/*--- Execution code ---*/
/* "/Users/jwhitaker/python/matplotlib/lib/natgrid/src/_natgrid.pyx":44
* c_nnsetr(pnam, fval)
*
* def natgridd(x, y, z, xo, yo, zo): # <<<<<<<<<<<<<<
* cdef int npnts, numxout, numyout, ier
* cdef Py_ssize_t buflenx, bufleny, buflenz, buflenxo, buflenyo, buflenzo
*/
return;
__pyx_L1:;
__Pyx_AddTraceback("_natgrid");
}
static char *__pyx_filenames[] = {
"_natgrid.pyx",
};
/* Runtime support code */
static void __pyx_init_filenames(void) {
__pyx_f = __pyx_filenames;
}
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result;
result = PyObject_GetAttr(dict, name);
if (!result)
PyErr_SetObject(PyExc_NameError, name);
return result;
}
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
/* First, check the traceback argument, replacing None with NULL. */
if (tb == Py_None) {
Py_DECREF(tb);
tb = 0;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
/* Next, replace a missing value with None */
if (value == NULL) {
value = Py_None;
Py_INCREF(value);
}
#if PY_VERSION_HEX < 0x02050000
if (!PyClass_Check(type))
#else
if (!PyType_Check(type))
#endif
{
/* Raising an instance. The value should be a dummy. */
if (value != Py_None) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
/* Normalize to raise <class>, <instance> */
Py_DECREF(value);
value = type;
#if PY_VERSION_HEX < 0x02050000
if (PyInstance_Check(type)) {
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
else {
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
}
#else
type = (PyObject*) type->ob_type;
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
#endif
}
PyErr_Restore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
while (t->p) {
*t->p = PyString_InternFromString(t->s);
if (!*t->p)
return -1;
++t;
}
return 0;
}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
if (!*t->p)
return -1;
++t;
}
return 0;
}
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_srcfile = PyString_FromString(__pyx_filename);
if (!py_srcfile) goto bad;
py_funcname = PyString_FromString(funcname);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
empty_string = PyString_FromString("");
if (!empty_string) goto bad;
py_code = PyCode_New(
0, /*int argcount,*/
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
empty_string, /*PyObject *code,*/
__pyx_empty_tuple, /*PyObject *consts,*/
__pyx_empty_tuple, /*PyObject *names,*/
__pyx_empty_tuple, /*PyObject *varnames,*/
__pyx_empty_tuple, /*PyObject *freevars,*/
__pyx_empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
empty_string /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = __pyx_lineno;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
/* Type Conversion Functions */
static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject* x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1;
else if (x == Py_False) return 0;
else return PyObject_IsTrue(x);
}
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
if (PyInt_CheckExact(x)) {
return PyInt_AS_LONG(x);
}
else if (PyLong_CheckExact(x)) {
return PyLong_AsLongLong(x);
}
else {
PY_LONG_LONG val;
PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
val = __pyx_PyInt_AsLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
if (PyInt_CheckExact(x)) {
long val = PyInt_AS_LONG(x);
if (unlikely(val < 0)) {
PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type.");
return (unsigned PY_LONG_LONG)-1;
}
return val;
}
else if (PyLong_CheckExact(x)) {
return PyLong_AsUnsignedLongLong(x);
}
else {
PY_LONG_LONG val;
PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
val = __pyx_PyInt_AsUnsignedLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) {
if (sizeof(unsigned char) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
unsigned char val = (unsigned char)long_val;
if (unlikely((val != long_val) || (long_val < 0))) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char");
return (unsigned char)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) {
if (sizeof(unsigned short) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
unsigned short val = (unsigned short)long_val;
if (unlikely((val != long_val) || (long_val < 0))) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short");
return (unsigned short)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE char __pyx_PyInt_char(PyObject* x) {
if (sizeof(char) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
char val = (char)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to char");
return (char)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE short __pyx_PyInt_short(PyObject* x) {
if (sizeof(short) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
short val = (short)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to short");
return (short)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE int __pyx_PyInt_int(PyObject* x) {
if (sizeof(int) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
int val = (int)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to int");
return (int)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE long __pyx_PyInt_long(PyObject* x) {
if (sizeof(long) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
long val = (long)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to long");
return (long)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) {
if (sizeof(signed char) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
signed char val = (signed char)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char");
return (signed char)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) {
if (sizeof(signed short) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
signed short val = (signed short)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short");
return (signed short)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) {
if (sizeof(signed int) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
signed int val = (signed int)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int");
return (signed int)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) {
if (sizeof(signed long) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
signed long val = (signed long)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long");
return (signed long)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
static INLINE long double __pyx_PyInt_long_double(PyObject* x) {
if (sizeof(long double) < sizeof(long)) {
long long_val = __pyx_PyInt_AsLong(x);
long double val = (long double)long_val;
if (unlikely((val != long_val) )) {
PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double");
return (long double)-1;
}
return val;
}
else {
return __pyx_PyInt_AsLong(x);
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.