0001 function [bNpar0,bdNpar0,bPlhtot,param_tor,param_pol] = iproc_spectrum_jd(spectrum,select,signs)
0002
0003 if nargin < 3,
0004 signs.ip = 1;
0005 signs.b0 = -1;
0006 end
0007
0008 if nargin < 2,
0009 select = struct;
0010 end
0011
0012 if ~isfield(spectrum,'Plhtot'),
0013 spectrum.Plhtot = 1e6;
0014 end
0015
0016
0017
0018
0019 [bNtor0,bdNtor0,bPlhtor,param_tor] = proc_aloha_spec_jd(spectrum.nz,NaN,real(spectrum.dP_nz),spectrum.Plhtot,spectrum.param_tor,0,select);
0020
0021 if ~isfield(spectrum,'ny') || ~isfield(spectrum,'dP'),
0022 opt_ny = 0;
0023 elseif ~isfield(select,'inter') || ~select.inter,
0024 opt_ny = spectrum.param_pol.opt_ny;
0025 else
0026 opt_ny = iselect_jd({'With multiple vertical positions','With poloidal spectrum'},'How do you want to describe the wave poloidally ?',select.opt_gui,select.style,1) - 1;
0027 end
0028
0029 if opt_ny == 1,
0030 [bNpol0,bdNpol0,bPlhpol,param_pol] = proc_aloha_spec_jd(spectrum.ny,NaN,sum(real(spectrum.dP.')),1,spectrum.param_pol,0,select);
0031 else
0032 bNpol0 = 0;
0033 bdNpol0 = 0;
0034 bPlhpol = 1;
0035 end
0036
0037 param_pol.opt_ny = opt_ny;
0038
0039
0040
0041 nlobes_tor = length(bNtor0);
0042 nlobes_pol = length(bNpol0);
0043
0044 bNpar0 = NaN(1,nlobes_tor*nlobes_pol);
0045 bdNpar0 = NaN(1,nlobes_tor*nlobes_pol);
0046 bPlhtot = NaN(1,nlobes_tor*nlobes_pol);
0047
0048
0049
0050
0051 for iy = 1:nlobes_tor,
0052 bNpar0((iy - 1)*nlobes_pol + (1:nlobes_pol)) = -i*bNtor0(iy)*signs.ip*signs.b0 + bNpol0;
0053
0054
0055
0056
0057
0058
0059
0060 bdNpar0((iy - 1)*nlobes_pol + (1:nlobes_pol)) = bdNtor0(iy)*ones(1,length(bdNpol0));
0061
0062 bPlhtot((iy - 1)*nlobes_pol + (1:nlobes_pol)) = bPlhtor(iy)*bPlhpol;
0063 end
0064