Run360() can't feed output to plot360()

28 views
Skip to first unread message

Edward Hyer

unread,
Mar 10, 2022, 5:41:11 PM3/10/22
to Py6S
Hi Py6SS Wizards,

pixref_360 = SixSHelpers.Angles.run360(s, 'view', output_name='pixel_reflectance')
This command returns a tuple of (RESULTS,azimuths, zeniths) with RESULTS as a 1-D numpy array.

od_360 = SixSHelpers.Angles.run360(s, 'view', output_name='optical_depth_total')
This command also returns (RESULTS, azimuths, zeniths), but RESULTS is an array of Py6S.outputs.RayleighAerosolTotal objects.

If I try to use run_and_plot_360() it will fail. Does someone know the trick for getting plot360() to work with these object outputs?

Thanks,

--Edward H.

Robin Wilson

unread,
Mar 12, 2022, 3:45:57 PM3/12/22
to py...@googlegroups.com
Hi Edward,

You’ll need to extract one of the items from the RayleighAerosolTotal objects before passing to the plot360 function. Something like the following will work:

od_360 = SixSHelpers.Angles.run360(s, 'view', output_name='optical_depth_total’)
new_arr = [item.total for item in od_360[0]] # Extract the ’total’ value from each of the objects - you can replace this with ‘rayleigh’ or ‘aerosol'
od_360 = list(od_360) # Have to convert to a list as you can’t assign to elements of a tuple
od_360[0] = new_arr # Assign the new array to the first element
SixSHelpers.Angles.plot360(od_360) # Do the plot

Hope that makes sense,

Robin
--
You received this message because you are subscribed to the Google Groups "Py6S" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py6s+uns...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/py6s/4b50c5a2-2a92-4591-bca0-bc79c84bf048n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages