Jeff Cogswell’s article
Learning Enough Python to Land a Job.
calls out that Python is for more than web development, Django, Twisted, Flask, &c.
As a data science practitioner, mangling tens of gigabytes if not tens of terabytes daily from sensors deployed around the globe, converting code to Python after several years of hard-core Matlab use was motivated by Python’s highly-performant data science stack incorporating Pandas, SciPy, Numpy, h5py and other specialty Python user modules.
Port code gradually, even from very high-level languages like Matlab. Tools like f2py for Fortran 77/90+, SWIG (and numerous others) for C, Oct2Py for Matlab, etc. allow you to speedily and often straightforwardly integrate code from other popular languages.
Get familiar with (in this order): Spyder, Numpy, Matplotlib, h5py, Scipy, and Pandas. If you’re working with most real problems, you should be considering Pandas and h5py to allow you to filter/select data before reading it all form disk. I personally prefer h5py over PyTables. The fastest data to load is data where the superfluous data you didn’t need was never loaded, that would otherwise slow down the loading of the wanted data!
Get started in data analysis knowing not much more than how to use dict(), list(), and numpy.array() along with the standard basic functions that one would use in Matlab or R. such as sqrt(), for, if, &c. Learn about Numpy and Pandas before dealing with generators, sets, list comprehensions, itertools, etc.
When you find you have lots of heterogeneous but associated variables, particularly those associated by time, it’s time to use Pandas. Beyond 2-D DataFrames, xarray is the module to use. Pandas is awesome for loading and working with large heterogenous datasets. Think of Pandas as SQL for doing computations.
We hope this commentary on Python for data scientists and analysts considering the transition to Python from languages such as R, Matlab, Fortran, etc. has helped you.
To overlay a contour on top of a Matlab “image()” or “pcolor()”, first rasterize the image and then overlay a contour to make it work in a 3-D Matlab figure.
This is a bit complex to describe, so we created an example of contour over image in a 3-D Matlab figure: contourImage2.m.
This script follows these steps:
flatten the contour onto the image in the default z=0 plane
render as a resized image
make a pcolor plot
manipulate the underlying Surface object to an arbitrary 3-D location.
Doing a contour overlay on a 2-D image or pcolor is much simpler
especially in
Python.
Matlab does not require special manipulations via freezeColors of the figure colormap in order to have a unique colormap for each axes (subplot) on a figure.
examples
If I made a standard line plot using the ScalarFormatter passed into a function, then subsequently passed the ScalarFormatter into another function that used colorbar, the line plot y-axis would be reset to match the limits of the later figure’s colorbar.
I didn’t think the ScalarFormatter would be able to feedback like that.
Enclose ScalarFormatter in its own function, then call that function from each of the plotting functions, thereby creating a new/unique ScalarFormatter for each figure.
The Madrigal distributed database allows access to much of the high level AMISR (incoherent scatter radar) data and DMSP data.
For lower level data (e.g. I/Q digitized samples) you need to approach the PI of the relevant instrument for data.
Updated syntax
of the original Fortran code slightly to fit with the FORTRAN 77 standard (not changing algorithm behavior, only syntactical correctness).
Plotting code uses f2py to make the LCPFCT run from Python with 50x speedup overall since you don’t have to write output to disk and then read it back in via a custom parsing algorithm.
Cross-jurisdictional and intra-jurisdictional radio systems that are incompatible is a problem as old as public safety radio itself.
It takes a major catastrophe to suddenly bring together diverse EMS and Police forces on a task needing common radio channels.
Yes, preplanned events such as parades and national holiday celebrations also bring EMS and Police in large inter-jurisdictional efforts, but that can be solved with radio system patches or extra radios.
Firefighters mix and match other department resources frequently as big fires can happen anywhere, anytime.
One typical solution is to have large numbers of adjoining Fire agencies on common radio technology, such as VHF analog, even when every other public safety resource might be on a P25 digital trunked network system.
Another solution is for an incident response van to have a bank of radios that can be patched on-site.
In major urban areas, city laws may require installation of distributed antenna systems for local public safety radio–a building-wide built in broadband repeater for public safety in effect.
VHF portable coverage is worse in general compared to higher frequency (shorter wavelength) radio bands due in large part to high on-body attenuation (up to factor of 100-1000 (20-30 dB)) and high noise levels on VHF, particularly in urban areas.
Yet, vast swathes of American fire departments are stuck on VHF due to interoperability concerns and budget constraints.
The high cost of the APX8000 won’t necessarily be a solution for rural fire departments, but the adjoining large tax base city might afford the APX8000, allowing the city fire department to upgrade to the regional P25 digital system.
The APX8000 in that scenario purchased for the city fire department allows mutual aid from adjoining rural fire departments.
Of course the Motorola salesperson isn’t pitching the APX8000 to small budget fire departments.
The APX8000 sale goes to the adjoining city fire department, who now doesn’t need a $5000 radio patch that might break down, making a single point of failure in the incident response van.
Dispatch isn’t tying up repeaters with console patches.
A real value add of the APX8000 is the reduction of need for complex fireground or console patches that tie up channels and break down at the worst possible time.
Will the whole city get APX8000?
Maybe not, but it depends on the historical patterns.
They might choose to only get enough APX8000 to cover say 95% of mutual aid needs, and let console patches handle the last 5%.
Also, given noise on VHF and a large site to cover for fire, it’s well possible to get out of radio range of the incident response van with the patch (or the central repeater), leading to the constantly dreaded case where you can’t talk to the person next to you on the radio.