NDVI time series graph of multiple shapefiles in GEE - shapefile

How can I plot NDVI time series graph (Using Sentinel-2) of multiple shapefiles in a single graph plot. I run code for one shapefile and its works well but unable to plot the ndvi curve for other shapefile area for comparison in the same graph plot due to my minimum command on GEE. Sharing code link below
https://code.earthengine.google.com/d003711d7f18dd242b834426703e1a01

Related

How to plot spectrogram from an array or (vector,list etc) containing raw data?

I have been working to find temporal displacement between audio signals using a spectrogram. I have a short array containing data of a sound wave (pulses at specific frequencies). Now I want to plot spectrogram from that array. I have followed this steps (Spectrogram C++ library):
It would be fairly easy to put together your own spectrogram. The steps are:
window function (fairly trivial, e.g. Hanning)
FFT (FFTW would be a good choice but if licensing is an issue then go for Kiss FFT or
similar)
calculate log magnitude of frequency domain components(trivial: log(sqrt(re * re + im * im))
Now after performing these 3 steps, I am stuck at how to plot the spectrogram from this available data? Being naive in this field, I need some clear steps ahead to plot the spectrogram.
I know that a simple spectrogram has Frequency at Y-Axis, time at X-axis and magnitude as the color intensity.
But how do I get these three things to plot the spectrogram? (I want to observe and analyze data behind spectral peaks(what's the value on Y-axis and X-axis), the main purpose of plotting spectrogram).
Regards,
Khubaib

Visualization of Bivariate Probability Distribution

I need to obtain the 3D plot of the joint probability distribution of two random variables x and y. Whereas this plot can be easily obtained with Mathematica, I wasn't able to find any documentation in Python.
Can you help me out with that?

Spatial pyramid matching (SPM) for SIFT then input to SVM in C++

I am trying to classify MRI images of brain tumors into benign and malignant using C++ and OpenCV. I am planning on using bag-of-words (BoW) method after clustering SIFT descriptors using kmeans. Meaning, I will represent each image as a histogram with the whole "codebook"/dictionary for the x-axis and their occurrence count in the image for the y-axis. These histograms will then be my input for my SVM (with RBF kernel) classifier.
However, the disadvantage of using BoW is that it ignores the spatial information of the descriptors in the image. Someone suggested to use SPM instead. I read about it and came across this link giving the following steps:
Compute K visual words from the training set and map all local features to its visual word.
For each image, initialize K multi-resolution coordinate histograms to zero. Each coordinate histogram consist of L levels and each level
i has 4^i cells that evenly partition the current image.
For each local feature (let's say its visual word ID is k) in this image, pick out the k-th coordinate histogram, and then accumulate one
count to each of the L corresponding cells in this histogram,
according to the coordinate of the local feature. The L cells are
cells where the local feature falls in in L different resolutions.
Concatenate the K multi-resolution coordinate histograms to form a final "long" histogram of the image. When concatenating, the k-th
histogram is weighted by the probability of the k-th visual word.
To compute the kernel value over two images, sum up all the cells of the intersection of their "long" histograms.
Now, I have the following questions:
What is a coordinate histogram? Doesn't a histogram just show the counts for each grouping in the x-axis? How will it provide information on the coordinates of a point?
How would I compute the probability of the k-th visual word?
What will be the use of the "kernel value" that I will get? How will I use it as input to SVM? If I understand it right, is the kernel value is used in the testing phase and not in the training phase? If yes, then how will I train my SVM?
Or do you think I don't need to burden myself with the spatial info and just stick with normal BoW for my situation(benign and malignant tumors)?
Someone please help this poor little undergraduate. You'll have my forever gratefulness if you do. If you have any clarifications, please don't hesitate to ask.
Here is the link to the actual paper, http://www.csd.uwo.ca/~olga/Courses/Fall2014/CS9840/Papers/lazebnikcvpr06b.pdf
MATLAB code is provided here http://web.engr.illinois.edu/~slazebni/research/SpatialPyramid.zip
Co-ordinate histogram (mentioned in your post) is just a sub-region in the image in which you compute the histogram. These slides explain it visually, http://web.engr.illinois.edu/~slazebni/slides/ima_poster.pdf.
You have multiple histograms here, one for each different region in the image. The probability (or the number of items would depend on the sift points in that sub-region).
I think you need to define your pyramid kernel as mentioned in the slides.
A Convolutional Neural Network may be better suited for your task if you have enough training samples. You can probably have a look at Torch or Caffe.

Plotly (Python)- 100+ subplot y axes

I am working with big data sets where I need to graph multiple stacked trends but have come across an issue relating the the number of y axes allowed in a plotly graph. I have tried multiple methods to resolve this but to no avail.
Anytime I attempt to graph data where I use over 100 y-axes trends the trends begin to eclipse the previous ones. Here is an image of my attempt to graph 106 trends:
106 trends
If downsize the number of trends to 99 trends then all of these show in the graph:
99 trends
I am building these graphs in ipython notebook using plotly's python API.
Does plotly have a limit on the number of y axes that are permitted in one graph?

Plotting/finding perimeter of data on a scatter plot

Regarding the included graph (It's been ListLinePlotted to show the data sets more clearly),
1: How would I find and or plot the perimeter of each data set; ideally in List form, so it will scale when I plot it using LisLogPlot alongside the original data. (Similar to FindCurvePath, but for a non-round shape)
2: How would I fill the entire area encompassed by the data set on the ListPlot. i.e. the resulting graph would have four block color areas in the shape of each region.
Essentially I'm just trying plot graphs which clearly show the different regions. If there are better ways then I'd be open to suggestions!
P.S. the regions will never intersect for this particular plot.