How to randomly reclassify raster pixel values in ArcGIS?

How to randomly reclassify raster pixel values in ArcGIS?

I have a raster dataset (USDA Cropscape dataset) where each pixel is given a crop or landcover type (eg, corn, rice, urban area, forest). Some of the pixel values are classified as more than 1 crop/landcover type. For example, there are 40,000 pixels that are classified as “Double Crop Barley/Corn” as the class name. This is because certain acres of land engage in crop rotation practices. I have attached a screenshot of the attribute table.

I would like to reclassify the pixels (shown in 'Count' column of attached screenshot) as either Barley OR Corn (but not both), so that 20,000 pixels are classified as barley and 20,000 are corn. Now for the important part: I would like to randomly distribute the reclassification so that there is not a clustering of one crop type (ie, corn or barley) but an even and random distribution of each reclass across the entire extent. I don't want the first 20,000 pixels to be corn and the next to be barley, but every other pixel being classified as either one would be nice.

How would you go about this? General outline or step by step guidance, if possible. The important part is to get half of the pixels reclassified in randomized distribution

Generate a random raster using the same cell size (and snapped to) as your ag data, reclassify the random raster so that all of the >0.5 values represent corn values and the < 0.5 values are barley values.

Use a Con function to replace all the corn+barley cells with the values with the randomly created corn or barly surface.

Watch the video: Map Algebra Functionality and Advanced Raster Calculator Calculations