modis_convert.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. modis_convert.py
  2. ----------------
  3. **modis_convert.py** converts MODIS data to TIF formats and different
  4. projection reference system. It is an interface to MRT mrtmosaic
  5. software or GDAL library.
  6. Usage
  7. ^^^^^
  8. .. code-block:: none
  9. modis_convert.py [options] hdf_file
  10. Options
  11. ^^^^^^^
  12. .. image:: ../_static/gui/modis_convert.png
  13. :scale: 70%
  14. :alt: GUI for modis_convert.py
  15. :align: left
  16. :class: gui
  17. .. code-block:: none
  18. -h, --help show this help message and exit
  19. Required options:
  20. -s SUBSET, --subset=SUBSET
  21. (Required) a subset of product's layers. The string
  22. should be similar to: ( 1 0 )
  23. -o OUTPUT_FILE, --output=OUTPUT_FILE
  24. (Required) the prefix of output file
  25. -g RESOLUTION, --grain=RESOLUTION
  26. the spatial resolution of output file
  27. -r RESAMPLING_TYPE, --resampl=RESAMPLING_TYPE
  28. the method of resampling. -- mrt methods:
  29. 'NEAREST_NEIGHBOR', 'BICUBIC', 'CUBIC_CONVOLUTION',
  30. 'NONE' -- gdal methods: 'AVERAGE', 'BILINEAR',
  31. 'CUBIC', 'CUBIC_SPLINE', 'LANCZOS', 'MODE',
  32. 'NEAREST_NEIGHBOR' [default=NEAREST_NEIGHBOR]
  33. Options for GDAL:
  34. -f OUTPUT_FORMAT, --output-format=OUTPUT_FORMAT
  35. output format supported by GDAL [default=GTiff]
  36. -e EPSG, --epsg=EPSG
  37. EPSG code for the output
  38. -w WKT, --wkt_file=WKT
  39. file or string containing projection definition in WKT
  40. format
  41. -v, --vrt Read from a GDAL VRT file.
  42. --formats print supported GDAL formats
  43. Options for MRT:
  44. -m MRT_PATH, --mrt=MRT_PATH
  45. the path to MRT software
  46. -d DATUM, --datum=DATUM
  47. the code of datum. Available: 'NODATUM', 'NAD27',
  48. 'NAD83', 'WGS66', 'WGS72', 'WGS84' [default=WGS84]
  49. -t PROJECTION_SYSTEM, --proj_type=PROJECTION_SYSTEM
  50. the output projection system. Available: 'AEA', 'GEO',
  51. 'HAM', 'IGH', 'ISIN', 'LA', 'LCC', 'MOL', 'PS', 'SIN',
  52. 'TM', 'UTM', 'MERCAT' [default=GEO]
  53. -p PROJECTION_PARAMETERS, --proj_parameters=PROJECTION_PARAMETERS
  54. a list of projection parameters, for more info check
  55. the 'Appendix C' of MODIS reprojection tool user's
  56. manual https://lpdaac.usgs.gov/content/download/4831/2
  57. 2895/file/mrt41_usermanual_032811.pdf [default=( 0.0
  58. 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
  59. 0.0 )]
  60. -u UTM_ZONE, --utm=UTM_ZONE
  61. the UTM zone if projection system is UTM
  62. the UTM zone if projection system is UTM
  63. Examples
  64. ^^^^^^^^
  65. .. warning::
  66. The resolution value in ``modis_convert.py`` has to be set with the
  67. right value depending on the projection used. 1 kilometer in metrical
  68. projection has to be set as 1000 meter, instead in latitude and longitude
  69. something like 0.01* depending on the placement in the Earth.
  70. MODIS Reprojection Tools
  71. """"""""""""""""""""""""
  72. .. warning::
  73. You can find the supported projections in the 'Appendix C' of
  74. `MODIS reprojection tool user's manual`_ and the datums at section
  75. ``Datum Conversion`` of the same manual
  76. Convert layers from MODIS data with the original resolution in
  77. latitude and longitude reference system
  78. .. code-block:: none
  79. modis_convert.py -s "( 1 0 1 0 )" -o OUTPUT_FILE -m "/usr/local/bin/" FILE
  80. Convert layers from MODIS data with output resolution in 500 meters with
  81. UTM projection in the 32 zone
  82. .. code-block:: none
  83. modis_convert.py -s "( 1 0 1 0 )" -o OUTPUT_FILE -m "/usr/local/bin/" -g 500 -p UTM -u 32 FILE
  84. GDAL
  85. """"
  86. Convert the first layer in latitude and longitude with the original resolution
  87. .. code-block:: none
  88. modis_convert.py -s "( 1 )" -o OUTPUT_FILE -e 4326 FILE
  89. Convert the first three layers from MODIS data with output resolution in 500
  90. meters with UTM projection in the 32 zone
  91. .. code-block:: none
  92. modis_convert.py -s "( 1 1 1 )" -o OUTPUT_FILE -g 500 -e 32632 FILE
  93. .. _`MODIS reprojection tool user's manual`: https://lpdaac.usgs.gov/sites/default/files/public/mrt41_usermanual_032811.pdf
  94. .. only:: latex
  95. .. raw:: latex
  96. \newpage % hard pagebreak at exactly this position