Commit adaddee7 authored by Alberto Ramos's avatar Alberto Ramos

Corercted bug for i/o compatibility

parent 6ed7f926
...@@ -383,18 +383,18 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64}) ...@@ -383,18 +383,18 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
else else
for i in 1:nid for i in 1:nid
v = Vector{String}(undef, nrep[i]) v = Vector{String}(undef, nrep[i])
if nds[i] == 1 idc = Vector{Int32}(undef, nds[i])
idc = Vector{Int32}(undef, 2)
else
idc = Vector{Int32}(undef, nds[i])
end
BDIO.BDIO_read(fb, ifoo) BDIO.BDIO_read(fb, ifoo)
for j in 1:nrep[i] for j in 1:nrep[i]
v[j] = BDIO.BDIO_read_str(fb) v[j] = BDIO.BDIO_read_str(fb)
end end
BDIO.BDIO_read(fb, idc) BDIO.BDIO_read(fb, idc)
add_repnames(convert(Int64, ids_obs[i]), ws, v, convert(Vector{Int64}, idc)) if (length(idc) == 1)
add_repnames(convert(Int64, ids_obs[i]), ws, v, [1,2])
else
add_repnames(convert(Int64, ids_obs[i]), ws, v, convert(Vector{Int64}, idc))
end
end end
end end
...@@ -456,7 +456,12 @@ function write_bdio(p::uwreal, fb, iu::Int, ws::wspace; name="NO NAME") ...@@ -456,7 +456,12 @@ function write_bdio(p::uwreal, fb, iu::Int, ws::wspace; name="NO NAME")
for j in 1:length(v) for j in 1:length(v)
BDIO.BDIO_write!(fb, v[j]*"\0") BDIO.BDIO_write!(fb, v[j]*"\0")
end end
BDIO.BDIO_write!(fb, convert(Vector{Int32}, get_repidc_from_id(p.ids[i], ws))) idc = convert(Vector{Int32}, get_repidc_from_id(p.ids[i], ws))
if length(idc) == 2
BDIO.BDIO_write!(fb, [convert(Int32, 1)])
else
BDIO.BDIO_write!(fb, convert(Vector{Int32}, get_repidc_from_id(p.ids[i], ws)))
end
end end
BDIO.BDIO_write_hash!(fb) BDIO.BDIO_write_hash!(fb)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment