I think the issue is that all of your arrays are the same length. I don’t quite understand exactly what you’re trying to do: you say that you have a 9×6 array, but it seems like your data itself is only two dimensional, not three dimensional. To plot a polar contour plot you need to have three pieces of information for each point on the graph: the value (which will be shown as the colour), the zenith location (or radius) and the azimuth location (or angle). You have the MISR reflectance (your value), and the zenith angle for each of these reflectances (your zenith/radius). You also have an azimuth location for each of your measurements – but combined together these don’t form a complete set of measurements. That is, you may know the value at azimuth=100, zenith=70, and also the value at azimuth=140 for and zenith=60 – but actually you need to have values at all combinations of azimuth and zenith angles. That is, if you have 9 zenith angles and 6 azimuth angles you need 9*6 = 54 measurements. All you have is 9 measurements.

Does that make sense? If you look at the examples in the blog post you’ll see that I always have values for all combinations of zeniths and azimuths. I don’t know how to go about producing a graph when you don’t have all of the data – you may need to interpolate somehow, or it may be that a polar plot isn’t the best way to visualise the data.

In terms of the commented for loop that you didn’t understand: that was just an example of how you could generate the required data. You already have the data, so you don’t need to worry about that. However, it does illustrate how the data needs to be formatted – you can see that you are producing a value for every combination of zeniths and azimuths by using a nested for loop.

Hope that helps,

Robin

]]>I have tried using this but it didn’t work. I have a (9,6) array that contains the data I would like to analyse (MISR reflectance values, so 9 for the 9 MISR sensors/zeniths ±70, ± 60, ±45, ±25, 0; 6 for View Zenith, Sun Zenith, View Azimuth, Sun Azimuth, Relative Azimuth and Reflectance). So I set the arguments:

values = array[:,5]

azimuths = array[:,2]

zeniths = array[:,0]

then I run plot_polar_contour(values,azimuths,zeniths) but I get the following error message:ValueError Traceback (most recent call last)

in ()

—-> 1 plot_polar_contour(values,azimuths,zeniths)

in plot_polar_contour(values, azimuths, zeniths)

28

29 values = np.array(values)

—> 30 values = values.reshape(len(azimuths), len(zeniths))

31

32 r, theta = np.meshgrid(zeniths, np.radians(azimuths))

ValueError: total size of new array must be unchanged

len(values), len(azimuths) and len(zeniths) is 9 in all cases, so not sure what the problem is!

Also I’m not quite sure what you mean with this bit:

values = []

for azimuth in azimuths:

for zenith in zeniths:

# Do something and get a result

values.append(result)

so I skipped it, can you explain what you mean?

Cheers

Alex

]]>However,if the problem was not mentioned above, I suggested that g77 could not compile the code written in form of f90? ]]>