GeoMonkey
GeoMonkey

Reputation: 1665

Create subplots from interactive python plot

I have some LVIS Lidar data in hdf5 format.

The data has Lat and Long co-ordinates, so I have been able to visualise them on a map using Basemap:

f = h5py.File('ILVIS1B_GA2016_0304_R1701_043591.h5','r')

LONG = f['/LON0/']
LAT = f['/LAT0/']


X = LONG[...]
Y = LAT[...]

m = Basemap(projection='merc',llcrnrlat=-0.5,urcrnrlat=0.5,\
        llcrnrlon=9,urcrnrlon=10,lat_ts=0.25,resolution='i')
m.drawcoastlines()
m.drawcountries()
parallels = np.arange(-9.,10.,0.5)
m.drawparallels(parallels,labels=[False,True,True,False])
meridians = np.arange(-1.,1.,0.5)
m.drawmeridians(meridians,labels=[True,False,False,True])
m.drawmapboundary(fill_color='white')
x,y = m(X, Y)
scatter = plt.scatter(x,y)
m.scatter(x,y)
plt.show()

This gets me this, where the orange bands are very dense points:

enter image description here

The hdf5 file also has the full waveform data for each mapped point (each datapoint is a reflection detected at the sensor, as a function of time) so that each of the orange points has data associated with it like:

enter image description here

Ultimately, I would like to be able to click on any of the orange points and for the subsequent waveform to be displayed. I have looked into interactive plots for this and have come across a number of libraries (mpl3d, plotly etc).

I'm having some trouble getting my head around some of these and how I can get my data into the examples - my python isn't up to this level. Does anyone have any advice on where to start? Which libraries would be best suited to this? A little help to understand the basics would be appreciated.

Apologies there is no direct question here, I'm just after some info from the knowledgable community.

Upvotes: 0

Views: 249

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339590

The question seems to be: How do I tackle a task I have no clue how to solve?

  • Step 1: Search for a possible solution. It may happen that someone else has already solved your problem. This will mostly not be the case, but you may be lucky.
  • Step 2: Abstract the task. What would be the general problem that a lot of people might have and for which there might be a solution? Does it need to be hdf5 files? No. Is georeferencing important? Maybe, but one could neglect for the moment. Which requirements are really important, which not?
  • Step 3: Search again. You will have more success now for finding similar or related problems.
  • Step 4: Look at the tools in use. Make a list of possible tools and check against your requirements. Interactivity, Application or web-based, accuracy etc.
  • Step 5: Decide for one tool and go for it. Start with a general case study. Can I plot a map on the left and a graph on the right side using this tool? If not, find out why - maybe there is a general problem with this, maybe there is just an implementation detail missing. At this point you may ask a question about the case study problem, specifying the tool in use and providing the code that gives the problem. Do not think about your actual problem until this is solved.
  • Step 6: Proceed and try to add interactivity. Can I get something to happen when clicking? Again treat this independent of the actual problem. Search for solutions and if there none, ask a question about it.
  • Step 7: Proceed further up to the point where you're truely stuck. Now is the time to finally ask a question here, but with all the details that have brought you down to step 7 inside the question.

Upvotes: 1

Related Questions