full_example_mrt.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Example reproject data with MRT
  2. ===============================
  3. In this short example you can understand how to concatenate
  4. the scripts to obtain a GeoTIFF file for each band of the
  5. chosen product using as backend MODIS Reprojection Tools (MRT).
  6. .. warning::
  7. This example is based on a Linux based system. Please if
  8. you use other OS change the paths where data will be saved
  9. Downloading data
  10. ----------------
  11. For first you need to obtain data, so you need to use :doc:`../scripts/modis_download`
  12. .. warning::
  13. Remember to register in the NASA portal following the instructions at :ref:`userpw-label` session
  14. ::
  15. modis_download.py -I -f 2012-12-05 -O -t h28v05,h29v05,h28v04 /tmp
  16. .. warning::
  17. In this example we are working on Japan extension, so please
  18. change the name of tiles according with your region.
  19. User and password are passed through standard input.
  20. In this example we download data for only one day (2012-12-05)
  21. using the option "-O".
  22. Inside ``/tmp/`` directory you will find a file called *listfileMOD11A1.005.txt*
  23. containing the names of files downloaded. The name of file it is related to
  24. the product that you download.
  25. .. warning::
  26. Every time that you download new files of same product it will be overwrite,
  27. so if you need it, you should rename the file
  28. Mosaic data
  29. -----------
  30. :doc:`../scripts/modis_mosaic` is the script to use.
  31. ::
  32. modis_mosaic.py -m /path/to/mrt/ -o /tmp/outputfile /tmp/listfileMOD11A1.005.txt
  33. .. warning::
  34. ``/path/to/mrt/`` is the directory where Modis Reprojection Tools is stored
  35. The output of this command are *outputfile.hdf* and *outputfile.hdf.xml* inside the
  36. directory ``/tmp``. It's reading the input files contained in *listfileMOD11A1.005.txt*
  37. Convert data
  38. ------------
  39. The last part of the procedure is to convert the mosaic, from HDF format and sinusoidal
  40. projection, to GeoTIFF with several projection. You have to use :doc:`../scripts/modis_convert`
  41. .. only:: html
  42. ::
  43. modis_convert.py -s '( 1 1 1 1 1 1 1 1 1 1 1 1 )' -m /path/to/mrt/ -o /tmp/finalfile.tif -g 250 /tmp/outputfile.hdf
  44. .. only:: latex
  45. ::
  46. modis_convert.py -s '( 1 1 1 1 1 1 1 1 1 1 1 1 )' -m /path/to/mrt/
  47. -o /tmp/finalfile.tif -g 250 /tmp/outputfile.hdf
  48. Extract quality information
  49. ---------------------------
  50. If necessary, you can extract specific quality type from the chosen quality layer.
  51. In this particular case, we extract the Mandatory QA flag of the daytime temperature.
  52. You have to use :doc:`../scripts/modis_quality`
  53. .. only:: html
  54. ::
  55. modis_quality.py -p MOD11A1 -l 1 -t 1 /tmp/outputfile.hdf /tmp/mod11a1_daytime_qaflag.tif
  56. .. only:: latex
  57. ::
  58. modis_quality.py -p MOD11A1 -l 1 -t 1 /tmp/outputfile.hdf
  59. /tmp/mod11a1_daytime_qaflag.tif