Skip to content

Commit

Permalink
Merge pull request #9 from firasalchalabi/cmap-fix
Browse files Browse the repository at this point in the history
Cmap fix + Clipping off negative values
  • Loading branch information
AtilaSaraiva authored Mar 8, 2024
2 parents 35aea9c + 82138b5 commit 82f42a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/Recipes/SeisOverlayRecipe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ end

function Makie.plot!(overlay::SeisOverlay{<:Tuple{AbstractMatrix{<:Real}}})

seisimage!(overlay, overlay.d[], ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[],
# Clipping the negative values of the first wiggle
clipped_d = copy(overlay.d[])
clipped_d[:, 1] = max.(clipped_d[:, 1], 0)

seisimage!(overlay, clipped_d, ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[],
dy=overlay.dy[],
colormap=overlay.cmap[],
cmap=overlay.cmap[],
vmin=overlay.vmin[],
vmax=overlay.vmax[],
pclip=overlay.pclip[])
seiswiggle!(overlay, overlay.d[], ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[],
seiswiggle!(overlay, clipped_d, ox=overlay.ox[], dx=overlay.dx[], oy=overlay.oy[],
dy=overlay.dy[],
xcur=overlay.xcur[],
wiggle_trace_increment=overlay.wiggle_trace_increment[],
Expand Down
9 changes: 8 additions & 1 deletion src/SeisPlotTX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function SeisPlotTX(d;
trace_width=trace_width, cmap=cmap)

Colorbar(fig[1, 2], overlay)

xlims!(ax, low=ox, high=ox+size(d,2)*dx)

elseif style == "wiggles" || style == "wiggle"
if !isnothing(gx)
ox = gx[1]
Expand All @@ -70,12 +73,16 @@ function SeisPlotTX(d;
wiggle_line_color=wiggle_line_color,
wiggle_fill_color=wiggle_fill_color,
trace_width=trace_width)

xlims!(ax, low=ox-dx, high=ox+size(d,2)*dx)

else
img = seisimage!(ax, d; ox=ox, dx=dx, oy=oy, dy=dy, pclip=pclip, vmin=vmin, vmax=vmax, cmap=cmap)
Colorbar(fig[1,2], img)

xlims!(ax, low=ox, high=ox+size(d,2)*dx)
end

xlims!(ax, low=ox-dx, high=ox+size(d,2)*dx)
return fig, ax

end
Expand Down

0 comments on commit 82f42a6

Please sign in to comment.