ARTS 2.5.11 (git: 725533f0)
m_sensor.cc File Reference

Workspace functions related to sensor modelling variables. More...

#include <algorithm>
#include <cmath>
#include <stdexcept>
#include <string>
#include "arts.h"
#include "arts_constants.h"
#include "arts_conversions.h"
#include "auto_md.h"
#include "check_input.h"
#include "gridded_fields.h"
#include "interp.h"
#include "m_select.h"
#include "math_funcs.h"
#include "matpack_math.h"
#include "messages.h"
#include "ppath.h"
#include "rte.h"
#include "sensor.h"
#include "sorting.h"
#include "special_interp.h"
#include "xml_io.h"

Go to the source code of this file.

Functions

void AntennaMultiBeamsToPencilBeams (Matrix &sensor_pos, Matrix &sensor_los, Matrix &antenna_dlos, Index &antenna_dim, Matrix &mblock_dlos, const Index &atmosphere_dim, const Verbosity &verbosity)
 WORKSPACE METHOD: AntennaMultiBeamsToPencilBeams.
 
void AntennaOff (Index &antenna_dim, Matrix &mblock_dlos, const Verbosity &verbosity)
 WORKSPACE METHOD: AntennaOff.
 
void antenna_responseGaussian (GriddedField4 &r, const Vector &f_points, const Vector &fwhm, const Numeric &grid_width, const Index &grid_npoints, const Index &do_2d, const Verbosity &verbosity)
 WORKSPACE METHOD: antenna_responseGaussian.
 
void antenna_responseGaussianConstant (GriddedField4 &r, const Numeric &fwhm, const Numeric &grid_width, const Index &grid_npoints, const Index &do_2d, const Verbosity &verbosity)
 WORKSPACE METHOD: antenna_responseGaussianConstant.
 
void antenna_responseGaussianEffectiveSize (GriddedField4 &r, const Numeric &leff, const Numeric &grid_width, const Index &grid_npoints, const Index &nf, const Numeric &fstart, const Numeric &fstop, const Index &do_2d, const Verbosity &verbosity)
 WORKSPACE METHOD: antenna_responseGaussianEffectiveSize.
 
void backend_channel_responseFlat (ArrayOfGriddedField1 &r, const Numeric &resolution, const Verbosity &)
 WORKSPACE METHOD: backend_channel_responseFlat.
 
void backend_channel_responseGaussian (ArrayOfGriddedField1 &r, const Vector &f_backend, const Vector &fwhm, const Numeric &grid_width, const Index &grid_npoints, const Verbosity &verbosity)
 WORKSPACE METHOD: backend_channel_responseGaussian.
 
void backend_channel_responseGaussianConstant (ArrayOfGriddedField1 &r, const Numeric &fwhm, const Numeric &grid_width, const Index &grid_npoints, const Verbosity &verbosity)
 WORKSPACE METHOD: backend_channel_responseGaussianConstant.
 
void f_gridFromSensorAMSU (Vector &f_grid, const Vector &lo, const ArrayOfVector &f_backend, const ArrayOfArrayOfGriddedField1 &backend_channel_response, const Numeric &spacing, const Verbosity &verbosity)
 WORKSPACE METHOD: f_gridFromSensorAMSU.
 
void f_gridFromSensorAMSUgeneric (Vector &f_grid, const ArrayOfVector &f_backend_multi, const ArrayOfArrayOfGriddedField1 &backend_channel_response_multi, const Numeric &spacing, const Vector &verbosityVect, const Verbosity &verbosity)
 WORKSPACE METHOD: f_gridFromSensorAMSUgeneric.
 
void f_gridFromSensorHIRS (Vector &f_grid, const Vector &f_backend, const ArrayOfGriddedField1 &backend_channel_response, const Numeric &spacing, const Verbosity &verbosity)
 WORKSPACE METHOD: f_gridFromSensorHIRS.
 
void f_gridMetMM (Vector &f_grid, Vector &f_backend, ArrayOfArrayOfIndex &channel2fgrid_indexes, ArrayOfVector &channel2fgrid_weights, const Matrix &mm_back, const Vector &freq_spacing, const ArrayOfIndex &freq_number, const Numeric &freq_merge_threshold, const Verbosity &)
 WORKSPACE METHOD: f_gridMetMM.
 
void mblock_dlosFrom1dAntenna (Matrix &mblock_dlos, const GriddedField4 &antenna_response, const Index &npoints, const Verbosity &)
 WORKSPACE METHOD: mblock_dlosFrom1dAntenna.
 
