How to binarize results for a masked array?

39 views Asked by At

I'm looking to assess where temperatures in Canada will be between 15 and 35 °C in Canada in 2030 using a projection model. I created a masked array that fits within this set of parameters, and has the same latitude and longitude axes as the original data with all of the temperatures, so that when I map the result, only the data points that are between 15 and 35 °C appear on the map. However, I'd prefer being able to create a map where I get a binarized map instead; so instead of seeing the temperature that is within 15-36°C and not seeing any data points that are outside of that, I'd rather see something like 'True' where temperatures are within 15-35°C and 'False' where they are not. Does anyone know how to do this?

This was the code that I used to create the array that contained the values that are within the threshold.

tempsummer2030_26_viable = np.ma.masked_where((tempsummer2030_26 < 15.0) | (tempsummer2030_26 > 35.0), tempsummer2030_26)  

Picture of the map that Im currently getting, Id rather have it binarized

0

There are 0 answers