.. _recipe_vimadatacoverage: ================================== 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 :mod:`vima_coverage` and :mod:`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 :mod:`vima_coverage.py` script as follows. .. code-block:: sh % 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 :mod:`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. .. code-block:: py 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. .. code-block:: py 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 :meth:`vima_coverage_plot.load` method instead of :meth:`vima_coverage_plot.parse` from the next time. This will save time of reading the file. .. code-block:: py import vima_coverage_plot dat = vima_coverage_plot.load('coverage.pickle.gz') Now time to plot. Simplest one is using :meth:`vima_coverage_plot.xr_plot` function. .. code-block:: py vima_coverage_plot.xr_plot(dat) You will find ``imacoverage.png`` and ``imacoverage_x.png`` files. Also, :meth:`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.