Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in the projectedRGB() #2

Closed
aninramesh opened this issue Mar 16, 2024 · 1 comment
Closed

Bug in the projectedRGB() #2

aninramesh opened this issue Mar 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@aninramesh
Copy link
Owner

When utilizing the proj='Orthographic' projection, the 'scale' argument cannot be used.

plt_.projectedRGB(proj='Orthographic', normFactor =300, scale=0.5)

---------------------------------------------------------------------------
{
	"name": "TypeError",
	"message": "'float' object is not subscriptable",
	"stack": "---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[5], line 1
----> 1 plt_.projectedRGB(proj='Orthographic', normFactor =300, scale=0.5)

File ~/git/nasa-pace-data-reader/Examples/nasa_pace_data_reader/plot.py:679, in Plot.projectedRGB(self, rgb, scale, ax, fig, var, viewAngleIdx, normFactor, proj, saveFig, noShow, rivers, lakes, rgb_dolp, figsize, savePath, dpi, setTitle, returnRGB, lon_0, lat_0, black_background, proj_size, returnTransitionFlag, **kwargs)
    677 # if RGB does not exist, run the plotRGB method
    678 if rgb is None:
--> 679     self.plotRGB(var=var, viewAngleIdx=viewAngleIdx, scale=scale, normFactor=normFactor, returnRGB=True, plot=False, rgb_dolp=rgb_dolp,
    680                        **kwargs)
    682 # Check the shape of the RGB data
    683 assert self.rgb.shape[2] == 3, 'Invalid RGB data'

File ~/git/nasa-pace-data-reader/Examples/nasa_pace_data_reader/plot.py:462, in Plot.plotRGB(self, var, viewAngleIdx, scale, normFactor, returnRGB, plot, rgb_dolp, saveFig, **kwargs)
    460     else:
    461         for i in range(3):
--> 462             rgb[:, :, i] = rgb[:, :, i]/normFactor*scale[i]
    463 # copy the rgb to a new variable
    464 
    465 # Plot the RGB image
    466 if plot:

TypeError: 'float' object is not subscriptable"
}
@aninramesh aninramesh added the bug Something isn't working label Mar 16, 2024
@aninramesh aninramesh self-assigned this Mar 16, 2024
@aninramesh
Copy link
Owner Author

aninramesh commented Mar 16, 2024

This issue has been resolved in the commit 35be1f0b56df600c640fa7335647c6f48e0b4bf1. The bug has been resolved in the Python package and updated to version v0.0.4.7. Previously, there was a restriction requiring normFactor and scale to be integers, which has now been adjusted to allow for float values as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant