Changeset 5541 for anuga_core/source/anuga/shallow_water
- Timestamp:
- Jul 21, 2008, 12:30:26 PM (16 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r5539 r5541 4876 4876 if permutation is None: 4877 4877 permutation = ensure_numeric([], Float) 4878 4878 4879 4879 # Call underlying C implementation urs2sts_ext.c 4880 4880 data=read_mux2(numSrc,filenames,weights,file_params,permutation,verbose) … … 5061 5061 permutation = None 5062 5062 5063 5063 5064 #print 'permutation', permutation 5064 5065 # Read MUX2 files 5065 5066 if (verbose): print 'reading mux2 file' -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5539 r5541 6626 6626 y = points[:,1] 6627 6627 6628 #print 6629 #print x 6630 #print y 6628 6631 for i, index in enumerate(permutation): 6629 6632 # Check that STS points are stored in the correct order … … 6632 6635 zone, e, n = redfearn(lat_long_points[index][0], 6633 6636 lat_long_points[index][1]) 6634 6637 6638 #print i, [x[i],y[i]], [e,n] 6635 6639 assert allclose([x[i],y[i]], [e,n]) 6636 6640 … … 8940 8944 if __name__ == "__main__": 8941 8945 8946 #suite = unittest.makeSuite(Test_Data_Manager,'test') 8947 #suite = unittest.makeSuite(Test_Data_Manager,'test_urs2sts_read_mux2_pyI') 8942 8948 suite = unittest.makeSuite(Test_Data_Manager,'test') 8943 #suite = unittest.makeSuite(Test_Data_Manager,'test_urs2sts_read_mux2_pyI')8944 #suite = unittest.makeSuite(Test_Data_Manager,'test_urs2sts')8945 8949 #suite = unittest.makeSuite(Test_Data_Manager,'test_get_flow_through_cross_section_with_geo') 8946 8950 #suite = unittest.makeSuite(Test_Data_Manager,'covered_') -
anuga_core/source/anuga/shallow_water/urs_ext.c
r5539 r5541 33 33 double *params, 34 34 int *number_of_stations, 35 int*permutation,35 long *permutation, 36 36 int verbose); 37 37 … … 74 74 // Convert Python arguments to C 75 75 if (!PyArg_ParseTuple(args, "iOOOOi", 76 &numSrc, &filenames, &pyweights, &file_params, &permutation, &verbose)) 76 &numSrc, &filenames, &pyweights, &file_params, 77 &permutation, &verbose)) 77 78 { 78 79 PyErr_SetString(PyExc_RuntimeError, … … 155 156 (double*)file_params->data, 156 157 &number_of_selected_stations, // Desired number of stations 157 ( int*) permutation->data, // Ordering of selected stations158 (long*) permutation->data, // Ordering of selected stations 158 159 verbose); 159 160 … … 207 208 dimensions[0] = number_of_selected_stations; 208 209 dimensions[1] = num_ts + POFFSET; 210 209 211 pydata = (PyArrayObject*)PyArray_FromDims(2, dimensions, PyArray_DOUBLE); 210 212 if(pydata == NULL) … … 264 266 double *params, 265 267 int *number_of_stations, 266 int*permutation,268 long *permutation, 267 269 int verbose) 268 270 { … … 404 406 405 407 // Create the Identity permutation vector 406 permutation = ( int *) malloc(number_of_selected_stations*sizeof(int));408 permutation = (long *) malloc(number_of_selected_stations*sizeof(long)); 407 409 for (i = 0; i < number_of_selected_stations; i++) 408 410 { 409 permutation[i] = i; 410 } 411 } 412 413 411 permutation[i] = (long) i; 412 } 413 } 414 415 /* 416 printf("number_of_selected_stations = %d\n", number_of_selected_stations); 417 for (i = 0; i < number_of_selected_stations; i++) { 418 printf("permutation[%d] = %d\n", i, (int) permutation[i]); 419 } 420 */ 421 422 414 423 415 424 /* Make array(s) to hold demuxed data for stations given in the permutation file */ … … 433 442 } 434 443 435 ista = permutation[i]; // Get global index into mux data444 ista = (int) permutation[i]; // Get global index into mux data 436 445 437 446 sts_data[i][mytgs0[0].nt] = (float)mytgs0[ista].geolat; … … 477 486 { 478 487 479 ista = permutation[i]; // Get global index into mux data488 ista = (int) permutation[i]; // Get global index into mux data 480 489 481 490 /* fill the data0 array from the mux file, and weight it */
Note: See TracChangeset
for help on using the changeset viewer.