Skip to content

Commit 9bb3790

Browse files
committed
added default distance for gridDistance failures
1 parent 56798fa commit 9bb3790

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/seismicity/smoothing.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ function smoothing(fname_count::String, fname_config::String, fname_out::String=
9797
end
9898

9999

100-
function smoothing(fname_count::String, smoothing_σs::Array, maxdistkm::Real)
101100
"""
102101
smoothing(fname, smoothing_σs, maxdistkm)
103102
@@ -113,7 +112,8 @@ used to perform the smoothing.
113112
julia> smoothing('count.csv', [[1.0, 20]], 50)
114113
```
115114
"""
116-
115+
function smoothing(fname_count::String, smoothing_σs::Array, maxdistkm::Real;
116+
default_distance::Int64=20)
117117
df = DataFrame(CSV.File(fname_count));
118118
df[!,:h3idx] = convert.(UInt64,df[!,:h3idx]);
119119

@@ -161,10 +161,8 @@ julia> smoothing('count.csv', [[1.0, 20]], 50)
161161
else
162162
d = h3Distance(base, idx[2])
163163
if d isa H3ErrorCode
164-
println("failed: ", base, ", ", idx[2])
165-
else
166-
println("worked: ", base, ", ", idx[2])
167-
164+
println("failed: ", base, ", ", idx[2]". Using default $default_distance")
165+
d = default_distance
168166
end
169167

170168
end

0 commit comments

Comments
 (0)