Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count number of point data nearby a regular grid point #67

Merged
merged 7 commits into from
Feb 29, 2024

Conversation

boriskaus
Copy link
Member

this function is useful to create a 3D map of earthquake events, which can be used to generate model setups.

example:

julia> Grid_cart = CartData(XYZGrid(-20:20,-20:.1:20,-30:30))
CartData 
    size    : (41, 401, 61)
    x       ϵ [ -20.0 : 20.0]
    y       ϵ [ -20.0 : 20.0]
    z       ϵ [ -30.0 : 30.0]
    fields  : (:Z,)

#Create some random point data
julia> pt = rand(10_000,3) .- 0.5;
julia> pt[:,1] .*= 20;
julia> pt[:,2] .*= 20;
julia> pt[:,3] .*= 30;

julia> Grid_Count = PointData2NearestGrid(pt[:,1],pt[:,2],pt[:,3], Grid_cart; radius_factor=2)
CartData 
    size    : (41, 401, 61)
    x       ϵ [ -20.0 : 20.0]
    y       ϵ [ -20.0 : 20.0]
    z       ϵ [ -30.0 : 30.0]
    fields  : (:Z, :Count)

@boriskaus boriskaus requested a review from mthielma February 29, 2024 13:38
@boriskaus boriskaus requested a review from aelligp February 29, 2024 13:41
@boriskaus boriskaus merged commit 7c5c9f2 into main Feb 29, 2024
24 checks passed
@boriskaus boriskaus deleted the bk-event-counts branch February 29, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants