info.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. About pyModis
  2. =============
  3. Requirements
  4. ------------
  5. ``pyModis`` requires **Python GDAL**, **Numpy**, **requests** and **future** packages.
  6. If you want to use the Graphical User Interface you have to
  7. install also **wxPython** library.
  8. You can use also software is `MODIS Reprojection Tool <https://lpdaac.usgs.gov/tools/modis_reprojection_tool>`_
  9. to convert or mosaic MODIS HDF files.
  10. .. _userpw-label:
  11. User and password
  12. ^^^^^^^^^^^^^^^^^
  13. To be able to download data you need user and password provided by NASA.
  14. Please **register at https://urs.earthdata.nasa.gov/users/new**; now login
  15. and move to your profile page. Go to "My application" tab and approve the
  16. following applications "LP DAAC Data Pool", "Earthdata Search" (for Snow products you
  17. have to enable also "NSIDC_DATAPOOL_OPS").
  18. .. image:: _static/urs_earthdata_nasa_gov.png
  19. :scale: 60%
  20. :alt: GUI for modis_download.py
  21. :align: center
  22. :class: gui
  23. If you are an already registered user, login and enable the applications
  24. at https://urs.earthdata.nasa.gov/home
  25. How to install pyModis
  26. ----------------------
  27. Using pip
  28. ^^^^^^^^^
  29. From version 0.6.3 it is possible to install ``pyModis`` using
  30. `pip <https://pypi.python.org/pypi/pip>`_. You have to run the following
  31. command as administrator
  32. .. code-block:: none
  33. pip install pyModis
  34. If you need to update your ``pyModis`` version you have to run
  35. .. code-block:: none
  36. pip install --upgrade pyModis
  37. With ``pip`` it is also really simple to remove the library
  38. .. code-block:: none
  39. pip uninstall pyModis
  40. Compile from source
  41. ^^^^^^^^^^^^^^^^^^^
  42. Compile ``pyModis`` is very simple. First you need to download ``pyModis``
  43. source code from `github repository <https://github.com/lucadelu/pyModis>`_.
  44. You can use `git <http://git-scm.com/>`_ to download the latest code
  45. (with the whole history and so it contain all the different stable versions,
  46. from the last to the first)
  47. .. code-block:: none
  48. git clone https://github.com/lucadelu/pyModis.git
  49. or `download the latest stable version <https://github.com/lucadelu/pyModis/tags>`_
  50. from the repository and decompress it.
  51. Now enter the ``pyModis`` folder and launch as administrator of
  52. your computer
  53. .. code-block:: none
  54. python setup.py install
  55. If the installation doesn't return any errors you should be able to use
  56. ``pyModis`` library from a Python console. Then, launch a your favorite
  57. Python console (I really suggest ``ipython``) and digit ::
  58. import pymodis
  59. If the console doesn't return any error like this ::
  60. ImportError: No module named pymodis
  61. the ``pyModis`` library has been installed properly and you can use it
  62. or one of the tools distributed with ``pyModis``.
  63. If you want to install into /usr/local/, run
  64. .. code-block:: none
  65. python setup.py install --prefix=/usr/local
  66. In this case, if you get the following error
  67. .. code-block:: none
  68. TEST FAILED: /usr/local/lib/python2.7/site-packages/ does NOT support .pth files
  69. then you need to define the PYTHONPATH environmental variable ::
  70. export PYTHONPATH=/usr/local/lib/python2.7/site-packages
  71. python setup.py install --prefix=/usr/local
  72. and now re-run the installation command.
  73. Install on Windows with osgeo4w
  74. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  75. .. warning::
  76. Using this way to install pyModis it will be possible to use pyModis
  77. only from OSGeo4W environment.
  78. It will not possible to use other versions of Python except the OSGeo4W one.
  79. The simple way to install ``pyModis`` on Windows is to use
  80. `OSGeo4W <http://trac.osgeo.org/osgeo4w/>`_.
  81. .. note::
  82. To execute OSGeo4W may be required to run it as Administrator.
  83. Choose *Advanced Install* in the first step of installation and set the
  84. corrected value until the packages selection.
  85. At this point select the following packages:
  86. * *gdal-python*
  87. * *python-numpy*
  88. * *python-requests*
  89. * *python-future*
  90. * *wxpython*
  91. OSGeo4W will install all the required dependencies.
  92. At this point, using the OSGeo4W shell, you can follow `Compile from source`_
  93. section to install pyModis.
  94. Install on Windows without osgeo4w (old and not updated)
  95. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  96. Another way to install ``pyModis`` on Windows is to install latest Python 2.7
  97. from http://python.org/download/
  98. Now you have to modify the "Path" environment variable using *powershell* running
  99. .. only:: html
  100. .. code-block:: none
  101. [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
  102. .. only:: latex
  103. .. code-block:: none
  104. [Environment]::SetEnvironmentVariable("Path",
  105. "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
  106. Download and install the last version of Distribute for Windows from
  107. http://python-distribute.org/distribute_setup.py
  108. At this point you have to move to standard command line (*cmd*) and install *pip*
  109. using *easy_install*
  110. .. code-block:: none
  111. easy_install pip
  112. Now install `numpy <http://www.numpy.org>`_ library using *easy_install* because
  113. installation from pip is broken (this is required only for version >= 0.7.1)
  114. .. code-block:: none
  115. easy_install numpy GDAL
  116. If you want the Graphical User Interface you have to install also **wxPython**
  117. .. code-block:: none
  118. easy_install WxPython WxPython-Common
  119. Finally install ``pyModis`` using *pip*
  120. .. code-block:: none
  121. pip install pyModis
  122. If you want use the GUI you have to `download and install wxPython <http://www.wxpython.org/download.php>`_
  123. Troubleshooting
  124. ---------------
  125. Problem installing dependencies with pip
  126. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  127. .. warning::
  128. Sometimes *pip* return error when it try to install Python GDAL, Numpy or wxPython.
  129. You can solve this problem installing Python GDAL or Numpy using the
  130. version of your operating system.
  131. How to report a bug
  132. -------------------
  133. If you find any problems in ``pyModis`` library you can report it using
  134. the `issues tracker of github <https://github.com/lucadelu/pyModis/issues>`_.
  135. How to compile documentation
  136. ----------------------------
  137. This documentation has been made with `Sphinx <http://sphinx.pocoo.org>`_, so you
  138. need to install it to compile the original files to obtain different
  139. output formats.
  140. Please enter the ``docs`` folder of ``pyModis`` source and run ::
  141. make <target>
  142. with one of the following target to obtain the desired output:
  143. - **html**: to make standalone HTML files
  144. - **dirhtml**: to make HTML files named index.html in directories
  145. - **singlehtml**: to make a single large HTML file
  146. - **pickle**: to make pickle files
  147. - **json**: to make JSON files
  148. - **htmlhelp**: to make HTML files and a HTML help project
  149. - **qthelp**: to make HTML files and a qthelp project
  150. - **devhelp**: to make HTML files and a Devhelp project
  151. - **epub**: to make an epub
  152. - **latex**: to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  153. - **latexpdf**: to make LaTeX files and run them through pdflatex
  154. - **text**: to make text files
  155. - **man**: to make manual pages
  156. - **texinfo**: to make Texinfo files
  157. - **info**: to make Texinfo files and run them through makeinfo
  158. - **gettext**: to make PO message catalogs
  159. - **changes**: to make an overview of all changed/added/deprecated items
  160. - **linkcheck**: to check all external links for integrity
  161. - **doctest**: to run all doctests embedded in the documentation (if enabled)
  162. PDF link in HTML
  163. ^^^^^^^^^^^^^^^^
  164. To insert a link to PDF file of pyModis documentation into HTML documentation
  165. (the link will be added on the sidebar) you have to compile first the PDF and
  166. after the HTML, so you need to launch::
  167. make latexpdf
  168. make html
  169. If PDF file is missing no link will be added
  170. Ohloh statistics
  171. ----------------
  172. .. only:: html
  173. .. raw:: html
  174. <table align="center">
  175. <tr>
  176. <td align="center">
  177. <script type="text/javascript" src="http://www.ohloh.net/p/486825/widgets/project_basic_stats.js"></script>
  178. </td>
  179. <td align="center">
  180. <script type="text/javascript" src="http://www.ohloh.net/p/486825/widgets/project_factoids.js"></script>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td align="center">
  185. <script type="text/javascript" src="http://www.ohloh.net/p/486825/widgets/project_languages.js"></script>
  186. </td>
  187. <td align="center">
  188. <script type="text/javascript" src="http://www.ohloh.net/p/486825/widgets/project_cocomo.js"></script>
  189. </td>
  190. </tr>
  191. </table>
  192. .. only:: latex
  193. For more information about ``pyModis`` please visit the
  194. `pyModis Ohloh page <http://www.ohloh.net/p/pyModis>`_