Changeset 8149
- Timestamp:
- Mar 11, 2011, 7:11:06 PM (14 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/file_function.py
r8125 r8149 162 162 163 163 164 ##165 # @brief ??166 # @param filename Name of .sww or .tms file.167 # @param domain Associated domain object.168 # @param quantities Name of quantity to be interpolated or a list of names.169 # @param interpolation_points List of absolute UTM coordinates for points170 # (N x 2) or geospatial object or171 # points file name at which values are sought.172 # @param time_thinning173 # @param verbose True if this function is to be verbose.174 # @param use_cache True means that caching of intermediate result is attempted.175 # @param boundary_polygon176 164 def _file_function(filename, 177 165 quantities=None, … … 218 206 219 207 220 ##221 # @brief ??222 # @param filename Name of .sww or .tms file.223 # @param quantity_names Name of quantity to be interpolated or a list of names.224 # @param interpolation_points List of absolute UTM coordinates for points225 # (N x 2) or geospatial object or226 # points file name at which values are sought.227 # @param domain_starttime Start time from domain object.228 # @param time_thinning ??229 # @param verbose True if this function is to be verbose.230 # @param boundary_polygon ??231 # @return A callable object.232 208 def get_netcdf_file_function(filename, 233 209 quantity_names=None, -
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py
r8124 r8149 78 78 79 79 80 ##81 # @brief Take gauge readings, given a gauge file and a sww mesh82 #83 # Use this function to take a timeseries sample, given a list of gauge points84 # @param sww_file sww file to use as input85 # @param gauge_file gauge file as input, containing list of gauge points to sample86 # @param out_name output file prefix87 # @param quantities which quantities in the sww file we want to export88 # @param verbose show extra logging information for debug purposes89 # @param use_cache cache requests if possible, for speed90 # @param output_centroids Set to true to output the values at the centroid of the mesh triangle91 80 def sww2csv_gauges(sww_file, 92 81 gauge_file, … … 258 247 msg = 'gauge' + point_name[point_i] + 'falls off the mesh in file ' + sww_file + '.' 259 248 log.warning(msg) 260 ##261 # @brief Read a .sww file and plot the time series.262 # @param swwfiles Dictionary of .sww files.263 # @param gauge_filename Name of gauge file.264 # @param production_dirs ??265 # @param report If True, write figures to report directory.266 # @param reportname Name of generated report (if any).267 # @param plot_quantity List containing quantities to plot.268 # @param generate_fig If True, generate figures as well as CSV files.269 # @param surface If True, then generate solution surface with 3d plot.270 # @param time_min Beginning of user defined time range for plotting purposes.271 # @param time_max End of user defined time range for plotting purposes.272 # @param time_thinning ??273 # @param time_unit ??274 # @param title_on If True, export standard graphics with title.275 # @param use_cache If True, use caching.276 # @param verbose If True, this function is verbose.277 249 def sww2timeseries(swwfiles, 278 250 gauge_filename, … … 412 384 413 385 414 ##415 # @brief Read a .sww file and plot the time series.416 # @param swwfiles Dictionary of .sww files.417 # @param gauge_filename Name of gauge file.418 # @param production_dirs ??419 # @param report If True, write figures to report directory.420 # @param reportname Name of generated report (if any).421 # @param plot_quantity List containing quantities to plot.422 # @param generate_fig If True, generate figures as well as CSV files.423 # @param surface If True, then generate solution surface with 3d plot.424 # @param time_min Beginning of user defined time range for plotting purposes.425 # @param time_max End of user defined time range for plotting purposes.426 # @param time_thinning ??427 # @param time_unit ??428 # @param title_on If True, export standard graphics with title.429 # @param use_cache If True, use caching.430 # @param verbose If True, this function is verbose.431 386 def _sww2timeseries(swwfiles, 432 387 gauge_filename, … … 569 524 570 525 571 ##572 # @brief Read gauge info from a file.573 # @param filename The name of the file to read.574 # @return A (gauges, gaugelocation, elev) tuple.575 526 def gauge_get_from_file(filename): 576 527 """ Read in gauge information from file … … 649 600 650 601 651 ##652 # @brief Generate figures from quantities and gauges for each sww file.653 # This is a legacy function, used only by sww2timeseries654 # @param plot_quantity ??655 # @param file_loc ??656 # @param report ??657 # @param reportname ??658 # @param surface ??659 # @param leg_label ??660 # @param f_list ??661 # @param gauges ??662 # @param locations ??663 # @param elev ??664 # @param gauge_index ??665 # @param production_dirs ??666 # @param time_min ??667 # @param time_max ??668 # @param time_unit ??669 # @param title_on ??670 # @param label_id ??671 # @param generate_fig ??672 # @param verbose??673 # @return (texfile2, elev_output)674 602 def _generate_figures(plot_quantity, file_loc, report, reportname, surface, 675 603 leg_label, f_list, gauges, locations, elev, gauge_index, -
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r8125 r8149 31 31 32 32 33 ##34 # @brief Implement values at each triangular element.35 33 class Quantity: 36 34 37 ##38 # @brief Construct values art each triangular element.39 # @param domain ??40 # @param vertex_values ??41 35 def __init__(self, domain, vertex_values=None): 42 36 from anuga.abstract_2d_finite_volumes.generic_domain \ … … 230 224 ############################################################################ 231 225 232 ##233 # @brief Set default beta value for limiting.234 # @param beta ??235 226 def set_beta(self, beta): 236 227 """Set default beta value for limiting """ … … 243 234 self.beta = beta 244 235 245 ##246 # @brief Get the current beta value.247 # @return The current beta value.248 236 def get_beta(self): 249 237 """Get default beta value for limiting""" … … 251 239 return self.beta 252 240 253 ##254 # @brief Compute interpolated values at edges and centroid.255 # @note vertex_values must be set before calling this.256 241 def interpolate(self): 257 242 """Compute interpolated values at edges and centroid … … 274 259 self.interpolate_from_vertices_to_edges() 275 260 276 ##277 # @brief ??278 261 def interpolate_from_vertices_to_edges(self): 279 262 # Call correct module function (either from this module or C-extension) 280 263 interpolate_from_vertices_to_edges(self) 281 264 282 ##283 # @brief ??284 265 def interpolate_from_edges_to_vertices(self): 285 266 # Call correct module function (either from this module or C-extension) … … 290 271 #--------------------------------------------- 291 272 292 ##293 # @brief Set values for quantity based on different sources.294 # @param numeric A num array, list or constant value.295 # @param quantity Another Quantity.296 # @param function Any callable object that takes two 1d arrays.297 # @param geospatial_data Arbitrary instance of class Geospatial_data298 # @param filename Path to a points file.299 # @param attribute_name If specified any array using that name will be used.300 # @param alpha Smoothing parameter to be used with fit_interpolate.fit.301 # @param location Where to store values (vertices, edges, centroids).302 # @param polygon Restrict update to locations that fall inside polygon.303 # @param indices Restrict update to locations specified by this.304 # @param smooth If True, smooth vertex values.305 # @param verbose True if this method is to be verbose.306 # @param use_cache If True cache results for fit_interpolate.fit.307 # @note Exactly one of 'numeric', 'quantity', 'function', 'filename'308 # must be present.309 273 def set_values(self, numeric=None, # List, numeric array or constant 310 274 quantity=None, # Another quantity … … 528 492 ############################################################################ 529 493 530 ##531 # @brief Set quantity values from specified constant.532 # @param X The constant to set quantity values to.533 # @param location534 # @param indices535 # @param verbose536 494 def set_values_from_constant(self, X, location, indices, verbose): 537 495 """Set quantity values from specified constant X""" … … 576 534 self.vertex_values[i_vertex] = X 577 535 578 ##579 # @brief Set values for a quantity.580 # @param values Array of values.581 # @param location Where values are to be stored.582 # @param indices Limit update to these indices.583 # @param use_cache ??584 # @param verbose True if this method is to be verbose.585 536 def set_values_from_array(self, values, 586 537 location='vertices', … … 667 618 raise Exception(msg) 668 619 669 ##670 # @brief Set quantity values from a specified quantity instance.671 # @param q The quantity instance to take values from.672 # @param location IGNORED, 'vertices' ALWAYS USED!673 # @param indices ??674 # @param verbose True if this method is to be verbose.675 620 def set_values_from_quantity(self, q, location, indices, verbose): 676 621 """Set quantity values from specified quantity instance q … … 690 635 indices=indices, verbose=verbose) 691 636 692 ##693 # @brief Set quantity values from a specified quantity instance.694 # @param f Callable that takes two 1d array -> 1d array.695 # @param location Where values are to be stored.696 # @param indices ??697 # @param use_cache ??698 # @param verbose True if this method is to be verbose.699 637 def set_values_from_function(self, 700 638 f, … … 771 709 raise Exception('Not implemented: %s' % location) 772 710 773 ##774 # @brief Set values based on geo referenced geospatial data object.775 # @param geospatial_data ??776 # @param alpha ??777 # @param location ??778 # @param indices ??779 # @param verbose ??780 # @param use_cache ??781 711 def set_values_from_geospatial_data(self, 782 712 geospatial_data, … … 827 757 use_cache=use_cache, verbose=verbose) 828 758 829 ##830 # @brief Set quantity values from arbitray data points.831 # @param points ??832 # @param values ??833 # @param alpha ??834 # @param location ??835 # @param indices ??836 # @param data_georef ??837 # @param verbose True if this method is to be verbose.838 # @param use_cache ??839 759 def set_values_from_points(self, 840 760 points, … … 850 770 raise Exception('set_values_from_points is obsolete, use geospatial data object instead') 851 771 852 ##853 # @brief Set quantity based on arbitrary points in a points file.854 # @param filename Path to the points file.855 # @param attribute_name856 # @param alpha857 # @param location858 # @param indices859 # @param verbose True if this method is to be verbose.860 # @param use_cache861 # @param max_read_lines862 772 def set_values_from_file(self, 863 773 filename, … … 919 829 verbose=verbose) 920 830 921 ##922 # @brief Get index for maximum or minimum value of quantity.923 # @param mode Either 'max' or 'min'.924 # @param indices Set of IDs of elements to work on.925 831 def get_extremum_index(self, mode=None, indices=None): 926 832 """Return index for maximum or minimum value of quantity (on centroids) … … 956 862 return indices[i] 957 863 958 ##959 # @brief Get index for maximum value of quantity.960 # @param indices Set of IDs of elements to work on.961 864 def get_maximum_index(self, indices=None): 962 865 """See get extreme index for details""" … … 964 867 return self.get_extremum_index(mode='max', indices=indices) 965 868 966 ##967 # @brief Return maximum value of quantity (on centroids).968 # @param indices Set of IDs of elements to work on.969 869 def get_maximum_value(self, indices=None): 970 870 """Return maximum value of quantity (on centroids) … … 985 885 return V[i] 986 886 987 ##988 # @brief Get location of maximum value of quantity (on centroids).989 # @param indices Set of IDs of elements to work on.990 887 def get_maximum_location(self, indices=None): 991 888 """Return location of maximum value of quantity (on centroids) … … 1010 907 return x, y 1011 908 1012 ##1013 # @brief Get index for minimum value of quantity.1014 # @param indices Set of IDs of elements to work on.1015 909 def get_minimum_index(self, indices=None): 1016 910 """See get extreme index for details""" … … 1018 912 return self.get_extremum_index(mode='min', indices=indices) 1019 913 1020 ##1021 # @brief Return minimum value of quantity (on centroids).1022 # @param indices Set of IDs of elements to work on.1023 914 def get_minimum_value(self, indices=None): 1024 915 """Return minimum value of quantity (on centroids) … … 1039 930 1040 931 1041 ##1042 # @brief Get location of minimum value of quantity (on centroids).1043 # @param indices Set of IDs of elements to work on.1044 932 def get_minimum_location(self, indices=None): 1045 933 """Return location of minimum value of quantity (on centroids) … … 1064 952 return x, y 1065 953 1066 ##1067 # @brief Get values at interpolation points.1068 # @param interpolation_points List of UTM coords or geospatial data object.1069 # @param use_cache ??1070 # @param verbose True if this method is to be verbose.1071 954 def get_interpolated_values(self, 1072 955 interpolation_points, … … 1113 996 return result 1114 997 1115 ##1116 # @brief Get values as an array.1117 # @param interpolation_points List of coords to get values at.1118 # @param location Where to store results.1119 # @param indices Set of IDs of elements to work on.1120 # @param use_cache1121 # @param verbose True if this method is to be verbose.1122 998 def get_values(self, 1123 999 interpolation_points=None, … … 1232 1108 return num.take(self.vertex_values, indices, axis=0) 1233 1109 1234 ##1235 # @brief Set vertex values for all unique vertices based on array.1236 # @param A Array to set values with.1237 # @param indices Set of IDs of elements to work on.1238 # @param use_cache ??1239 # @param verbose??1240 1110 def set_vertex_values(self, 1241 1111 A, … … 1273 1143 self._set_vertex_values(vertex_list, A) 1274 1144 1275 ##1276 # @brief Go through list of unique vertices.1277 # @param vertex_list ??1278 # @param A ??1279 1145 def _set_vertex_values(self, vertex_list, A): 1280 1146 """Go through list of unique vertices … … 1299 1165 self.interpolate() 1300 1166 1301 ##1302 # @brief Smooth vertex values.1303 1167 def smooth_vertex_values(self, use_cache=False, verbose=False): 1304 1168 """Smooths vertex values.""" … … 1313 1177 ############################################################################ 1314 1178 1315 ##1316 # @brief Get vertex values like an OBJ format i.e. one value per node.1317 # @param xy True if we return X and Y as well as A and V.1318 # @param smooth True if vertex values are to be smoothed.1319 # @param precision The type of the result values (default float).1320 1179 def get_vertex_values(self, xy=True, smooth=None, precision=None): 1321 1180 """Return vertex values like an OBJ format i.e. one value per node. … … 1411 1270 return A, V 1412 1271 1413 ##1414 # @brief Extrapolate conserved quantities from centroid.1415 1272 def extrapolate_first_order(self): 1416 1273 """Extrapolate conserved quantities from centroid to vertices and edges … … 1429 1286 self.y_gradient *= 0.0 1430 1287 1431 ##1432 # @brief Compute the integral of quantity across entire domain.1433 # @return The integral.1434 1288 def get_integral(self): 1435 1289 """Compute the integral of quantity across entire domain.""" … … 1448 1302 #return integral 1449 1303 1450 ##1451 # @brief get the gradients.1452 1304 def get_gradients(self): 1453 1305 """Provide gradients. Use compute_gradients first.""" … … 1455 1307 return self.x_gradient, self.y_gradient 1456 1308 1457 ##1458 # @brief ??1459 # @param timestep ??1460 1309 def update(self, timestep): 1461 1310 # Call correct module function … … 1463 1312 return update(self, timestep) 1464 1313 1465 ##1466 # @brief ??1467 1314 def compute_gradients(self): 1468 1315 # Call correct module function … … 1471 1318 1472 1319 1473 ##1474 # @brief ??1475 1320 def compute_local_gradients(self): 1476 1321 # Call correct module function … … 1481 1326 1482 1327 1483 ##1484 # @brief ??1485 1328 def limit(self): 1486 1329 # Call correct module depending on whether … … 1488 1331 limit_old(self) 1489 1332 1490 ##1491 # @brief ??1492 1333 def limit_vertices_by_all_neighbours(self): 1493 1334 # Call correct module function … … 1495 1336 limit_vertices_by_all_neighbours(self) 1496 1337 1497 ##1498 # @brief ??1499 1338 def limit_edges_by_all_neighbours(self): 1500 1339 # Call correct module function … … 1502 1341 limit_edges_by_all_neighbours(self) 1503 1342 1504 ##1505 # @brief ??1506 1343 def limit_edges_by_neighbour(self): 1507 1344 # Call correct module function … … 1509 1346 limit_edges_by_neighbour(self) 1510 1347 1511 ##1512 # @brief ??1513 1348 def extrapolate_second_order(self): 1514 1349 # Call correct module function … … 1517 1352 extrapolate_from_gradient(self) 1518 1353 1519 ##1520 # @brief ??1521 1354 def extrapolate_second_order_and_limit_by_edge(self): 1522 1355 # Call correct module function … … 1524 1357 extrapolate_second_order_and_limit_by_edge(self) 1525 1358 1526 ##1527 # @brief ??1528 1359 def extrapolate_second_order_and_limit_by_vertex(self): 1529 1360 # Call correct module function … … 1531 1362 extrapolate_second_order_and_limit_by_vertex(self) 1532 1363 1533 ##1534 # @brief ??1535 # @param bound ??1536 1364 def bound_vertices_below_by_constant(self, bound): 1537 1365 # Call correct module function … … 1539 1367 bound_vertices_below_by_constant(self, bound) 1540 1368 1541 ##1542 # @brief ??1543 # @param quantity ??1544 1369 def bound_vertices_below_by_quantity(self, quantity): 1545 1370 # Call correct module function … … 1550 1375 bound_vertices_below_by_quantity(self, quantity) 1551 1376 1552 ##1553 # @brief ??1554 1377 def backup_centroid_values(self): 1555 1378 # Call correct module function … … 1557 1380 backup_centroid_values(self) 1558 1381 1559 ##1560 # @brief ??1561 # @param a ??1562 # @param b ??1563 1382 def saxpy_centroid_values(self, a, b): 1564 1383 # Call correct module function … … 1567 1386 1568 1387 1569 ##1570 # @brief OBSOLETE!1571 1388 class Conserved_quantity(Quantity): 1572 1389 """Class conserved quantity being removed, use Quantity.""" -
trunk/anuga_core/source/anuga/file_conversion/sww2pts.py
r7814 r8149 5 5 from anuga.coordinate_transforms.geo_reference import Geo_reference 6 6 7 ##8 # @brief Convert SWW file to PTS file (at selected points).9 # @param basename_in Stem name of input SWW file.10 # @param basename_out Stem name of output file.11 # @param data_points If given, points where quantity is to be computed.12 # @param quantity Name (or expression) of existing quantity(s) (def: elevation).13 # @param timestep If given, output quantity at that timestep.14 # @param reduction If given, reduce quantity by this factor.15 # @param NODATA_value The NODATA value (default -9999).16 # @param verbose True if this function is to be verbose.17 # @param origin ??18 7 def sww2pts(name_in, name_out=None, 19 8 data_points=None, -
trunk/anuga_core/source/anuga/file_conversion/urs2sts.py
r8125 r8149 16 16 17 17 18 ##19 # @brief Convert a URS (mux2, wave propagation) file to an STS file.20 # @param basename_in String (or list) of source file stems.21 # @param basename_out Stem of output STS file path.22 # @param weights23 # @param verbose True if this function is to be verbose.24 # @param origin Tuple with with geo-ref UTM coords (zone, easting, northing).25 # @param zone26 # @param mean_stage27 # @param zscale28 # @param ordering_filename Path of a file specifying which mux2 gauge points are29 # to be stored.30 # @note Also convert latitude and longitude to UTM. All coordinates are31 # assumed to be given in the GDA94 datum.32 18 def urs2sts(basename_in, basename_out=None, 33 19 weights=None, -
trunk/anuga_core/source/anuga/file_conversion/urs2sww.py
r8124 r8149 239 239 240 240 241 ##242 # @brief Convert URS file to SWW file.243 # @param basename_in Stem of the input filename.244 # @param basename_out Stem of the output filename.245 # @param verbose True if this function is to be verbose.246 # @param remove_nc_files247 # @param minlat Sets extent of area to be used. If not supplied, full extent.248 # @param maxlat Sets extent of area to be used. If not supplied, full extent.249 # @param minlon Sets extent of area to be used. If not supplied, full extent.250 # @param maxlon Sets extent of area to be used. If not supplied, full extent.251 # @param mint252 # @param maxt253 # @param mean_stage254 # @param origin A 3-tuple with geo referenced UTM coordinates255 # @param zscale256 # @param fail_on_NaN257 # @param NaN_filler258 # @param elevation259 # @note Also convert latitude and longitude to UTM. All coordinates are260 # assumed to be given in the GDA94 datum.261 241 def urs2sww(basename_in='o', basename_out=None, verbose=False, 262 242 remove_nc_files=True, -
trunk/anuga_core/source/anuga/file_conversion/urs2txt.py
r7770 r8149 1 1 from anuga.file.urs import Read_urs 2 2 3 ##4 # @brief Convert a set of URS files to a text file.5 # @param basename_in Stem path to the 3 URS files.6 # @param location_index ??7 3 def urs2txt(basename_in, location_index=None): 8 4 """ -
trunk/anuga_core/source/anuga/fit_interpolate/interpolate.py
r8125 r8149 56 56 57 57 58 ##59 # @brief Interpolate vertex_values to interpolation points.60 # @param vertex_coordinates List of coordinate pairs making a mesh.61 # @param triangles Iterable of 3-tuples representing indices of mesh vertices.62 # @param vertex_values Array of data at mesh vertices.63 # @param interpolation_points Points to interpolate to.64 # @param mesh_origin A geo_ref object or 3-tuples of UTMzone, easting, northing.65 # @param start_blocking_len Block if # of points greater than this.66 # @param use_cache If True, cache.67 # @param verbose True if this function is to be verbose.68 58 def interpolate(vertex_coordinates, 69 59 triangles, … … 160 150 161 151 162 ##163 # @brief164 152 class Interpolate (FitInterpolate): 165 153 166 ##167 # @brief Build interpolation matrix.168 # @param vertex_coordinates List of pairs [xi, eta] of points making a mesh.169 # @param triangles List of 3-tuples of indices of all vertices in the mesh.170 # @param mesh_origin A geo_ref object (UTM zone, easting and northing).171 # @param verbose If True, this function is to be verbose.172 # @param max_vertices_per_cell Split quadtree cell if vertices >= this.173 154 def __init__(self, 174 155 vertex_coordinates, … … 216 197 217 198 218 ##219 # @brief Interpolate mesh data f to determine values, z, at points.220 # @param f Data on the mesh vertices.221 # @param point_coordinates Interpolate mesh data to these positions.222 # @param start_blocking_len Block if # points >= this.223 # @param verbose True if this function is to be verbose.224 199 # FIXME: What is a good start_blocking_len value? 225 200 def interpolate(self, … … 316 291 317 292 318 ##319 # @brief Interpolate a block of vertices320 # @param f Array of arbitrary data to be interpolated321 # @param point_coordinates List of vertices to intersect with the mesh322 # @param use_cache True if caching should be used to accelerate the calculations323 # @param verbose True if this function is verbose.324 # @return interpolated f325 293 def interpolate_block(self, f, point_coordinates, 326 294 use_cache=False, verbose=False, output_centroids=False): … … 403 371 404 372 405 ##406 # @brief Get interpolated data at given points.407 # Applies a transform to all points to calculate the408 # interpolated values. Points outside the mesh are returned as NaN.409 # @note self._A matrix must be valid410 # @param f Array of arbitrary data411 # @param verbose True if this function is to be verbose.412 # @return f transformed by interpolation matrix (f')413 373 def _get_point_data_z(self, f, verbose=False): 414 374 """ … … 426 386 427 387 428 ##429 # @brief Build NxM interpolation matrix.430 # @param point_coordinates Points to sample at431 # @param output_centroids set to True to always sample from the centre432 # of the intersected triangle, instead of the intersection433 # point.434 # @param verbose True if this function is to be verbose.435 # @return Interpolation matrix A, plus lists of the points inside and outside the mesh436 # and the list of centroids, if requested.437 388 def _build_interpolation_matrix_A(self, 438 389 point_coordinates, … … 539 490 540 491 541 ##542 # @brief ??543 # @param vertices ??544 # @param vertex_attributes ??545 # @param triangles ??546 # @param points ??547 # @param max_points_per_cell ??548 # @param start_blocking_len ??549 # @param mesh_origin ??550 492 def benchmark_interpolate(vertices, 551 493 vertex_attributes, … … 577 519 578 520 579 ##580 # @brief Interpolate quantities at given locations (from .SWW file).581 # @param sww_file Input .SWW file.582 # @param points A list of the 'gauges' x,y location.583 # @param depth_file The name of the output depth file.584 # @param velocity_x_file Name of the output x velocity file.585 # @param velocity_y_file Name of the output y velocity file.586 # @param stage_file Name of the output stage file.587 # @param froude_file588 # @param time_thinning Time thinning step to use.589 # @param verbose True if this function is to be verbose.590 # @param use_cache True if we are caching.591 521 def interpolate_sww2csv(sww_file, 592 522 points, … … 713 643 714 644 715 ##716 # @brief717 645 class Interpolation_function: 718 646 """Interpolation_interface - creates callable object f(t, id) or f(t,x,y) … … 759 687 """ 760 688 761 ##762 # @brief ??763 # @param time ??764 # @param quantities ??765 # @param quantity_names ??766 # @param vertex_coordinates ??767 # @param triangles ??768 # @param interpolation_points ??769 # @param time_thinning ??770 # @param verbose ??771 # @param gauge_neighbour_id ??772 689 def __init__(self, 773 690 time, … … 1022 939 self.precomputed_values[name] = quantities[name] 1023 940 1024 ##1025 # @brief Override object representation method.1026 941 def __repr__(self): 1027 942 # return 'Interpolation function (spatio-temporal)' 1028 943 return self.statistics() 1029 944 1030 ##1031 # @brief Evaluate interpolation function1032 # @param t Model time - must lie within existing timesteps.1033 # @param point_id Index of one of the preprocessed points.1034 # @param x ??1035 # @param y ??1036 # @return ??1037 945 def __call__(self, t, point_id=None, x=None, y=None): 1038 946 """Evaluate f(t) or f(t, point_id) … … 1142 1050 return res 1143 1051 1144 ##1145 # @brief Return model time as a vector of timesteps.1146 1052 def get_time(self): 1147 1053 """Return model time as a vector of timesteps … … 1149 1055 return self.time 1150 1056 1151 ##1152 # @brief Output statistics about interpolation_function.1153 # @return The statistics string.1154 1057 def statistics(self): 1155 1058 """Output statistics about interpolation_function … … 1199 1102 1200 1103 1201 ##1202 # @brief ??1203 # @param sww_file ??1204 # @param time ??1205 # @param interpolation_points ??1206 # @param quantity_names ??1207 # @param verbose ??1208 # @note Obsolete. Use file_function() in utils.1209 1104 def interpolate_sww(sww_file, time, interpolation_points, 1210 1105 quantity_names=None, verbose=False):
Note: See TracChangeset
for help on using the changeset viewer.