07-19-2016 07:21 AM - last edited on 05-08-2018 09:18 AM by ian.anderson
Hi there, I have a very simple model, but have no idea where I am going wrong! I have a coudy Landsat image, and a cloud mask. The Landsat 9 image is unsigned 16-bit 7 band image, and the cloud mask is a thematic layer (Value = 0 for cloud affected areas; Value = 1 for cloud free areas) My model simple multiplies the outputs together to convert the cloud affected Landsat pixels to zero, and retain the original raster values in cloud free areas of the mask. However, my result is a dataset of zero where the clouds were, but values 65535 instead of the original landsat values??? Where am I going wrong? PS. How do I attach a picture when I post a message?
07-20-2016 06:33 AM
You can attach an image to your post using the “Insert/edit image” icon on the toolbar at the top of the text box. It is the ninth icon from the left - outlined in red in the image below.
I have posted two images of spatial models which will accomplish the task you want to perform. The first one uses the multiplication method you mentioned and the second one uses a conditional Either/Or operator.
You may also be interested our spatial model Simple Cloud Mask for Landsat Imagery found in the ERDAS IMAGINE Spatial Recipes section of the Community.
Hexagon Geospatial Support
07-20-2016 07:12 AM
Thanks for your response!
That "insert image" brings up a dialog that asks for a image source, description and dimensions, and has no way of browsing my pc to insert an image. Not too familiar with html source code to quickly write a bit of code just for an image upload?
I actually solved the issue in the modeler. I am familiar with the EitherOr and Multiply queries, and that is why I was puzzled by the result I got from the model.
It strangely required a "Replace NoData With" operator after the thematic raster input to at last give the result I needed.
Not sure if this is a bug, or a new common best practice when using the new modeler?
05-07-2018 06:38 PM
I'm trying to do something similar, but using the Landsat pixel_qa band to identify the cloud pixels, and then reset my NDVI values as NoData if they are clouds, but otherwise leave them untouched. Normally, this will take care of the out-of-range NDVI values that are calculated from a scene which has a few clouds in it............
I think this must require a combination of the Either/Or operator, and the Set NoData operator, but I'm having trouble, from the model above and the IMAGINE Help files figuring out how to write the expression within either of these operators. In ArcGIS this is easy to do in the Raster Calculator, but I don't see a similar tool in IMAGINE. I have included the pixel_qa band in my layer stack.
Any suggestions or pointers appreciated (I have looked at the "Simple cloud mask" model, but don't find it simple at all, and think that I may as well use the USGS qa band since that's what its for......
05-08-2018 05:20 AM
If you have NoData locations the output will always be NoData. So if you want an actual evaluation to take place at those locations and a different value be output, you will need to perform a Replace NoData With first (and pick a replacement value that you can keep track of and include in your conditional evaluations).
There's a protracted discussion on NoData handling (with links to other related topics) here: