Go to the documentation of this file.
31 const Agenda& iy_main_agenda,
32 const Index& atmosphere_dim,
39 const Index& cloudbox_on,
41 const Index& basics_checked,
42 const Index& cloudbox_checked,
43 const Index& sensor_checked,
45 const Index& stokes_dim,
47 const Agenda& blackbody_radiation_agenda,
48 const Vector& scat_za_grid,
49 const Vector& scat_aa_grid,
50 const Index& fill_interior,
54 if (!cloudbox_on)
return;
57 if( basics_checked<2 )
58 throw runtime_error(
"The atmosphere, surface and basic control variables "
59 "must be flagged to have passed a consistency check\n"
60 "by basics_checkedCalc (basics_checked=2)!" );
61 if( !cloudbox_checked )
62 throw runtime_error(
"The cloudbox must be flagged to have passed a "
63 "consistency check (cloudbox_checked=1)." );
65 throw runtime_error(
"The sensor variables must be flagged to have passed"
66 "a consistency check (sensor_checked=1)." );
70 const Index Np = cloudbox_limits[1] - cloudbox_limits[0] + 1;
72 const Index Ni = stokes_dim;
73 Index Nlat=1, Nlon=1, Naa=1;
76 if( !(atmosphere_dim == 1 || atmosphere_dim == 3) )
77 throw runtime_error(
"The atmospheric dimensionality must be 1 or 3.");
83 os <<
"It is assumed that you use this method together with DOIT.\n"
84 <<
"Usage of this method then demands that the *iy_main_agenda*\n"
85 <<
"returns frequency based radiance (ie. [W/m2/Hz/sr]).\n"
86 <<
"This requires that *iy_unit* is set to \"1\" and that\n"
87 <<
"*blackbody_radiation_agenda uses *blackbody_radiationPlanck*\n"
88 <<
"or a corresponding WSM.\n"
89 <<
"At least one of these requirements is not met.\n";
90 throw runtime_error( os.str() );
92 if( scat_za_grid[0] != 0. || scat_za_grid[Nza-1] != 180. )
94 "*scat_za_grid* must include 0 and 180 degrees as endpoints." );
95 if( atmosphere_dim == 3 )
97 Naa = scat_aa_grid.
nelem();
98 if( scat_aa_grid[0] != 0. || scat_aa_grid[Naa-1] != 360. )
100 "*scat_aa_grid* must include 0 and 360 degrees as endpoints." );
101 Nlat = cloudbox_limits[3] - cloudbox_limits[2] + 1;
102 Nlon = cloudbox_limits[5] - cloudbox_limits[4] + 1;
107 doit_i_field.
resize( Nf, Np, Nlat, Nlon, Nza, Naa, Ni );
108 doit_i_field = -999e9;
111 Matrix surface_done( Nlat, Nlon, -1 );
116 for(
Index i = 0; i<Naa; i++)
117 { aa_grid[i] = scat_aa_grid[i] - 180; }
120 Vector pos( atmosphere_dim );
123 for(
Index o=0; o<Nlon; o++ )
125 for(
Index a=0; a<Nlat; a++ )
128 if( atmosphere_dim == 3 )
130 pos[1] = lat_grid[ a + cloudbox_limits[2] ];
131 pos[2] = lon_grid[ o + cloudbox_limits[4] ];
134 for(
Index p=Np-1; p>=0; p-- )
137 if( fill_interior || p==0 || p==Np-1 || ( atmosphere_dim==3 &&
138 ( a==0 || a==Nlat-1 || o==0 || o==Nlon-1 ) ) )
141 pos[0] = z_field( p+cloudbox_limits[0], 0, 0 );
144 if( pos[0] > z_surface(a,o) )
146 for(
Index za=0; za<Nza; za++ ) {
148 los[0] = scat_za_grid[za];
151 for(
Index aa=0; aa<Naa; aa++ ) {
154 if( ( za != 0 && za != (Nza-1) ) || aa == 0 )
156 if( atmosphere_dim == 3 )
157 { los[1] = aa_grid[aa]; }
159 get_iy( ws, iy, t_field, z_field, vmr_field, 0,
160 f_grid, pos, los,
Vector(0),
164 doit_i_field(
joker, p, a, o, za, aa,
joker ) = iy;
173 if( surface_done( a, o ) > 0 )
175 for(
Index za=0; za<Nza; za++ ) {
176 for(
Index aa=0; aa<Naa; aa++ ) {
177 for(
Index iv=0; iv<Nf; iv++ ) {
178 for(
Index is=0; is<stokes_dim; is++ ) {
179 doit_i_field(iv,p,a,o,za,aa,is) =
180 doit_i_field(iv,p+1,a,o,za,aa,is);
186 pos[0] = z_surface(a,o);
187 for(
Index za=0; za<Nza; za++ ) {
189 los[0] = scat_za_grid[za];
192 for(
Index aa=0; aa<Naa; aa++ ) {
195 if( ( za != 0 && za != (Nza-1) ) || aa == 0 )
197 if( atmosphere_dim == 3 )
198 { los[1] = aa_grid[aa]; }
200 get_iy( ws, iy, t_field, z_field, vmr_field,
201 0, f_grid, pos, los,
Vector(0),
207 surface_done( a, o ) = 1;
225 const Index& jacobian_do,
226 const Index& cloudbox_on,
228 const Index& basics_checked,
229 const Index& cloudbox_checked,
230 const Index& atmosphere_dim,
235 const Index& stokes_dim,
236 const Vector& scat_za_grid,
237 const Vector& scat_aa_grid,
239 const Index& za_order,
243 if( !(atmosphere_dim == 1 || atmosphere_dim == 3) )
244 throw runtime_error(
"The atmospheric dimensionality must be 1 or 3.");
245 if( !basics_checked )
246 throw runtime_error(
"The atmosphere and basic control variables must be "
247 "flagged to have passed a consistency check (basics_checked=1)." );
248 if( !cloudbox_checked )
249 throw runtime_error(
"The cloudbox must be flagged to have passed a "
250 "consistency check (cloudbox_checked=1)." );
252 throw runtime_error(
"The cloud box is not activated and no outgoing "
253 "field can be returned." );
258 const Index np = cloudbox_limits[1]-cloudbox_limits[0]+1;
262 if( atmosphere_dim == 3 )
264 naa = scat_aa_grid.
nelem();
265 nlat = cloudbox_limits[3]-cloudbox_limits[2]+1;
266 nlon = cloudbox_limits[5]-cloudbox_limits[4]+1;
273 throw runtime_error(
"The variable *scat_za_grid* is empty. Are dummy "
274 "values from *cloudboxOff used?" );
275 if( za_order < 1 || za_order > 5 )
276 throw runtime_error(
"The argument *za_order* must be in the range [1,5].");
277 if( doit_i_field.
ncols() != stokes_dim )
278 throw runtime_error(
"Inconsistency in size between *stokes_dim* and "
280 if( doit_i_field.
nrows() != naa )
281 throw runtime_error(
"Inconsistency in size between *scat_aa_grid* and "
283 if( doit_i_field.
npages() != nza )
284 throw runtime_error(
"Inconsistency in size between *scat_za_grid* and "
286 if( doit_i_field.
nshelves() != nlat )
287 throw runtime_error(
"Inconsistency in size between *doit_i_field* and "
288 "latitude part of *cloudbox_limits*." );
289 if( doit_i_field.
nbooks() != nlon )
290 throw runtime_error(
"Inconsistency in size between *doit_i_field* and "
291 "longitude part of *cloudbox_limits*." );
293 throw runtime_error(
"Inconsistency in size between *doit_i_field* and "
294 "pressure part of *cloudbox_limits*." );
296 throw runtime_error(
"Inconsistency in size between *f_grid* and "
298 if(
min( doit_i_field ) <= -999 )
299 throw runtime_error(
"A very large negative value found in *doit_i_field*. "
300 "Has the radiation field been calculated properly?" );
303 "This method does not provide any jacobians (jacobian_do must be 0)" );
313 rte_pos2gridpos( gp_p, gp_lat, gp_lon, atmosphere_dim, p_grid, lat_grid,
314 lon_grid, z_field, rte_pos );
320 if( atmosphere_dim == 1 )
328 if( fg <
Numeric(cloudbox_limits[2]) ||
329 fg >
Numeric(cloudbox_limits[3]) )
330 throw runtime_error(
"The given *rte_pos* is outside the cloudbox "
331 "(in latitude dimension)!" );
332 gp_lat.
idx -= cloudbox_limits[2];
336 if( fg <
Numeric(cloudbox_limits[4]) ||
337 fg >
Numeric(cloudbox_limits[5]) )
338 throw runtime_error(
"The given *rte_pos* is outside the cloudbox "
339 "(in longitude dimension)!" );
340 gp_lon.
idx -= cloudbox_limits[4];
346 if( fg <
Numeric(cloudbox_limits[0])-1e-6 ||
347 fg >
Numeric(cloudbox_limits[1])+1e-6 )
348 throw runtime_error(
"The given *rte_pos* is outside the cloudbox "
349 "(in pressure dimension)!" );
355 if( fg <=
Numeric(cloudbox_limits[0]) )
357 else if( fg >=
Numeric(cloudbox_limits[1]) )
362 gp_p.
idx -= cloudbox_limits[0];
369 I3.
resize(nf,nza,stokes_dim);
371 for(
Index iv=0; iv<nf; iv++ ) {
372 for(
Index iza=0; iza<nza; iza++ ) {
373 for(
Index is=0; is<stokes_dim; is++ ) {
374 I3(iv,iza,is) =
interp( itw, I4(iv,
joker,iza,is), gp_p );
385 for(
Index iv=0; iv<nf; iv++ )
387 for(
Index is=0; is<stokes_dim; is++ )
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Radiative transfer in cloudbox.
Numeric fractional_gp(const GridPos &gp)
fractional_gp
This file contains the definition of Array.
void resize(Index p, Index r, Index c)
Resize function.
Index nlibraries() const
Returns the number of libraries.
void CloudboxGetIncoming2(Workspace &ws, Tensor7 &doit_i_field, const Agenda &iy_main_agenda, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &basics_checked, const Index &cloudbox_checked, const Index &sensor_checked, const Vector &f_grid, const Index &stokes_dim, const String &iy_unit, const Agenda &blackbody_radiation_agenda, const Vector &scat_za_grid, const Vector &scat_aa_grid, const Index &fill_interior, const Verbosity &)
Declarations for agendas.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
Declarations having to do with the four output streams.
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Structure to store a grid position for higher order interpolation.
The implementation for String, the ARTS string class.
Index nelem() const
Returns the number of elements.
Index nvitrines() const
Returns the number of vitrines.
Index npages() const
Returns the number of pages.
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
void get_iy(Workspace &ws, Matrix &iy, ConstTensor3View t_field, ConstTensor3View z_field, ConstTensor4View vmr_field, const Index &cloudbox_on, ConstVectorView f_grid, ConstVectorView rte_pos, ConstVectorView rte_los, ConstVectorView rte_pos2, const Agenda &iy_main_agenda)
get_iy
void iyInterpCloudboxField2(Matrix &iy, const Tensor7 &doit_i_field, const Vector &rte_pos, const Vector &rte_los, const Index &jacobian_do, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &basics_checked, const Index &cloudbox_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Index &stokes_dim, const Vector &scat_za_grid, const Vector &scat_aa_grid, const Vector &f_grid, const Index &za_order, const Verbosity &)
void resize(Index r, Index c)
Resize function.
Structure to store a grid position.
Index nbooks() const
Returns the number of books.
Propagation path structure and functions.
Header file for logic.cc.
Declaration of functions in rte.cc.
Header file for special_interp.cc.
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
rte_pos2gridpos
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
void gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
Set up grid positions for higher order interpolation.
Auxiliary header stuff related to workspace variable groups.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
The global header file for ARTS.
This file contains basic functions to handle XML data files.
Template functions for general supergeneric ws methods.