Archive for the ‘software engineering’ Category
Python Resources for Scientists, Engineers, and Statisticians
Tuesday, March 18th, 2008Ordered roughly by relevance for getting to know the kool tool:
- Mathematics in Python Pep talk about why (and how much) python is neat.
- Python Programming Learning to do science in Python in less than a day
- Python for scientific use. Part I: Data Visualization Introduction to using gplt with Python
- Python for scientific use, Part II: Data analysis Some more usage notes on gplt/Python
- SciPy and NumPy Main packages for science and numerical methods, to be used and contributed to.
- Package Scientific Some indispensable classes and utilities
- PLEAC Python “In this document, you’ll find an implementation of the Solutions of the Perl Cookbook in the Python language.” — Mighty useful.
- Dive into Python “Python from novice to pro” rapidly, but geared for programmers and painfully slow for scientific programming.
- Python Tutorial The basic tutorial.
Save MATLAB Images with appropriate size
Thursday, November 22nd, 2007Problem MATLAB figures saved as eps or jpg need to be scaled to put on page, but text gets skewed on scaling, and text size is *always* messed up.
Solution A function that takes figure placement constraints in terms of fraction of page width/height and computes appropriate dimensions of image and saves it.
If the image covers half the page width and quarter of the page height, we can place such 2 figures horizontally, and 4 such figures vertically. To save file with such dimensions in eps format, we call:
savefigure(gcf, 'figures/coolgraph.eps', 4, 2, 'epsc2');
MATLAB Best Practices
Wednesday, November 21st, 2007- Figure registration and scale-before-save
- Choose correct renderer for saving figures.
set(gcf, 'Renderer', 'painters');orfigure('Renderer', 'painters')while beginning on a new figure. MATLAB chooses a renderer each time it displays an image (or prints one), balancing memory size with processor load, so a surface plot may be rendered or saved as a bitmap (even in an eps file!). To ensure that MATLAB renders the plot for the best display, set the renderer to ‘painters.’ - SVN Code repository
- mlint
- profile
- Standard punctuation (and indentation)
- Non-empty inputs
- Sensible errors, with mfilename
- Prior memory allocation for predictable matrices
- Clearing of unused variables
- Loops into C++, or Loops into Matrices
MATLAB Session Reports
Thursday, November 15th, 2007Problem I run a MATLAB session, and test numerous hypotheses. It remains undocumented because there’s no standard for elegant documentation.
Discussion
Features of an organization standard
- Organization of input
- Allow modification
- Inclusion of all graphs
- Exclusion of selected figures
- Automation
- Integration into target documentation, in this case, TeX/LaTeX