I am attempting to create a binary cloud mask from the MOD35_L2 data products located at http://ladsweb.nascom.nasa.gov/data/ When opening the MOD35_L2 data in ENVI or the MRTSwath tool it reports 6 bands of data (which I believe is due to ENVI/MRTSwath reading the hdf data incorrectly) Is there a way to use ENVI or MRTSwath to create a MODIS cloud mask?

How can I process a binary cloud mask from the hdf files?

  • When fed with MOD35_L2 as input, MRTswath gives 6 tif files (b0,b1,b2,b3,b4,b5) as output. Does these 6 images (8 bit each) represent the 6 different bytes of the 48 bit modis cloud mask? If yes, is the following order correct : b0 (bits 7-0), b1 (bits 15-8), b2 (bits 23-16), b3 (bits 31-24), b4 (bits 39-32), b5 (bits 47-40)?
    – Manu Tom
    Jul 20, 2017 at 13:20
  • You should ask your own question topic - not use the 'Answer' function to ask questions. However, the answer to your question is "no". You should read the User Guide for the MOD35_L2 product: modis-images.gsfc.nasa.gov/_docs/CMUSERSGUIDE.pdf Jul 20, 2017 at 13:48
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
    – mgri
    Jul 20, 2017 at 14:05

1 Answer 1


Use LDOPE-1.7 (https://lpdaac.usgs.gov/tools/ldope_tools), using "create_mask". this function takes MOD35_L2 HDF and creates a cloud mask in hdf. use MRTSwath tool for projection/re-sampling/clipping and convert new hdf to GeoTiff.

  • Welcome to GIS SE! Although your answer may be correct, about a paragraph is considered minimum length for answers (and questions) so I recommend that you expand upon it with a brief detail or two. Also, there is no need to sign your posts here because every answer, question and comment is already signed by your user card.
    – PolyGeo
    Jul 17, 2014 at 21:39
  • Thanks for your response. I ended up using MRTSwath to export the Cloud_Mask SDS to geotiff. I realized the 6 bands that it outputted were each byte of the 48 bit cloud mask. (6 bands * 8 bits per pixel = 48 bits). Since the last two bytes of the cloud mask are binary cloud masks, I used band 5 or 6. Would using LDOPE give me a different result?
    – Graham
    Jul 18, 2014 at 15:17
  • LDOPE has a function for creating cloud mask using one command line. if you are a modis user, I'd suggest to have a look at LDOPE functions. I didn't process MOD35 using MRTSwath.
    – Leila
    Jul 18, 2014 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.