using AIBECS, Plots grd, _ = OCIM2.load() fdummy(lat, lon, depth) = @. cosd(lat) * sind(lon) + sqrt(depth) / 30 dummy = fdummy(latlondepthvecs(grd)...) using OceanographyCruises Sydney = Station(name="Sydney", lat=-30, lon=156) ALOHA = Station(name="ALOHA", lat=22.75, lon=-158) Nstations = 10 stations = range(Sydney, ALOHA, length=Nstations, westmostlon=0) ct = CruiseTrack(name="CruisyMcCruiseFace", stations=stations) surfacemap(dummy, grd, color=:grays) plotcruisetrack!(ct, markercolor=:red) function randomdepths(n, max) depths = cumsum(rand(n+1)) return max * view(depths,1:n) / maximum(depths) end Nobs = rand(1:20, Nstations) # number of obs per station/profile depths = [randomdepths(Nobs[i], 4000) for i in 1:Nstations] obs = [[fdummy(st.lat, st.lon, d) .+ 0.1randn() for d in depths[i]] for (i,st) in enumerate(stations)] profiles = [DepthProfile(station=st, depths=depths[i], values=obs[i]) for (i,st) in enumerate(stations)] t = Transect(tracer="dummy", cruise=ct.name, profiles=profiles) plottransect(dummy, grd, ct=ct) plotscattertransect!(t) dummy1 = cosd.(latvec(grd)) + sqrt.(depthvec(grd)) / 30 dummy2 = cosd.(2latvec(grd)) + 0.5sqrt.(depthvec(grd)) / 30 ratioatstation(dummy1, dummy2, grd, ALOHA, xlabel="dummy 1", ylabel="dummy 2") ratioatstation!(dummy1, dummy2, grd, Sydney, marker=:square)