-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from ni1o1/0.4.16
0.4.16
- Loading branch information
Showing
29 changed files
with
522 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ Coordinates and Distances | |
|
||
|
||
.. autosummary:: | ||
|
||
:toctree: api/ | ||
|
||
gcj02tobd09 | ||
gcj02towgs84 | ||
wgs84togcj02 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
.. currentmodule:: transbigdata | ||
|
||
****************************** | ||
Activity | ||
****************************** | ||
|
||
Constructor | ||
----------- | ||
.. autosummary:: | ||
:toctree: api/ | ||
|
||
plot_activity | ||
entropy | ||
entropy_rate | ||
ellipse_params | ||
ellipse_plot | ||
|
||
|
||
Activity plot | ||
---------------------------------------------------- | ||
|
||
.. autofunction:: plot_activity | ||
|
||
Entropy | ||
---------------------------------------------------- | ||
|
||
.. autofunction:: entropy | ||
|
||
.. autofunction:: entropy_rate | ||
|
||
|
||
Confidence ellipse | ||
---------------------------------------------------- | ||
|
||
.. autofunction:: ellipse_params | ||
|
||
|
||
.. autofunction:: ellipse_plot | ||
|
||
|
||
用法 | ||
================================================ | ||
|
||
:: | ||
|
||
import pandas as pd | ||
import transbigdata as tbd | ||
import numpy as np | ||
#生成测试用数据 | ||
data = np.random.uniform(1,10,(100,2)) | ||
data[:,1:] = 0.5*data[:,0:1]+np.random.uniform(-2,2,(100,1)) | ||
data = pd.DataFrame(data,columns = ['x','y']) | ||
#绘制数据分布 | ||
import matplotlib.pyplot as plt | ||
plt.figure(1,(5,5)) | ||
#绘制数据点 | ||
plt.scatter(data['x'],data['y'],s = 0.5) | ||
#绘制坐标轴 | ||
plt.plot([-10,10],[0,0],c = 'k') | ||
plt.plot([0,0],[-10,10],c = 'k') | ||
plt.xlim(-15,15) | ||
plt.ylim(-15,15) | ||
plt.show() | ||
|
||
|
||
|
||
.. image:: gisprocess/output_1_0.png | ||
|
||
输入数据与xy坐标所在列名,置信度,估计椭圆参数 | ||
分别代表[中心点坐标,短轴,长轴,角度,面积,扁率 | ||
|
||
:: | ||
|
||
ellip_params = tbd.ellipse_params(data,confidence=95,col = ['x','y']) | ||
ellip_params | ||
|
||
|
||
.. parsed-literal:: | ||
[array([5.78928146, 2.88466235]), | ||
4.6981983145616875, | ||
14.04315715927693, | ||
-58.15524535916836, | ||
51.8186366184246, | ||
0.6654457212665993] | ||
再用tbd.ellipse_plot绘制置信椭圆 | ||
|
||
:: | ||
|
||
#绘制数据分布 | ||
import matplotlib.pyplot as plt | ||
plt.figure(1,(5,5)) | ||
ax = plt.subplot(111) | ||
#绘制数据点 | ||
plt.scatter(data['x'],data['y'],s = 0.5) | ||
#获取置信椭圆参数并绘制椭圆 | ||
#99%置信椭圆 | ||
ellip_params = tbd.ellipse_params(data,confidence=99,col = ['x','y']) | ||
tbd.ellipse_plot(ellip_params,ax,fill = False,edgecolor = 'r',linewidth = 1) | ||
#95%置信椭圆 | ||
ellip_params = tbd.ellipse_params(data,confidence=95,col = ['x','y']) | ||
tbd.ellipse_plot(ellip_params,ax,fill = False,edgecolor = 'b',linewidth = 1) | ||
#90%置信椭圆 | ||
ellip_params = tbd.ellipse_params(data,confidence=90,col = ['x','y']) | ||
tbd.ellipse_plot(ellip_params,ax,fill = False,edgecolor = 'k',linewidth = 1) | ||
#绘制坐标轴 | ||
plt.plot([-10,10],[0,0],c = 'k') | ||
plt.plot([0,0],[-10,10],c = 'k') | ||
plt.xlim(-15,15) | ||
plt.ylim(-15,15) | ||
plt.show() | ||
|
||
|
||
|
||
.. image:: gisprocess/output_3_0.png | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ Data Gridding | |
*************** | ||
|
||
.. autosummary:: | ||
|
||
:toctree: api/ | ||
|
||
area_to_grid | ||
area_to_params | ||
GPS_to_grid | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ Data Aggregating | |
****************** | ||
|
||
.. autosummary:: | ||
|
||
:toctree: api/ | ||
|
||
dataagg | ||
odagg_grid | ||
odagg_shape | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ Load the basemap | |
|
||
|
||
.. autosummary:: | ||
|
||
:toctree: api/ | ||
|
||
plot_map | ||
plotscale | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ | |
|
||
|
||
.. autosummary:: | ||
|
||
:toctree: api/ | ||
|
||
data_summary | ||
sample_duration | ||
|
||
|
Oops, something went wrong.