15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SciPy Reference Guide, Release 0.8.dev<br />

the buffer parameter, and the number of elements within the footprint through filter_size. The calculated<br />

valued should be returned in the return_value argument.<br />

The function generic_filter1d (see Generic filter functions) accepts a callback function with the following<br />

prototype:<br />

The calling function iterates over the lines of the input and output arrays, calling the callback function<br />

at each line. The current line is extended according to the border conditions set by the calling function,<br />

and the result is copied into the array that is passed through the input_line array. The length of the input<br />

line (after extension) is passed through input_length. The callback function should apply the 1D filter and<br />

store the result in the array passed through output_line. The length of the output line is passed through<br />

output_length.<br />

The function geometric_transform (see Interpolation functions) expects a function with the following prototype:<br />

The calling function iterates over the elements of the output array, calling the callback function at each<br />

element. The coordinates of the current output element are passed through output_coordinates. The<br />

callback function must return the coordinates at which the input must be interpolated in input_coordinates.<br />

The rank of the input and output arrays are given by input_rank and output_rank respectively.<br />

1.11 File IO (<strong>scipy</strong>.io)<br />

See Also:<br />

numpy-reference.routines.io (in numpy)<br />

1.11.1 Matlab files<br />

loadmat(file_name, **kwargs[, mdict, Load Matlab(tm) file<br />

appendmat])<br />

savemat(file_name, mdict[, appendmat, ...]) Save a dictionary of names and arrays into the MATLAB-style<br />

.mat file.<br />

Getting started:<br />

>>> import <strong>scipy</strong>.io as sio<br />

If you are using IPython, try tab completing on sio. You’ll find:<br />

sio.loadmat<br />

sio.savemat<br />

These are the high-level functions you will most likely use. You’ll also find:<br />

sio.matlab<br />

This is the package from which loadmat and savemat are imported. Within sio.matlab, you will find the<br />

mio module - containing the machinery that loadmat and savemat use. From time to time you may find yourself<br />

re-using this machinery.<br />

80 Chapter 1. SciPy Tutorial

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!