How to make IMA data coverage plot¶
IMA data (1 energy scan + mass information + 16 azim direction) is obtained by 12 or 24 sec resoultion.
Note
The below scripts use primitive way of getting the data file and the plot. The tutorial will be outdated in the future when more “advanced” methods are introduced.
Script¶
The programs are vima_coverage
and vima_coverage_plot
.
First of all, the data file should be made. Data file contains the information of the IMA data existence and the position at that time.
The simplest way is just running the vima_coverage.py
script as follows.
% python vima_coverage.py 2007-01-01T00:00:00 2007-01-31T23:59:59 > coverage.out
You will get the coverage.out
file.
Then, plotting can be done using vima_coverage_plot
module.
Unfortunately on 2011-04-05, I did not yet produced a
script (interface), so the file can only be used as a module.
Run ipython in the scripts
folder.
import vima_coverage_plot
dat = vima_coverage_plot.parse('coverage.out')
Parsing will take a while if the data is too much. It is also a good idea to save the data into pickled file for future use.
import cPickle as pickle
import gzip
f = gzip.open('coverage.pickle.gz', 'w')
pickle.dump(dat, f)
f.close()
In this case, you can use vima_coverage_plot.load()
method instead of vima_coverage_plot.parse()
from the next time. This will save time of reading the file.
import vima_coverage_plot
dat = vima_coverage_plot.load('coverage.pickle.gz')
Now time to plot. Simplest one is using vima_coverage_plot.xr_plot()
function.
vima_coverage_plot.xr_plot(dat)
You will find imacoverage.png
and imacoverage_x.png
files.
Also, vima_coverage_plot.hex_plot()
can be used. You will find vima_coverage_hex.png
file.
Note
Indeed I do not like hex_plot. 1 is added internally in hexbin() method. So I should reimplement using histogram2d or some other method.