1 | function out = flatten_sza(in, isza) |
---|
2 | % Flatten the solar-zenith-angle and column dimensions |
---|
3 | |
---|
4 | if nargin < 2 |
---|
5 | isza = 1:length(in.mu0); |
---|
6 | end |
---|
7 | nsza = length(isza); |
---|
8 | |
---|
9 | ncol = size(in.pressure_hl,2); |
---|
10 | nz = size(in.pressure_hl,1); |
---|
11 | |
---|
12 | out.pressure_hl = in.pressure_hl(:,ceil([1:nsza*ncol]./nsza)); |
---|
13 | if isfield(out,'temperature_hl') |
---|
14 | out.temperature_hl = in.temperature_hl(:,ceil([1:nsza*ncol]./nsza)); |
---|
15 | end |
---|
16 | out.mu0 = repmat(in.mu0(isza), ncol, 1); |
---|
17 | %out.reference_surface_mole_fraction = in.reference_surface_mole_fraction; |
---|
18 | %out.mole_fraction_fl = in.mole_fraction_fl(:,:,ceil([1:nsza*ncol]./nsza)); |
---|
19 | out.flux_up_sw = reshape(in.flux_up_sw(:,isza,:),[nz nsza*ncol]); |
---|
20 | out.flux_dn_sw = reshape(in.flux_dn_sw(:,isza,:),[nz nsza*ncol]); |
---|
21 | out.flux_dn_direct_sw = reshape(in.flux_dn_direct_sw(:,isza,:),[nz nsza*ncol]); |
---|
22 | if isfield(in, 'band_flux_up_sw') |
---|
23 | nband = size(in.band_flux_up_sw,1); |
---|
24 | out.band_wavenumber1_sw = in.band_wavenumber1_sw; |
---|
25 | out.band_wavenumber2_sw = in.band_wavenumber2_sw; |
---|
26 | out.band_flux_up_sw = reshape(in.band_flux_up_sw(:,:,isza,:),[nband nz nsza*ncol]); |
---|
27 | out.band_flux_dn_sw = reshape(in.band_flux_dn_sw(:,:,isza,:),[nband nz nsza*ncol]); |
---|
28 | out.band_flux_dn_direct_sw = reshape(in.band_flux_dn_direct_sw(:,:,isza,:),[nband nz nsza*ncol]); |
---|
29 | end |
---|
30 | if isfield(in, 'spectral_flux_up_sw') |
---|
31 | nspectral = size(in.spectral_flux_up_sw,1); |
---|
32 | out.spectral_flux_up_sw = reshape(in.spectral_flux_up_sw(:,:,isza,:),[nspectral nz nsza*ncol]); |
---|
33 | out.spectral_flux_dn_sw = reshape(in.spectral_flux_dn_sw(:,:,isza,:),[nspectral nz nsza*ncol]); |
---|
34 | out.spectral_flux_dn_direct_sw = reshape(in.spectral_flux_dn_direct_sw(:,:,isza,:),[nspectral nz nsza*ncol]); |
---|
35 | end |
---|
36 | |
---|
37 | |
---|