void sensor_responseAntenna (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Matrix &sensor_response_dlos_grid, const Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Index &atmosphere_dim, const Index &antenna_dim, const Matrix &antenna_dlos, const GriddedField4 &antenna_response, const Index &sensor_norm, const String &option_2d, const Vector &solid_angles, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseAntenna.
 
void sensor_responseBackend (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Vector &f_backend, const ArrayOfGriddedField1 &backend_channel_response, const Index &sensor_norm, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseBackend.
 
void sensor_responseBackendFrequencySwitching (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Vector &f_backend, const ArrayOfGriddedField1 &backend_channel_response, const Index &sensor_norm, const Numeric &df1, const Numeric &df2, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseBackendFrequencySwitching.
 
void sensor_responseBeamSwitching (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Matrix &sensor_response_dlos_grid, const Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Numeric &w1, const Numeric &w2, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseBeamSwitching.
 
void sensor_responseFrequencySwitching (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseFrequencySwitching.
 
void sensor_responseIF2RF (Vector &sensor_response_f, Vector &sensor_response_f_grid, const Numeric &lo, const String &sideband_mode, const Verbosity &)
 WORKSPACE METHOD: sensor_responseIF2RF.
 
void sensor_responseFillFgrid (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Index &polyorder, const Index &nfill, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseFillFgrid.
 
void sensor_responseInit (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, const Vector &f_grid, const Matrix &mblock_dlos, const Index &antenna_dim, const Index &atmosphere_dim, const Index &stokes_dim, const Index &sensor_norm, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseInit.
 
void sensorOff (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, Matrix &mblock_dlos, const Index &stokes_dim, const Vector &f_grid, const Verbosity &verbosity)
 WORKSPACE METHOD: sensorOff.
 
void sensor_responseMixer (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Numeric &lo, const GriddedField1 &sideband_response, const Index &sensor_norm, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseMixer.
 
void sensor_responseMetMM (Index &antenna_dim, Matrix &mblock_dlos, Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, Index &sensor_norm, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &f_grid, const Vector &f_backend, const ArrayOfArrayOfIndex &channel2fgrid_indexes, const ArrayOfVector &channel2fgrid_weights, const String &iy_unit, const Matrix &antenna_dlos, const ArrayOfString &mm_pol, const Vector &mm_ant, const Index &use_antenna, const Index &mirror_dza, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseMetMM.
 
void sensor_responseMixerBackendPrecalcWeights (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Vector &f_backend, const ArrayOfArrayOfIndex &channel2fgrid_indexes, const ArrayOfVector &channel2fgrid_weights, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseMixerBackendPrecalcWeights.
 
void sensor_responseMultiMixerBackend (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Vector &lo_multi, const ArrayOfGriddedField1 &sideband_response_multi, const ArrayOfString &sideband_mode_multi, const ArrayOfVector &f_backend_multi, const ArrayOfArrayOfGriddedField1 &backend_channel_response_multi, const Index &sensor_norm, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseMultiMixerBackend.
 
void sensor_responsePolarisation (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const Index &stokes_dim, const String &iy_unit, const ArrayOfIndex &instrument_pol, const Verbosity &)
 WORKSPACE METHOD: sensor_responsePolarisation.
 
void sensor_responseStokesRotation (Sparse &sensor_response, const Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Index &stokes_dim, const Vector &stokes_rotation, const Verbosity &)
 WORKSPACE METHOD: sensor_responseStokesRotation.
 
void sensor_responseGenericAMSU (Vector &f_grid, Index &antenna_dim, Matrix &mblock_dlos, Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, Index &sensor_norm, const Index &atmosphere_dim, const Index &stokes_dim, const Matrix &sensor_description_amsu, const Numeric &spacing, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseGenericAMSU.
 
void sensor_responseSimpleAMSU (Vector &f_grid, Index &antenna_dim, Matrix &mblock_dlos, Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, Index &sensor_norm, const Index &atmosphere_dim, const Index &stokes_dim, const Matrix &sensor_description_amsu, const Numeric &spacing, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseSimpleAMSU.
 
void WMRFSelectChannels (Vector &f_grid, Sparse &wmrf_weights, Vector &f_backend, const ArrayOfIndex &wmrf_channels, const Verbosity &verbosity)
 WORKSPACE METHOD: WMRFSelectChannels.
 
void sensor_responseWMRF (Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Sparse &wmrf_weights, const Vector &f_backend, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_responseWMRF.
 
void ySimpleSpectrometer (Vector &y, Vector &y_f, const Matrix &iy, const Index &stokes_dim, const Vector &f_grid, const Numeric &df, const Verbosity &verbosity)
 WORKSPACE METHOD: ySimpleSpectrometer.
 
void yApplySensorPol (Vector &y, Vector &y_f, ArrayOfIndex &y_pol, Matrix &y_pos, Matrix &y_los, ArrayOfVector &y_aux, Matrix &y_geo, Matrix &jacobian, const Index &stokes_dim, const Index &jacobian_do, const Matrix &sensor_pos, const Matrix &sensor_pol, const Verbosity &)
 WORKSPACE METHOD: yApplySensorPol.
 

Variables

constexpr Numeric PI =Constant::pi
 
constexpr Numeric NAT_LOG_2 =Constant::ln_2
 
constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 
constexpr Numeric RAD2DEG =Conversion::rad2deg(1)
 
constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
 

Detailed Description

Workspace functions related to sensor modelling variables.

Author
Mattias Ekström/Patrick Eriksson patri.nosp@m.ck.e.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2003-02-13

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_sensor.cc.

Function Documentation

◆ antenna_responseGaussian()

void antenna_responseGaussian ( GriddedField4 antenna_response,
const Vector &  f_points,
const Vector &  fwhm,
const Numeric &  grid_width,
const Index &  grid_npoints,
const Index &  do_2d,
const Verbosity verbosity 
)

WORKSPACE METHOD: antenna_responseGaussian.

Sets up a Gaussian antenna response.

This method works as antenna_responseGaussianConstant but allows to inlude a frequency variation of the antenna width. Here the FWHM is specified at a set of frequencies. These frequencies will also be the frequency grid of antenna_response.

If grid_width is set to <=0, the grid width will be twice the max value in fwhm.

Author
Patrick Eriksson
Parameters
[out]antenna_responseWS Output
[in]f_pointsGeneric Input
[in]fwhmGeneric Input
[in]grid_widthGeneric Input (Default: "-1.0")
[in]grid_npointsGeneric Input (Default: "21")
[in]do_2dGeneric Input (Default: "0")

Definition at line 144 of file m_sensor.cc.

References ARTS_USER_ERROR_IF.

Referenced by antenna_responseGaussian_g().

◆ antenna_responseGaussianConstant()

void antenna_responseGaussianConstant ( GriddedField4 antenna_response,
const Numeric &  fwhm,
const Numeric &  grid_width,
const Index &  grid_npoints,
const Index &  do_2d,
const Verbosity verbosity 
)

WORKSPACE METHOD: antenna_responseGaussianConstant.

Sets up a Gaussian antenna response, with no frequency variation.

The method assumes that the response is the same for all frequencies and polarisations, and that it can be modelled as Gaussian. The width of the Gaussian is specified by its full width at half maximum (FWHM).

The grid generated has grid_npoints equidistant values, with the first one at -grid_width/2 and the last one at grid_width/2.

If grid_width is set to <= 0, a default of twice the FWMH is applied. This gives a coverage of about 98% of the response.

The default for grid_npoints is 21. When the grid width is 2*FWHM, that default value gives an error < 0.001 of the integrated response using trapezoidal integration. grid_npoints must be > 1.

If the 2D option is selected (do_2d), a circular antenna is assumed. The same grid and FWHM is applied in both dimensions.

If the grid has a sufficiently high width the integral of the response is 1. Otherwise the integral is smaller than 1. That is, no normalisation is applied.

Author
Patrick Eriksson
Parameters
[out]antenna_responseWS Output
[in]fwhmGeneric Input
[in]grid_widthGeneric Input (Default: "-1.0")
[in]grid_npointsGeneric Input (Default: "21")
[in]do_2dGeneric Input (Default: "0")

Definition at line 205 of file m_sensor.cc.

Referenced by antenna_responseGaussianConstant_g().

◆ antenna_responseGaussianEffectiveSize()

void antenna_responseGaussianEffectiveSize ( GriddedField4 antenna_response,
const Numeric &  leff,
const Numeric &  grid_width,
const Index &  grid_npoints,
const Index &  nf,
const Numeric &  fstart,
const Numeric &  fstop,
const Index &  do_2d,
const Verbosity verbosity 
)

WORKSPACE METHOD: antenna_responseGaussianEffectiveSize.

Sets up Gaussian antenna responses.

Similar to antenna_responseGaussianConstant but allows to set up responses that varies with frequency. That is, the method assumes that the response is the same for all polarisations, and that it can be modelled as a Gaussian function varying with frequency.

The full width at half maximum (FWHM in radians) is calculated as::

<br> fwhm = lambda / leff

where lambda is the wavelength and leff is the effective size of the antenna. Normally, leff is smaller than the physical antenna size.

Antenna responses are created for nf frequencies spanning the range [fstart,fstop], with a logarithmic spacing. That is, the frequency grid of the responses is taken from VectorNLogSpace.

The responses have a common angular grid. The parameters to define the grid are the same as for antenna_responseGaussianConstant. If grid_width is <= 0, it is set to twice the FWHM at the lowest frequency.

Author
Patrick Eriksson
Parameters
[out]antenna_responseWS Output
[in]leffGeneric Input
[in]grid_widthGeneric Input (Default: "-1.0")
[in]grid_npointsGeneric Input (Default: "21")
[in]nfGeneric Input
[in]fstartGeneric Input
[in]fstopGeneric Input
[in]do_2dGeneric Input (Default: "0")

Definition at line 225 of file m_sensor.cc.

Referenced by antenna_responseGaussianEffectiveSize_g().

◆ AntennaMultiBeamsToPencilBeams()

void AntennaMultiBeamsToPencilBeams ( Matrix &  sensor_pos,
Matrix &  sensor_los,
Matrix &  antenna_dlos,
Index &  antenna_dim,
Matrix &  mblock_dlos,
const Index &  atmosphere_dim,
const Verbosity verbosity 
)

WORKSPACE METHOD: AntennaMultiBeamsToPencilBeams.

Maps a multi-beam case to a matching pencil beam case.

Cases with overlapping beams are most efficiently handled by letting antenna_dlos have several rows. That is, there are multiple beams for each measurement block. The drawback is that many variables must be adjusted if the corresponding pencil beam spectra shall be calculated. This method makes this adjustment. That is, if you have a control file for a multiple beam case and for some reason want to avoid the antenna weighting, you add this method before sensor_responseInit, and remove the call of sensor_responseAntenna* and you will get the matching pencil beam spectra.

Author
Patrick Eriksson
Parameters
[in,out]sensor_posWS Input/Output
[in,out]sensor_losWS Input/Output
[in,out]antenna_dlosWS Input/Output
[in,out]antenna_dimWS Input/Output
[in,out]mblock_dlosWS Input/Output
[in]atmosphere_dimWS Input

Definition at line 59 of file m_sensor.cc.

References AntennaOff(), and chk_if_in_range().

Referenced by AntennaMultiBeamsToPencilBeams_g().

◆ AntennaOff()

void AntennaOff ( Index &  antenna_dim,
Matrix &  mblock_dlos,
const Verbosity verbosity 
)

WORKSPACE METHOD: AntennaOff.

Sets some antenna related variables

Use this method to set antenna_dim and mblock_dlos to suitable values (1 and [0], respectively) for cases when a sensor is included, but the antenna pattern is neglected.

Author
Patrick Eriksson
Parameters
[out]antenna_dimWS Output
[out]mblock_dlosWS Output

Definition at line 128 of file m_sensor.cc.

References CREATE_OUT2.

Referenced by AntennaMultiBeamsToPencilBeams(), AntennaOff_g(), sensor_responseGenericAMSU(), sensor_responseSimpleAMSU(), sensorOff(), and ySimpleSpectrometer().

◆ backend_channel_responseFlat()

void backend_channel_responseFlat ( ArrayOfGriddedField1 backend_channel_response,
const Numeric &  resolution,
const Verbosity verbosity 
)

WORKSPACE METHOD: backend_channel_responseFlat.

Sets up a rectangular channel response.

The method assumes that all channels have the same response.

The response of the backend channels is hee assumed to be constant inside the resolution width, and zero outside.

Author
Patrick Eriksson
Parameters
[out]backend_channel_responseWS Output
[in]resolutionGeneric Input

Definition at line 284 of file m_sensor.cc.

Referenced by backend_channel_responseFlat_g(), and ySimpleSpectrometer().

◆ backend_channel_responseGaussian()

void backend_channel_responseGaussian ( ArrayOfGriddedField1 backend_channel_response,
const Vector &  f_backend,
const Vector &  fwhm,
const Numeric &  grid_width,
const Index &  grid_npoints,
const Verbosity verbosity 
)

WORKSPACE METHOD: backend_channel_responseGaussian.

Sets up a Gaussian backend channel response.

The method assumes that all channels have the same response.

This method works as backend_channel_responseGaussianConstant but handles the case where the response of each channel must be described. Here the FWHM is specified for each f_backend.

The GINs fwhm and grid_npoints work in the same way as for antenna_responseGaussianConstant*. A negative grid_width gives a grid that is twice the FWHM of each channel.

Author
Patrick Eriksson, Oliver Lemke
Parameters
[out]backend_channel_responseWS Output
[in]f_backendWS Input
[in]fwhmGeneric Input
[in]grid_widthGeneric Input (Default: "-1.0")
[in]grid_npointsGeneric Input (Default: "21")

Definition at line 305 of file m_sensor.cc.

Referenced by backend_channel_responseGaussian_g().

◆ backend_channel_responseGaussianConstant()

void backend_channel_responseGaussianConstant ( ArrayOfGriddedField1 backend_channel_response,
const Numeric &  fwhm,
const Numeric &  grid_width,
const Index &  grid_npoints,
const Verbosity verbosity 
)

WORKSPACE METHOD: backend_channel_responseGaussianConstant.

Sets up a single Gaussian backend channel response.

The method assumes that all channels have the same response.

The GINs fwhm and grid_npoints work in the same way as for antenna_responseGaussianConstant*. A negative grid_width gives a grid that is twice the FWHM.

Author
Patrick Eriksson, Oliver Lemke
Parameters
[out]backend_channel_responseWS Output
[in]fwhmGeneric Input
[in]grid_widthGeneric Input (Default: "-1.0")
[in]grid_npointsGeneric Input (Default: "21")

Definition at line 340 of file m_sensor.cc.

Referenced by backend_channel_responseGaussianConstant_g().

◆ f_gridFromSensorAMSU()

void f_gridFromSensorAMSU ( Vector &  f_grid,
const Vector &  lo_multi,
const ArrayOfVector &  f_backend_multi,
const ArrayOfArrayOfGriddedField1 backend_channel_response_multi,
const Numeric &  spacing,
const Verbosity verbosity 
)

WORKSPACE METHOD: f_gridFromSensorAMSU.

Automatically calculate f_grid to match the sensor.

This method is handy if you are simulating an AMSU-type instrument, consisting of a few discrete channels. The case that channels touch, as for MHS, is handled correctly. But the case that channels overlap is not (yet) handled and results in an error message.

The method calculates f_grid to match the instrument, as given by the local oscillator frequencies lo_multi, the backend frequencies f_backend_multi, and the backend channel responses backend_channel_response_multi.

You have to specify the desired spacing in the keyword spacing, which has a default value of 100 MHz. (The actual value is 0.1e9, since our unit is Hz.)

The produced grid will not have exactly the requested spacing, but will not be coarser than requested. The algorithm starts with the band edges, then adds additional points until the spacing is at least as fine as requested.

There is a similar method for HIRS-type instruments, see f_gridFromSensorHIRS.

Author
Stefan Buehler, Mathias Milz
Parameters
[out]f_gridWS Output
[in]lo_multiWS Input
[in]f_backend_multiWS Input
[in]backend_channel_response_multiWS Input
[in]spacingGeneric Input (Default: ".1e9")

Definition at line 358 of file m_sensor.cc.

Referenced by f_gridFromSensorAMSU_g(), and sensor_responseSimpleAMSU().

◆ f_gridFromSensorAMSUgeneric()

void f_gridFromSensorAMSUgeneric ( Vector &  f_grid,
const ArrayOfVector &  f_backend_multi,
const ArrayOfArrayOfGriddedField1 backend_channel_response_multi,
const Numeric &  spacing,
const Vector &  verbosityVect,
const Verbosity verbosity 
)

WORKSPACE METHOD: f_gridFromSensorAMSUgeneric.

Automatcially calculate f_grid to match the sensor. This function is based on 'f_gridFromSensorAMSU'

The method calculates f_grid to match the instrument, as given by the backend frequencies f_backend, and the backend channel responses backend_channel_response.

You have to specify the desired spacing in the keyword spacing, which has a default value of 100 MHz. (The actual value is 0.1e9, since our unit is Hz.) The produced grid will not have exactly the requested spacing, but it will not be coarser than requested. The algorithm starts with the band edges, then adds additional points until the spacing is at least as fine as requested.

Author
Oscar Isoz
Parameters
[out]f_gridWS Output
[in]f_backend_multiWS Input
[in]backend_channel_response_multiWS Input
[in]spacingGeneric Input (Default: ".1e9")
[in]verbosityVectGeneric Input (Default: "[]")

Definition at line 489 of file m_sensor.cc.

Referenced by f_gridFromSensorAMSUgeneric_g(), and sensor_responseGenericAMSU().

◆ f_gridFromSensorHIRS()

void f_gridFromSensorHIRS ( Vector &  f_grid,
const Vector &  f_backend,
const ArrayOfGriddedField1 backend_channel_response,
const Numeric &  spacing,
const Verbosity verbosity 
)

WORKSPACE METHOD: f_gridFromSensorHIRS.

Automatically calculate f_grid to match the sensor.

This method is handy if you are simulating a HIRS-type instrument, consisting of a few discrete channels.

It calculates f_grid to match the instrument, as given by the nominal band frequencies f_backend and the spectral channel response functions given by backend_channel_response.

You have to specify the desired spacing in the keyword spacing, which has a default value of 5e8 Hz.

The produced grid will not have exactly the requested spacing, but will not be coarser than requested. The algorithm starts with the band edges, then adds additional points until the spacing is at least as fine as requested.

There is a similar method for AMSU-type instruments, see f_gridFromSensorAMSU*.

Author
Stefan Buehler
Parameters
[out]f_gridWS Output
[in]f_backendWS Input
[in]backend_channel_responseWS Input
[in]spacingGeneric Input (Default: "5e8")

Definition at line 641 of file m_sensor.cc.

Referenced by f_gridFromSensorHIRS_g().

◆ f_gridMetMM()

void f_gridMetMM ( Vector &  f_grid,
Vector &  f_backend,
ArrayOfArrayOfIndex channel2fgrid_indexes,
ArrayOfVector &  channel2fgrid_weights,
const Matrix &  met_mm_backend,
const Vector &  freq_spacing,
const ArrayOfIndex freq_number,
const Numeric &  freq_merge_threshold,
const Verbosity verbosity 
)

WORKSPACE METHOD: f_gridMetMM.

Sets f_grid and associated variables match MetMM settings.

The method calculates f_grid to match the specifications of a met_mm_backend* table and method arguments.

You have to specify the desired spacing using the keyword freq_spacing. You can pass a Vector with one element to apply the same spacing to all channels or pass a spacing value for each channel separately.

Optionally, freq_number can be set to specify the mininum number of frequencies per passband for each channel. The frequencies are placed equally spaced in each passband. The minimum spacing resulting from freq_number and freq_spacing will be used for the calculation. To explicitly use freq_spacing for a channel, freq_number can be set to -1 for this channel.

The number of elements in freq_number can either be the number of channels or 1. If only one element is given, this number is used for all channels. If freq_number is 1 and freq_spacing is wider than the bandwidth of the channel, one frequency is placed in the middle of each passband.

Frequencies that would be closer than freq_merge_threshold in the generated f_grid are merged together. This value should be left at the default value. This is only meant to compensate for numerical inaccuracies in the frequency calculation to merge frequency that are supposed to be identical.

Author
Oliver Lemke
Patrick Eriksson
Parameters
[out]f_gridWS Output
[out]f_backendWS Output
[out]channel2fgrid_indexesWS Output
[out]channel2fgrid_weightsWS Output
[in]met_mm_backendWS Input
[in]freq_spacingGeneric Input (Default: "[.1e9]")
[in]freq_numberGeneric Input (Default: "[-1]")
[in]freq_merge_thresholdGeneric Input (Default: "1")

Definition at line 708 of file m_sensor.cc.

Referenced by f_gridMetMM_g().

◆ mblock_dlosFrom1dAntenna()

void mblock_dlosFrom1dAntenna ( Matrix &  mblock_dlos,
const GriddedField4 antenna_response,
const Index &  npoints,
const Verbosity verbosity 
)

WORKSPACE METHOD: mblock_dlosFrom1dAntenna.

Sets mblock_dlos based on a 1D gaussian antenna response.

The length of mblock_dlos is determined by npoints. The end points of the grid are set to be the same as for the antenna response. The spacing of the grid follows the magnitude of the response; the spacing is smaller where the response is high. More precisely, the grid points are determined by dividing the cumulative sum of the response in equal steps.

Author
Patrick Eriksson
Parameters
[out]mblock_dlosWS Output
[in]antenna_responseWS Input
[in]npointsGeneric Input

Definition at line 880 of file m_sensor.cc.

Referenced by mblock_dlosFrom1dAntenna_g().

◆ sensor_responseAntenna()

void sensor_responseAntenna ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Matrix &  sensor_response_dlos_grid,
const Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Index &  atmosphere_dim,
const Index &  antenna_dim,
const Matrix &  antenna_dlos,
const GriddedField4 antenna_response,
const Index &  sensor_norm,
const String option_2d,
const Vector &  solid_angles,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseAntenna.

Includes response of the antenna.

The function returns the sensor response matrix after the antenna characteristics have been included.

The function handles "multi-beam" cases where the polarisation coordinate system is the same for all beams.

See antenna_dim, antenna_dlos and antenna_response for details on how to specify the antenna response.

The text below refers to mblock_dlos despite it is not an input to the method. The method instead uses sensor_response_dlos_grid but the values in this WSV are likely coming from mblock_dlos.

One dimensional antenna patterns are handled as other response functions. That is, both antenna response and radiances are treated as piece-wise linear functions, and the pencil beam calculations must cover the full sensor response (i.e. mblock_dlos shall be sufficiently broad).

There exist different options for two dimensional antenna patterns. (If 2D, the GIN option_2d must be set, the default setting results in an error). A normalisation is always applied for 2D antennas.

"interp_response" Both radiances and the antenna pattern are treated as step-wise constant functions. The antenna pattern is interpolated to the mblock_dlos* directions. At extrapolation, the antenna response is set to zero. This option considers GIN solid_angles, that shall be a vector with length matching the rows of mblock_dlos. The values going into sensor_response are the interpolated antenna values times the corresponding solid angle.

"gridded_dlos" This option is more similar to the 1D case. The radiances are treated as a bi-linear function, but the antenna response is treated as step- wise constant function (in contrast to 1D). For this option mblock_dlos* must match a combination of zenith and azimuth grids, and this for a particular order. If the zenith and azimuth grids have 3 and 2 values, respectively, the order shall be::

<br> [(za1,aa1); (za2,aa1); (za3,aa1); (za1,aa2); (za2,aa2); (za3,aa2)]

Both these grids must be strictly increasing and as for 1D must cover the antenna response completely.

Author
Patrick Eriksson
Mattias Ekstrom
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_dlos_gridWS Input/Output
[in]sensor_response_f_gridWS Input
[in]sensor_response_pol_gridWS Input
[in]atmosphere_dimWS Input
[in]antenna_dimWS Input
[in]antenna_dlosWS Input
[in]antenna_responseWS Input
[in]sensor_normWS Input
[in]option_2dGeneric Input (Default: "-")
[in]solid_anglesGeneric Input (Default: "[]")

Definition at line 916 of file m_sensor.cc.

Referenced by sensor_responseAntenna_g().

◆ sensor_responseBackend()

void sensor_responseBackend ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Vector &  f_backend,
const ArrayOfGriddedField1 backend_channel_response,
const Index &  sensor_norm,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseBackend.

Includes response of the backend (spectrometer).

The function returns the sensor response matrix after the backend characteristics have been included.

See f_backend, backend_channel_response and sensor_norm for details on how to specify the backend response.

Author
Mattias Ekstrom
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]f_backendWS Input
[in]backend_channel_responseWS Input
[in]sensor_normWS Input

Definition at line 1169 of file m_sensor.cc.

Referenced by sensor_responseBackend_g(), sensor_responseGenericAMSU(), sensor_responseMultiMixerBackend(), and ySimpleSpectrometer().

◆ sensor_responseBackendFrequencySwitching()

void sensor_responseBackendFrequencySwitching ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Vector &  f_backend,
const ArrayOfGriddedField1 backend_channel_response,
const Index &  sensor_norm,
const Numeric &  df1,
const Numeric &  df2,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseBackendFrequencySwitching.

Frequency switching for a pure SSB reciever.

This function can be used for simulation of frequency switching. That is, when the final spectrum is the difference of two spectra shifted in frequency. The switching is performed by the LO, but for a pure singel sideband reciever this is most easily simulated by instead shifting the backend, as done here.

A strightforward frequency switching is modelled (no folding) The channel positions for the first measurement cycle are f_backend+df1, and for the second f_backend+df2. The first measurement cycle is given the negive weight. That is, the output is the spectrum for cycle2 minus the spectrum for cycle1. Output frequency grids are set to f_backend.

Use sensor_responseFrequencySwitching for double sideband cases.

The method has the same general functionality as, and can replace, sensor_responseBackend*.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]f_backendWS Input
[in]backend_channel_responseWS Input
[in]sensor_normWS Input
[in]df1Generic Input
[in]df2Generic Input

Definition at line 1323 of file m_sensor.cc.

Referenced by sensor_responseBackendFrequencySwitching_g().

◆ sensor_responseBeamSwitching()

void sensor_responseBeamSwitching ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Matrix &  sensor_response_dlos_grid,
const Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Numeric &  w1,
const Numeric &  w2,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseBeamSwitching.

Simulation of "beam switching".

The measurement procedure is based on taking the difference between two spectra measured in different directions, and the calculation set-up must treat exactly two observation directions.

The returned spectrum is y = w1*y + w2*y2, where y1 and w1 are the spectrum and weight for the first direction, respectively (y2 and (w2 defined correspondingly for the second direction).

Zenith and azimuth angles after beam switching are set to the values of the second direction.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_dlos_gridWS Input/Output
[in]sensor_response_f_gridWS Input
[in]sensor_response_pol_gridWS Input
[in]w1Generic Input (Default: "-1")
[in]w2Generic Input (Default: "1")

Definition at line 1394 of file m_sensor.cc.

Referenced by sensor_responseBeamSwitching_g().

◆ sensor_responseFillFgrid()

void sensor_responseFillFgrid ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Index &  polyorder,
const Index &  nfill,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseFillFgrid.

Polynomial frequency interpolation of spectra.

The sensor response methods treat the spectra to be piece-wise linear functions. This method is a workaround for making methods handling the spectra in a more elaborate way: it generates spectra on a more dense grid by polynomial interpolation. The interpolation is not done explicitly, it is incorporated into sensor_response.

This method should in general increase the calculation accuracy for a given f_grid. However, the selection of (original) grid points becomes more sensitive when using this method. A poor choice of grid points can result in a decreased accuracy, or generation of negative radiances. Test calculations indicated that the error easily can increase with this method close the edge of f_grid, and it could be wise to make f_grid a bit wider than actually necessary to avoid this effect

The method shall be inserted before the antenna stage. That is, this method shall normally be called directly after sensor_responseInit.

Between each neighbouring points of f_grid, this method adds nfill grid points. The polynomial order of the interpolation is polyorder.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]polyorderGeneric Input (Default: "3")
[in]nfillGeneric Input (Default: "2")

Definition at line 1569 of file m_sensor.cc.

References CREATE_OUT3, mult(), Array< base >::nelem(), nlinspace(), sensor_aux_vectors(), and w.

Referenced by sensor_responseFillFgrid_g().

◆ sensor_responseFrequencySwitching()

void sensor_responseFrequencySwitching ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseFrequencySwitching.

Simulation of "frequency switching".

A general method for frequency switching. The WSM sensor_responseBackendFrequencySwitching* gives a description of this observation technique, and is also a more straightforward method for pure singel sideband cases.

It is here assume that sensor_responseMultiMixerBackend has been used to calculate the spectrum for two LO positions. This method calculates the difference between these two spectra, where the second spectrum gets weight 1 and the first weight -1 (as in sensor_responseBackendFrequencySwitching*).

Output frequency grids are taken from the second spectrum.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input

Definition at line 1457 of file m_sensor.cc.

Referenced by sensor_responseFrequencySwitching_g().

◆ sensor_responseGenericAMSU()

void sensor_responseGenericAMSU ( Vector &  f_grid,
Index &  antenna_dim,
Matrix &  mblock_dlos,
Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
ArrayOfIndex sensor_response_pol_grid,
Matrix &  sensor_response_dlos_grid,
Index &  sensor_norm,
const Index &  atmosphere_dim,
const Index &  stokes_dim,
const Matrix &  sensor_description_amsu,
const Numeric &  spacing,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseGenericAMSU.

Simplified sensor setup for an AMSU-type instrument.

This function is derived from 'sensor_responseSimpleAMSU' but is more generalized since the number of passbands in each can be in the range from 1 to 4 - in order to correctly simulate AMSU-A type sensors

This method allows quick and simple definition of AMSU-type sensors. Assumptions:

  1. Pencil beam antenna.
  2. 1-4 Passband/sidebands per channel.
  3. Sideband mode "upper"
  4. The channel response is rectangular.

Under these assumptions the only inputs needed are the LO positions, the offsets from the LO, and the IF bandwidths. They are provided in sensor_description_amsu.

Author
Oscar Isoz
Parameters
[out]f_gridWS Output
[out]antenna_dimWS Output
[out]mblock_dlosWS Output
[out]sensor_responseWS Output
[out]sensor_response_fWS Output
[out]sensor_response_polWS Output
[out]sensor_response_dlosWS Output
[out]sensor_response_f_gridWS Output
[out]sensor_response_pol_gridWS Output
[out]sensor_response_dlos_gridWS Output
[out]sensor_normWS Output
[in]atmosphere_dimWS Input
[in]stokes_dimWS Input
[in]sensor_description_amsuWS Input
[in]spacingGeneric Input (Default: ".1e9")

Definition at line 2666 of file m_sensor.cc.

References AntennaOff(), ARTS_ASSERT, GriddedField1::data, f_gridFromSensorAMSUgeneric(), Array< base >::nelem(), GriddedField1::resize(), sensor_aux_vectors(), sensor_responseBackend(), sensor_responseInit(), GriddedField::set_grid(), GriddedField::set_grid_name(), and GriddedField::set_name().

Referenced by sensor_responseGenericAMSU_g().

◆ sensor_responseIF2RF()

void sensor_responseIF2RF ( Vector &  sensor_response_f,
Vector &  sensor_response_f_grid,
const Numeric &  lo,
const String sideband_mode,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseIF2RF.

Converts sensor response variables from IF to RF.

The function converts intermediate frequencies (IF) in sensor_response_f* and sensor_response_f_grid to radio frequencies (RF). This conversion is needed if the frequency translation of a mixer is included and the position of backend channels are specified in RF.

A direct frequency conversion is performed. Values are not sorted in any way.

Author
Patrick Eriksson
Parameters
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]loWS Input
[in]sideband_modeWS Input

Definition at line 1532 of file m_sensor.cc.

Referenced by sensor_responseIF2RF_g(), and sensor_responseMultiMixerBackend().

◆ sensor_responseInit()

void sensor_responseInit ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
ArrayOfIndex sensor_response_pol_grid,
Matrix &  sensor_response_dlos_grid,
const Vector &  f_grid,
const Matrix &  mblock_dlos,
const Index &  antenna_dim,
const Index &  atmosphere_dim,
const Index &  stokes_dim,
const Index &  sensor_norm,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseInit.

Initialises the variables summarising the sensor response.

This method sets the variables to match monochromatic pencil beam calculations, to be further modified by inclusion of sensor characteristics. Use sensorOff if pure monochromatic pencil beam calculations shall be performed.

The variables are set as follows:

  • sensor_response: Identity matrix, with size matching f_grid, stokes_dim and mblock_dlos.
  • sensor_response_f: Repeated values of f_grid.
  • sensor_response_pol: Data matching stokes_dim.
  • sensor_response_dlos: Repeated values of mblock_dlos.
  • sensor_response_f_grid: Equal to f_grid.
  • sensor_response_pol_grid: Set to 1:stokes_dim.
  • sensor_response_dlos_grid: Equal to mblock_dlos.

    Author
    Mattias Ekstrom
    Patrick Eriksson
    Parameters
    [out]sensor_responseWS Output
    [out]sensor_response_fWS Output
    [out]sensor_response_polWS Output
    [out]sensor_response_dlosWS Output
    [out]sensor_response_f_gridWS Output
    [out]sensor_response_pol_gridWS Output
    [out]sensor_response_dlos_gridWS Output
    [in]f_gridWS Input
    [in]mblock_dlosWS Input
    [in]antenna_dimWS Input
    [in]atmosphere_dimWS Input
    [in]stokes_dimWS Input
    [in]sensor_normWS Input

Definition at line 1685 of file m_sensor.cc.

References chk_if_bool(), chk_if_in_range(), CREATE_OUT2, CREATE_OUT3, and sensor_aux_vectors().

Referenced by sensor_responseGenericAMSU(), sensor_responseInit_g(), sensor_responseMetMM(), sensor_responseSimpleAMSU(), sensorOff(), and ySimpleSpectrometer().

◆ sensor_responseMetMM()

void sensor_responseMetMM ( Index &  antenna_dim,
Matrix &  mblock_dlos,
Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
ArrayOfIndex sensor_response_pol_grid,
Matrix &  sensor_response_dlos_grid,
Index &  sensor_norm,
const Index &  atmosphere_dim,
const Index &  stokes_dim,
const Vector &  f_grid,
const Vector &  f_backend,
const ArrayOfArrayOfIndex channel2fgrid_indexes,
const ArrayOfVector &  channel2fgrid_weights,
const String iy_unit,
const Matrix &  antenna_dlos,
const ArrayOfString met_mm_polarisation,
const Vector &  met_mm_antenna,
const Index &  use_antenna,
const Index &  mirror_dza,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseMetMM.

Sensor setup for meteorological millimeter instruments.

This method is handy if you are simulating a passband-type instrument, consisting of a few discrete channels.

For flexibility, the Met-MM system is seperated in two calculation steps. To fully use the system, create f_grid (and some associated variables) by f_gridMetMM before calling this method. However, it is possible to use this method with any f_grid, as long as matching f_backend*, channel2fgrid_indexes and channel2fgrid_weights are provided.

Each scan sequence is treated as a measurement block. sensor_pos is set in the standard way. The number of rows in sensor_pos determines the number of scan sequences that will be simulated. On the other hand, sensor_los* is handled in a special way. All zenith angles must be set to 180 deg. For 3D, the given azimuth angles are taken as the direction of scanning, where the azimuth angle is defined with respect to North in standard manner. For example, if the scanning happens to move from SW to NE, the azimuth angle should be set to 45 deg. The angles of the scanning sequence are taken from antenna_dlos. This WSV is here only allowed to have a single column, holding relative zenith angles. For 3D, the azimuth angles in antenna_dlos are hard-coded to zero. As zenith angles in sensor_los are locked to 180 deg, antenna_dlos effectively holds the nadir angles. These angles can be both positive or negative, where the recommended choice is to operate with negative to end up with final zenith angles between 0 and 180 deg.

The method does not support 2D atmospheres (across-track scanning is inconsistent with 2D). For simpler switching between 1D and 3D, the argument mirror_dza is at hand. It can only be used for 3D. If set to true, the zenith angles in antenna_dlos are mapped to also cover the other side of the swath and the simulations will cover both sides of the swath.

Author
Oliver Lemke
Patrick Eriksson
Parameters
[out]antenna_dimWS Output
[out]mblock_dlosWS Output
[out]sensor_responseWS Output
[out]sensor_response_fWS Output
[out]sensor_response_polWS Output
[out]sensor_response_dlosWS Output
[out]sensor_response_f_gridWS Output
[out]sensor_response_pol_gridWS Output
[out]sensor_response_dlos_gridWS Output
[out]sensor_normWS Output
[in]atmosphere_dimWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]f_backendWS Input
[in]channel2fgrid_indexesWS Input
[in]channel2fgrid_weightsWS Input
[in]iy_unitWS Input
[in]antenna_dlosWS Input
[in]met_mm_polarisationWS Input
[in]met_mm_antennaWS Input
[in]use_antennaGeneric Input (Default: "0")
[in]mirror_dzaGeneric Input (Default: "0")

Definition at line 1933 of file m_sensor.cc.

References c, chk_if_bool(), met_mm_polarisation_hmatrix(), mult(), Array< base >::nelem(), sensor_aux_vectors(), sensor_responseInit(), sensor_responseMixerBackendPrecalcWeights(), and v.

Referenced by sensor_responseMetMM_g().

◆ sensor_responseMixer()

void sensor_responseMixer ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Numeric &  lo,
const GriddedField1 sideband_response,
const Index &  sensor_norm,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseMixer.

Includes response of the mixer of a heterodyne system.

The function returns the sensor response matrix after the mixer characteristics have been included. Frequency variables are converted from radio frequency (RF) to intermediate frequency (IF). The returned frequency grid covers the range [0,max_if], where max_if is the highest IF covered by the sideband response grid.

See lo and sideband_response for details on how to specify the mixer response

Author
Mattias Ekstrom
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]loWS Input
[in]sideband_responseWS Input
[in]sensor_normWS Input

Definition at line 1796 of file m_sensor.cc.

References CREATE_OUT3, GriddedField1::data, GriddedField::get_numeric_grid(), last(), mixer_matrix(), mult(), Array< base >::nelem(), and sensor_aux_vectors().

Referenced by sensor_responseMixer_g(), and sensor_responseMultiMixerBackend().

◆ sensor_responseMixerBackendPrecalcWeights()

void sensor_responseMixerBackendPrecalcWeights ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Vector &  f_backend,
const ArrayOfArrayOfIndex channel2fgrid_indexes,
const ArrayOfVector &  channel2fgrid_weights,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseMixerBackendPrecalcWeights.

Includes pre-calculated response covering mixer and backend.

This method acts similar to sensor_responseBackend, but uses pre-calculated weights. These weights can also include the effect of mixer and sideband filtering.

As usual, f_backend gives the frequency of the channels. This WSM has no direct influence on the result, but at least representative values must be set.

The frequency response is defined using channel2fgrid_indexes and channel2fgrid_weights*.

Both channel2fgrid_indexes and channel2fgrid_weights are assumed to be common for all viewing directions.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]f_backendWS Input
[in]channel2fgrid_indexesWS Input
[in]channel2fgrid_weightsWS Input

Definition at line 2123 of file m_sensor.cc.

References CREATE_OUT3, max(), min(), mult(), Array< base >::nelem(), and sensor_aux_vectors().

Referenced by sensor_responseMetMM(), and sensor_responseMixerBackendPrecalcWeights_g().

◆ sensor_responseMultiMixerBackend()

void sensor_responseMultiMixerBackend ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Vector &  lo_multi,
const ArrayOfGriddedField1 sideband_response_multi,
const ArrayOfString sideband_mode_multi,
const ArrayOfVector &  f_backend_multi,
const ArrayOfArrayOfGriddedField1 backend_channel_response_multi,
const Index &  sensor_norm,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseMultiMixerBackend.

Handles mixer and backend parts for an instrument having multiple mixer chains.

The WSMs sensor_responseMixer, sensor_responseIF2RF and sensor_responseBackend* are called for each mixer chain, and a complete sensor_response is assembled. The instrument responses are described by lo_multi, sideband_response_multi, sideband_mode_multi*, f_backend_multi and backend_channel_response_multi*. All these WSVs must have same vector or array length. As sensor_responseIF2RF is called, f_backend_multi* must hold RF (not IF) and output frequencies will be in absolute frequency (RF).

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]lo_multiWS Input
[in]sideband_response_multiWS Input
[in]sideband_mode_multiWS Input
[in]f_backend_multiWS Input
[in]backend_channel_response_multiWS Input
[in]sensor_normWS Input

Definition at line 2263 of file m_sensor.cc.

References ARTS_ASSERT, Array< base >::nelem(), sensor_aux_vectors(), sensor_responseBackend(), sensor_responseIF2RF(), and sensor_responseMixer().

Referenced by sensor_responseMultiMixerBackend_g(), and sensor_responseSimpleAMSU().

◆ sensor_responsePolarisation()

void sensor_responsePolarisation ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
ArrayOfIndex sensor_response_pol_grid,
const Vector &  sensor_response_f_grid,
const Matrix &  sensor_response_dlos_grid,
const Index &  stokes_dim,
const String iy_unit,
const ArrayOfIndex instrument_pol,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responsePolarisation.

Extraction of non-default polarisation components.

The default is to output the Stokes elements I, Q, U and V (up to stokes_dim*). This method allows to change the "polarisation" of the output. Polarisation components to be extracted are selected by instrument_pol*. This method can be applied at any step of the sensor matrix set-up.

The method can only be applied on data for I, Q, U and V. The value of stokes_dim must be sufficiently large for the selected components. For example, I+45 requires that stokes_dim is at least 3.

See instrument_pol for coding of polarisation states.

Note that the state of iy_unit is considered. This WSV must give the actual unit of the data. This as, the extraction of components is slightly different if data are radiances or brightness temperatures. In practise this means that iy_unit (as to be applied inside iy_main_agenda) must be set before calling this method.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_pol_gridWS Input/Output
[in]sensor_response_f_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]stokes_dimWS Input
[in]iy_unitWS Input
[in]instrument_polWS Input

Definition at line 2438 of file m_sensor.cc.

References mult(), Array< base >::nelem(), sensor_aux_vectors(), stokes2pol(), and w.

Referenced by sensor_responsePolarisation_g().

◆ sensor_responseSimpleAMSU()

void sensor_responseSimpleAMSU ( Vector &  f_grid,
Index &  antenna_dim,
Matrix &  mblock_dlos,
Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
ArrayOfIndex sensor_response_pol_grid,
Matrix &  sensor_response_dlos_grid,
Index &  sensor_norm,
const Index &  atmosphere_dim,
const Index &  stokes_dim,
const Matrix &  sensor_description_amsu,
const Numeric &  spacing,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseSimpleAMSU.

Simplified sensor setup for an AMSU-type instrument.

This method allows quick and simple definition of AMSU-type sensors. Assumptions:

  1. Pencil beam antenna.
  2. Double sideband receivers.
  3. Sideband mode "upper"
  4. The channel response is rectangular.

Under these assumptions the only inputs needed are the LO positions, the offsets from the LO, and the IF bandwidths. They are provieded in sensor_description_amsu.

Author
Stefan Buehler
Parameters
[out]f_gridWS Output
[out]antenna_dimWS Output
[out]mblock_dlosWS Output
[out]sensor_responseWS Output
[out]sensor_response_fWS Output
[out]sensor_response_polWS Output
[out]sensor_response_dlosWS Output
[out]sensor_response_f_gridWS Output
[out]sensor_response_pol_gridWS Output
[out]sensor_response_dlos_gridWS Output
[out]sensor_normWS Output
[in]atmosphere_dimWS Input
[in]stokes_dimWS Input
[in]sensor_description_amsuWS Input
[in]spacingGeneric Input (Default: ".1e9")

Definition at line 3025 of file m_sensor.cc.

References AntennaOff(), GriddedField1::data, f_gridFromSensorAMSU(), GriddedField1::resize(), sensor_responseInit(), sensor_responseMultiMixerBackend(), GriddedField::set_grid(), GriddedField::set_grid_name(), and GriddedField::set_name().

Referenced by sensor_responseSimpleAMSU_g().

◆ sensor_responseStokesRotation()

void sensor_responseStokesRotation ( Sparse &  sensor_response,
const Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Index &  stokes_dim,
const Vector &  stokes_rotation,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseStokesRotation.

Includes a rotation of the Stokes H and V directions.

The method applies the rotations implied by stokes_rotation. See the description of that WSV for details.

This method does not change the size of sensor_response, and the auxiliary variables (sensor_response_f etc.) are not changed.

To apply the method, stokes_dim must be >= 3. The complete effect of the rotation can not be determibed with lower stokes_dim.

Author
Patrick Eriksson
Parameters
[in,out]sensor_responseWS Input/Output
[in]sensor_response_f_gridWS Input
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]stokes_dimWS Input
[in]stokes_rotationWS Input

Definition at line 2563 of file m_sensor.cc.

References chk_if_in_range(), muellersparse_rotation(), mult(), and Array< base >::nelem().

Referenced by sensor_responseStokesRotation_g().

◆ sensor_responseWMRF()

void sensor_responseWMRF ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
const ArrayOfIndex sensor_response_pol_grid,
const Matrix &  sensor_response_dlos_grid,
const Sparse &  wmrf_weights,
const Vector &  f_backend,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_responseWMRF.

Adds WMRF weights to sensor response.

This method adds a spectrometer response that has been calculated with the weighted mean of representative frequencies (WMRF) method. It consists of a set of selected frequencies, and associated weights.

Author
Stefan Buehler, based on Patrick Erikssons sensor_responseBackend
Parameters
[in,out]sensor_responseWS Input/Output
[in,out]sensor_response_fWS Input/Output
[in,out]sensor_response_polWS Input/Output
[in,out]sensor_response_dlosWS Input/Output
[in,out]sensor_response_f_gridWS Input/Output
[in]sensor_response_pol_gridWS Input
[in]sensor_response_dlos_gridWS Input
[in]wmrf_weightsWS Input
[in]f_backendWS Input

Definition at line 3276 of file m_sensor.cc.

References CREATE_OUT3, mult(), Array< base >::nelem(), and sensor_aux_vectors().

Referenced by sensor_responseWMRF_g().

◆ sensorOff()

void sensorOff ( Sparse &  sensor_response,
Vector &  sensor_response_f,
ArrayOfIndex sensor_response_pol,
Matrix &  sensor_response_dlos,
Vector &  sensor_response_f_grid,
ArrayOfIndex sensor_response_pol_grid,
Matrix &  sensor_response_dlos_grid,
Matrix &  mblock_dlos,
const Index &  stokes_dim,
const Vector &  f_grid,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensorOff.

Sets sensor WSVs to obtain monochromatic pencil beam values.

The variables are set as follows: <br> - mblock_dlos : One row with zero(s). <br> - sensor_response : As returned by sensor_responseInit.

Author
Patrick Eriksson
Parameters
[out]sensor_responseWS Output
[out]sensor_response_fWS Output
[out]sensor_response_polWS Output
[out]sensor_response_dlosWS Output
[out]sensor_response_f_gridWS Output
[out]sensor_response_pol_gridWS Output
[out]sensor_response_dlos_gridWS Output
[out]mblock_dlosWS Output
[in]stokes_dimWS Input
[in]f_gridWS Input

Definition at line 1757 of file m_sensor.cc.

References AntennaOff(), and sensor_responseInit().

Referenced by sensorOff_g().

◆ WMRFSelectChannels()

void WMRFSelectChannels ( Vector &  f_grid,
Sparse &  wmrf_weights,
Vector &  f_backend,
const ArrayOfIndex wmrf_channels,
const Verbosity verbosity 
)

WORKSPACE METHOD: WMRFSelectChannels.

Select some channels for WMRF calculation.

The HIRS fast setup consists of a precalculated frequency grid covering all HIRS channels, and associated weights for each channel, stored in a weight matrix. (A sensor_response matrix.)

If not all channels are requested for simulation, then this method can be used to remove the unwanted channels. It changes a number of variables in consistent fashion:

  • Unwanted channels are removed from f_backend.
  • Unwanted channels are removed from wmrf_weights.
  • Unnecessary frequencies are removed from f_grid.
  • Unnecessary frequencies are removed from wmrf_weights.

    Author
    Stefan Buehler
    Parameters
    [in,out]f_gridWS Input/Output
    [in,out]wmrf_weightsWS Input/Output
    [in,out]f_backendWS Input/Output
    [in]wmrf_channelsWS Input

Definition at line 3160 of file m_sensor.cc.

References ARTS_ASSERT, chk_if_increasing(), CREATE_OUT2, CREATE_OUT3, max(), min(), Array< base >::nelem(), and Select().

Referenced by WMRFSelectChannels_g().

◆ yApplySensorPol()

void yApplySensorPol ( Vector &  y,
Vector &  y_f,
ArrayOfIndex y_pol,
Matrix &  y_pos,
Matrix &  y_los,
ArrayOfVector &  y_aux,
Matrix &  y_geo,
Matrix &  jacobian,
const Index &  stokes_dim,
const Index &  jacobian_do,
const Matrix &  sensor_pos,
const Matrix &  sensor_pol,
const Verbosity verbosity 
)

WORKSPACE METHOD: yApplySensorPol.

Extraction of arbitrary linear polarisation.

This method shall be called after yCalc and then applies sensor_pol on the output of yCalc. See sensor_pol for definition of the polarisation responses. The sensor_response given to yCalc can not contain any polarisation response, it must maintain original Stokes elements. The value of stokes_dim must be >= 3.

The values in sensor_pol are applied on y, and jacobian if relevant. y_pol* is set following the values in sensor_pol but is rounded to an integer value. Remaining data associated with y (e.g. y_pos) are set to the value matching the first Stokes element.

Author
Patrick Eriksson
Parameters
[in,out]yWS Input/Output
[in,out]y_fWS Input/Output
[in,out]y_polWS Input/Output
[in,out]y_posWS Input/Output
[in,out]y_losWS Input/Output
[in,out]y_auxWS Input/Output
[in,out]y_geoWS Input/Output
[in,out]jacobianWS Input/Output
[in]stokes_dimWS Input
[in]jacobian_doWS Input
[in]sensor_posWS Input
[in]sensor_polWS Input

Definition at line 3455 of file m_sensor.cc.

References a, c, DEG2RAD, and Array< base >::nelem().

Referenced by yApplySensorPol_g().

◆ ySimpleSpectrometer()

void ySimpleSpectrometer ( Vector &  y,
Vector &  y_f,
const Matrix &  iy,
const Index &  stokes_dim,
const Vector &  f_grid,
const Numeric &  df,
const Verbosity verbosity 
)

WORKSPACE METHOD: ySimpleSpectrometer.

Converts iy to y assuming a fixed frequency resolution.

This is a short-cut, avoiding yCalc, that can be used to convert monochromatic pencil beam data to spectra with a fixed resolution.

The method mimics a spectrometer with rectangular response functions, all having the same width (df). The position of the first spectrometer channel is set to f_grid[0] + df / 2. The centre frequency of channels are returned as y_f.

Auxiliary variables and jacobian s are not handled.

Author
Patrick Eriksson
Parameters
[out]yWS Output
[out]y_fWS Output
[in]iyWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]dfGeneric Input

Definition at line 3377 of file m_sensor.cc.

References AntennaOff(), backend_channel_responseFlat(), last(), linspace(), mult(), sensor_responseBackend(), and sensor_responseInit().

Referenced by ySimpleSpectrometer_g().

Variable Documentation

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 44 of file m_sensor.cc.

Referenced by yApplySensorPol().

◆ NAT_LOG_2

constexpr Numeric NAT_LOG_2 =Constant::ln_2
inlineconstexpr

Definition at line 43 of file m_sensor.cc.

◆ PI

constexpr Numeric PI =Constant::pi
inlineconstexpr

Definition at line 42 of file m_sensor.cc.

◆ RAD2DEG

constexpr Numeric RAD2DEG =Conversion::rad2deg(1)
inlineconstexpr

Definition at line 45 of file m_sensor.cc.

◆ SPEED_OF_LIGHT

constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
inlineconstexpr

Definition at line 51 of file m_sensor.cc.