Skip to content

Commit

Permalink
Fixed some plotting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienbaron committed Aug 26, 2024
1 parent e692064 commit 039c076
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 7 additions & 6 deletions demos/example_image_observables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ using OITOOLS
# read the image file
fitsfile = "./data/2004true.fits";
pixsize = 0.101; # in mas/pixel
x_true = readfits(fitsfile); nx = (size(x_true))[1]; x_true=vec(x_true);
x_true = readfits(fitsfile);
nx = (size(x_true))[1];

# display the image
imdisp(x_true, pixscale = pixsize, tickinterval = 1.0, beamsize = 1.0, beamlocation = [0.85, 0.85], use_colorbar = true)
imdisp(x_true, pixsize = pixsize, tickinterval = 1.0, beamsize = 1.0, beamlocation = [0.85, 0.85], use_colorbar = true)

# read the data file
oifitsfile = "./data/2004-data1.oifits";
data = (readoifits(oifitsfile))[1,1]; # data can be split by wavelength, time, etc.
data = readoifits(oifitsfile); # data can be split by wavelength, time, etc.

# Display the data
uvplot(data);
v2plot(data,logplot=true);# Alternatively, one can do v2plot(data.v2_baseline,data.v2,data.v2_err,logplot=true);
t3phiplot(data);
t3ampplot(data);
plot_v2(data,logplot=true);# Alternatively, one can do v2plot(data.v2_baseline,data.v2,data.v2_err,logplot=true);
plot_t3phi(data);
plot_t3amp(data);

# Compare data to image
#
Expand Down
8 changes: 1 addition & 7 deletions src/oiplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,6 @@ function plot_t3phi(data::Union{OIdata,Array{OIdata,1},Array{OIdata,2}}; figsize
ylabel("Closure phase (degrees)")
ax.grid(true,which="both",color="Grey",linestyle=":")
tight_layout()
if filename !=""
savefig(filename)
end
show(block=false)
end

Expand Down Expand Up @@ -557,7 +554,7 @@ function plot_t3amp_residuals(data::OIdata, t3amp_model::Array{Float64,1}; figsi
end


function plot_t3amp(data::Union{OIdata,Array{OIdata,1}}; figsize=(12,6), color::String="baseline",markopt=false, legend_below=false, t3base="max")
function plot_t3amp(data::Union{OIdata,Array{OIdata,1},Array{OIdata,2}}; figsize=(12,6), color::String="baseline",markopt=false, legend_below=false, t3base="max")
set_oiplot_defaults()

if typeof(data)==OIdata
Expand Down Expand Up @@ -625,9 +622,6 @@ function plot_t3amp(data::Union{OIdata,Array{OIdata,1}}; figsize=(12,6), color::
ylabel("Triple amplitude")
ax.grid(true,which="both",color="Grey",linestyle=":")
tight_layout()
if filename !=""
savefig(filename)
end
show(block=false)
end

Expand Down

0 comments on commit 039c076

Please sign in to comment.