11using NearestNeighbors
22
3- export pointData2NearestGrid , countmap
3+ export point_to_nearest_grid , countmap
44
55
66"""
7- Grid_counts = pointData2NearestGrid (Point::CartData, Grid::CartData; radius_factor=1)
7+ Grid_counts = point_to_nearest_grid (Point::CartData, Grid::CartData; radius_factor=1)
88
99Uses nearest neighbour interpolation to count how many points (given by `Point`) are in the vicinity of a 3D `Grid`.
1010The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
@@ -13,38 +13,38 @@ The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
1313
1414`Grid_counts` is `Grid` but with an additional field `Count` that has the number of hits
1515"""
16- function pointData2NearestGrid (Point:: CartData , Grid:: CartData ; radius_factor= 1 )
16+ function point_to_nearest_grid (Point:: CartData , Grid:: CartData ; radius_factor= 1 )
1717
1818 @assert length (size (Point. x)) == 1
1919
2020 # call routine
21- Count = pointData2NearestGrid (NumValue (Point. x),NumValue (Point. y), NumValue (Point. z), NumValue (Grid. x),NumValue (Grid. y),NumValue (Grid. z); radius_factor= radius_factor)
21+ Count = point_to_nearest_grid (NumValue (Point. x),NumValue (Point. y), NumValue (Point. z), NumValue (Grid. x),NumValue (Grid. y),NumValue (Grid. z); radius_factor= radius_factor)
2222
2323 # return CartGrid with added field
2424 return addfield (Grid," Count" ,Count);
2525end
2626
2727
2828"""
29- Grid_counts = pointData2NearestGrid (pt_x,pt_y,pt_z, Grid::CartData; radius_factor=1)
29+ Grid_counts = point_to_nearest_grid (pt_x,pt_y,pt_z, Grid::CartData; radius_factor=1)
3030
3131Uses nearest neighbour interpolation to count how many points (given by `pt_x`,`pt_y`,`pt_z` coordinate vectors) are in the
3232vicinity of 3D `CartGrid` specified by `Grid`. The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
3333
3434`Grid_counts` is `Grid` but with an additional field `Count` that has the number of hits
3535"""
36- function pointData2NearestGrid (pt_x,pt_y,pt_z, Grid:: CartData ; radius_factor= 1 )
36+ function point_to_nearest_grid (pt_x,pt_y,pt_z, Grid:: CartData ; radius_factor= 1 )
3737
3838 # call routine
39- Count = pointData2NearestGrid (pt_x,pt_y,pt_z, NumValue (Grid. x),NumValue (Grid. y),NumValue (Grid. z); radius_factor= radius_factor)
39+ Count = point_to_nearest_grid (pt_x,pt_y,pt_z, NumValue (Grid. x),NumValue (Grid. y),NumValue (Grid. z); radius_factor= radius_factor)
4040
4141 # return CartGrid with added field
4242 return addfield (Grid," Count" ,Count);
4343end
4444
4545
4646"""
47- Grid_counts = pointData2NearestGrid (Point::GeoData, Grid::GeoData; radius_factor=1)
47+ Grid_counts = point_to_nearest_grid (Point::GeoData, Grid::GeoData; radius_factor=1)
4848
4949Uses nearest neighbour interpolation to count how many points (given by `Point`) are in the vicinity of a 3D `Grid`.
5050The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
@@ -53,44 +53,44 @@ The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
5353
5454`Grid_counts` is `Grid` but with an additional field `Count` that has the number of hits
5555"""
56- function pointData2NearestGrid (Point:: GeoData , Grid:: GeoData ; radius_factor= 1 )
56+ function point_to_nearest_grid (Point:: GeoData , Grid:: GeoData ; radius_factor= 1 )
5757
5858 @assert length (size (Point. lon)) == 1
5959
6060 # call routine
61- Count = pointData2NearestGrid (NumValue (Point. lon),NumValue (Point. lat), NumValue (Point. depth), NumValue (Grid. lon),NumValue (Grid. lat),NumValue (Grid. depth); radius_factor= radius_factor)
61+ Count = point_to_nearest_grid (NumValue (Point. lon),NumValue (Point. lat), NumValue (Point. depth), NumValue (Grid. lon),NumValue (Grid. lat),NumValue (Grid. depth); radius_factor= radius_factor)
6262
6363 # return CartGrid with added field
6464 return addfield (Grid," Count" ,Count);
6565end
6666
6767
6868"""
69- Grid_counts = pointData2NearestGrid (pt_x,pt_y,pt_z, Grid::GeoData; radius_factor=1)
69+ Grid_counts = point_to_nearest_grid (pt_x,pt_y,pt_z, Grid::GeoData; radius_factor=1)
7070
7171Uses nearest neighbour interpolation to count how many points (given by `pt_x`,`pt_y`,`pt_z` coordinate vectors) are in the
7272vicinity of 3D `GeoData` specified by `Grid`. The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
7373
7474`Grid_counts` is `Grid` but with an additional field `Count` that has the number of hits
7575"""
76- function pointData2NearestGrid (pt_x,pt_y,pt_z, Grid:: GeoData ; radius_factor= 1 )
76+ function point_to_nearest_grid (pt_x,pt_y,pt_z, Grid:: GeoData ; radius_factor= 1 )
7777
7878 # call routine
79- Count = pointData2NearestGrid (pt_x,pt_y,pt_z, NumValue (Grid. lon),NumValue (Grid. lat),NumValue (Grid. depth); radius_factor= radius_factor)
79+ Count = point_to_nearest_grid (pt_x,pt_y,pt_z, NumValue (Grid. lon),NumValue (Grid. lat),NumValue (Grid. depth); radius_factor= radius_factor)
8080
8181 # return CartGrid with added field
8282 return addfield (Grid," Count" ,Count);
8383end
8484
8585"""
86- count = pointData2NearestGrid (pt_x,pt_y,pt_z, X,Y,Z; radius_factor=1)
86+ count = point_to_nearest_grid (pt_x,pt_y,pt_z, X,Y,Z; radius_factor=1)
8787
8888This uses nearest neighbour interpolation to count how many points (given by `pt_x`,`pt_y`,`pt_z` coordinate vectors) are in the
8989vicinity of 3D grid point specified by `X`,`Y`,`Z` 3D coordinate arrays, with regular spacing `(Δx,Δy,Δz)`.
9090The search radius is `R=radius_factor*(Δx² + Δy² + Δz²)^(1/3)`
9191
9292"""
93- function pointData2NearestGrid (pt_x,pt_y,pt_z, X,Y,Z; radius_factor= 1 )
93+ function point_to_nearest_grid (pt_x,pt_y,pt_z, X,Y,Z; radius_factor= 1 )
9494
9595 data = zeros (3 ,length (pt_x));
9696 data[1 ,:],data[2 ,:],data[3 ,:] = pt_x[:], pt_y[:], pt_z[:]
0 commit comments