;+ ; Contains the flatten_3ant_n3_data procedure ; ; :Author: ; Baptiste Cecconi ; ; :History: ; 2009/04/27: Created ; ; 2009/04/27: Last Edit ;- ; ;+ ; flatten_3ant_n3_data is a function that <behavior desc here> ; ; :Returns: ; <return desc here> ; ; :Params: ; n3_in: in, required, type=sometype ; A parameter named n3_in ;- FUNCTION flatten_3ant_n3_data, n3_in n_in = n_elements(n3_in) n_out = 2l*n_in i0 = lindgen(n_in)*2l i1 = lindgen(n_in)*2l+1 n3_name = TAG_NAMES(n3_in, /STRUCTURE_NAME) case n3_name of 'DATA_N3B' : begin n3_out = replicate({data_n3b_flat}, n_out) n3_out(i0).ydh = n3_in.ydh n3_out(i1).ydh = n3_in.ydh n3_out(i0).num = n3_in.num(0) n3_out(i1).num = n3_in.num(1) n3_out(i0).s = n3_in.s(0) n3_out(i1).s = n3_in.s(1) n3_out(i0).q = n3_in.q(0) n3_out(i1).q = n3_in.q(1) n3_out(i0).u = n3_in.u(0) n3_out(i1).u = n3_in.u(1) n3_out(i0).v = n3_in.v(0) n3_out(i1).v = n3_in.v(1) n3_out(i0).th = n3_in.th n3_out(i1).th = n3_in.th n3_out(i0).ph = n3_in.ph n3_out(i1).ph = n3_in.ph n3_out(i0).zr = n3_in.zr n3_out(i1).zr = n3_in.zr n3_out(i0).sn = n3_in.sn(0:1) n3_out(i1).sn = n3_in.sn(2:3) end 'DATA_N3C' : begin n3_out = replicate({data_n3c_flat}, n_out) n3_out(i0).ydh = n3_in.ydh n3_out(i1).ydh = n3_in.ydh n3_out(i0).num = n3_in.num(0) n3_out(i1).num = n3_in.num(1) n3_out(i0).s = n3_in.s n3_out(i1).s = n3_in.s n3_out(i0).q = n3_in.q n3_out(i1).q = n3_in.q n3_out(i0).u = n3_in.u n3_out(i1).u = n3_in.u n3_out(i0).v = n3_in.v(0) n3_out(i1).v = n3_in.v(1) n3_out(i0).th = n3_in.th(0) n3_out(i1).th = n3_in.th(1) n3_out(i0).ph = n3_in.ph(0) n3_out(i1).ph = n3_in.ph(1) n3_out(i0).zr = n3_in.zr n3_out(i1).zr = n3_in.zr n3_out(i0).sn = n3_in.sn(0:1) n3_out(i1).sn = n3_in.sn(2:3) end else : begin message,/info,'Wrong N3x input structure. Only N3b and N3c data can be treated...' return,-1 end endcase return, n3_out end