Dear All,
I am a new user of Julia following this Example. I got an error using the below code, any suggestions or comments will be appreciated :
using GeophysicalModelGenerator, GeoDatasets,DelimitedFiles
Load data:
data=readdlm(“peakdelay_3_Degrees_Hz.txt”,‘,’,‘\n’, skipstart=0,header=false)
lon = data[:,1];
lat = data[:,2];
depth = 1*data[:,3];
peakdelay = data[:,4];resolution = (length(unique(lon)), length(unique(lat)), length(unique(depth)))
Lon = reshape(lon, resolution);
Lat = reshape(lat, resolution);
Depth = reshape(depth, resolution);
peakdelay = reshape(peakdelay, resolution);EQ_Data = GeoData(Lon,Lat,Depth,(Peakdelay=peakdelay,));
I am getting this error while running the last command line, I have tried to double check each variable :
ERROR: It appears that the lon array has a wrong ordering
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] GeoData(lon::Array{Float64, 3}, lat::Array{Float64, 3}, depth::Array{Float64, 3}, fields::@NamedTuple{Peakdelay::Array{Float64, 3}}, atts::Nothing)
@ GeophysicalModelGenerator ~/.julia/packages/GeophysicalModelGenerator/AiGOf/src/data_types.jl:175
[3] GeoData(lon::Array{Float64, 3}, lat::Array{Float64, 3}, depth::Array{Float64, 3}, fields::@NamedTuple{Peakdelay::Array{Float64, 3}})
@ GeophysicalModelGenerator ~/.julia/packages/GeophysicalModelGenerator/AiGOf/src/data_types.jl:158
[4] top-level scope
@ REPL[19]:1
The file input is in this format :
104.347,29.347,1500,0,0
104.347,29.347,433.333333333333,0,0
104.347,29.347,-633.333333333333,0,0
104.347,29.347,-1700,0,0
104.347,29.347,-2766.66666666667,0,0
104.347,29.347,-3833.33333333333,0,0
104.347,29.347,-4900,0,0
104.347,29.347,-5966.66666666667,0,0
104.347,29.347,-7033.33333333333,0,0
104.347,29.347,-8100,0,0
104.347,29.3705384615385,1500,0,0
104.347,29.3705384615385,433.333333333333,0,0
104.347,29.3705384615385,-633.333333333333,0,0
104.347,29.3705384615385,-1700,0,0
104.347,29.3705384615385,-2766.66666666667,0,0
104.347,29.3705384615385,-3833.33333333333,0,0
104.347,29.3705384615385,-4900,0,0