Skip to content

Commit

Permalink
fixed dependency issues and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cossatot committed Aug 8, 2023
1 parent 4960fa9 commit fae1f1e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
Proj = "c94c279d-25a6-4763-9509-64d165bea63e"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
Expand Down
2 changes: 1 addition & 1 deletion src/elastic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Base.Threads.@spawn
import Base.Threads.@threads

using ..Oiler
using ..Oiler: Fault, VelocityVectorSphere, fault_oblique_merc, get_gnss_vels,
using ..Oiler: Fault, VelocityVectorSphere, get_gnss_vels,
get_coords_from_vel_array, az_to_angle, okada


Expand Down
2 changes: 1 addition & 1 deletion src/faults.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Distributions: MvNormal

using Oiler
using ..Oiler: VelocityVectorSphere, average_azimuth, az_to_angle,
angle_difference, rotate_velocity, EARTH_RAD_KM, oblique_merc, PoleCart,
angle_difference, rotate_velocity, EARTH_RAD_KM, PoleCart,
PoleSphere

const direction_map = Dict{String,Float64}("N" => 0.0,
Expand Down
34 changes: 17 additions & 17 deletions src/geom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ module Geom

export azimuth, gc_distance, average_azimuth, az_to_angle, angle_to_az,
angle_difference, rotate_velocity, rotate_xy_vec, oblique_merc

import Statistics: mean
#import Proj: CRS, Transformation

using Oiler
using ..Oiler: EARTH_RAD_KM
using LinearAlgebra

using Proj: CRS, Transformation

struct LineString
coords::Array{Float64,2}
end
Expand Down Expand Up @@ -312,22 +313,21 @@ function get_oblique_merc(lon1, lat1, lon2, lat2)
end


# deprecated but don't want to delete quite yet
#function oblique_merc(lons, lats, lon1, lat1, lon2, lat2)
# wgs84 = "+proj=longlat +datum=WGS84 +nodefs"
# omerc = get_oblique_merc(lon1, lat1, lon2, lat2)
# trans = Transformation(wgs84, omerc; always_xy=true)
#
#
# x = zeros(size(lons))
# y = zeros(size(lons))
#
# for i in eachindex(lons)
# @inbounds x[i], y[i] = trans(lons[i], lats[i])
# end
#
# (x, y)
#end
function oblique_merc(lons, lats, lon1, lat1, lon2, lat2)
wgs84 = "+proj=longlat +datum=WGS84 +nodefs"
omerc = get_oblique_merc(lon1, lat1, lon2, lat2)
trans = Transformation(wgs84, omerc; always_xy=true)


x = zeros(size(lons))
y = zeros(size(lons))

for i in eachindex(lons)
@inbounds x[i], y[i] = trans(lons[i], lats[i])
end

(x, y)
end


function bearing(final_lon, final_lat, start_lon, start_lat)
Expand Down
2 changes: 1 addition & 1 deletion src/tris.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export Tri
using Setfield
using LinearAlgebra

import Proj: Transformation#Projection, transform
# import Proj: Transformation#Projection, transform

using ..Oiler

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Pkg
Pkg.activate("..")

using Test

using Oiler
Expand Down

0 comments on commit fae1f1e

Please sign in to comment.