I have a DX file containing PME data, I want to plot an average potential profile through python code - mdanalysis

I have a DX file containing PME data, I want to plot an average potential profile through python code. Can anyone please help with the code
I do not know how to write a python code for the same

Related

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:
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:
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.
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.

How to Visualise large number of code in Pro-B

I have a problem with visualising large number of code in ProB.
This graph shows the login section of a server with (using Graphviz' dotty) of ProB, but there is no solution for large number of code to get the graph.
Please let me know your suggestions and ideas,

Error using MODIS HDF files in ArcMap Raster Calculator

I have downloaded several HDF files from the MODIS database.
According to the documentation, the layers have to be multiplied by 0.1 to obtain the real values.
I get an error when I put the name of the HDF-layer in the Raster Calculator, however it does work when I export it as a new raster before. But after multiplication with 0.1, I still do not get a continuous scale image but only black and white areas. I excluded the seven highest values as indicated in the documentation, but still no change.
Another way of getting the MODIS files is to use the respective toolbox. Data imported with this tool does show up correctly, but I cannot import most of it even though it is available under the link indicated above:
Failed to execute (CreateCustomGeoTransformation)
Failed to execute (ImportEvapotranspiration)
Has anyone experienced something similar?

how to extract data from plot produced by easy.py in libsvm-3.17

I just downloaded libsvm-3.17 abt two weeks ago. I tried heart_scale (dataset provided in the libsvm-3.17 package) with easy.py. An image or plot is produced (from gnuplot) to illustrate the best c and best gamma. I cannot post the image here because I am new here and do not have enough reputation.
I would like to ask from the many colors curves in the plot, how to extract from the plot that the best log2(c)=11 (which gives c=2048) and the best log2(gamma)=-13 (which gives gamma = 0.0001220703125).
Thank you very much.
the chosen parameters are reported by easy.py (cannot run it now, but you will find them). the plot is just a visual aid to manually verify the parameter neighborhood. with some experience you can interpret the diagram. without experience simply trust easy.py

Visualizing a large data series

I have a seemingly simple problem, but an easy solution is alluding me. I have a very large series (tens or hundreds of thousands of points), and I just need to visualize it at different zoom levels, but generally zoomed well out. Basically, I want to plot it in a tool like Matlab or Pyplot, but knowing that each pixel can't represent the potentially many hundreds of points that map to it, I'd like to see both the min and the max of all the array entries that map to a pixel, so that I can generally understand what's going on. Is there a simple way of doing this?
Try hexbin. By setting the reduce_C_function I think you can get what you want. Ex:
import matplotlib.pyplot as plt
import numpy as np
plt.hexbin(x,y,C=C, reduce_C_function=np.max) # C = f(x,y)
would give you a hexagonal heatmap where the color in the pixel is the maximum value in the bin.
If you only want to bin in one direction, see this this method.
First option you may want to try is Gephi- https://gephi.org/
Here is another option, though I'm not quite sure it will work. It's hard to say without seeing the data.
Try going to this link- http://bl.ocks.org/3887118. Do you see toward the bottom of the page data.tsv with all of the values? IF you can save your data to resemble this then the HTML code above should be able to build your data in the scatter plot example shown in that link.
Otherwise, try visiting this link to fashion your data to a more appropriate web page.
There are a set of research tools called TimeSearcher 1--3 that provide some examples of how to deal with large time-series datasets. Below are some example images from TimeSearcher 2 and 3.
I realized that simple plot() in MATLAB actually gives me more or less what I want. When zoomed out, it renders all of the datapoints that map to a pixel column as vertical line segments from the minimum to the maximum within the set, so as not to obscure the function's actual behavior. I used area() to increase the contrast.