LCOV - code coverage report
Current view: top level - msvis/MSVis - Vbi2MsRow.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 257 331 77.6 %
Date: 2025-08-20 19:42:45 Functions: 70 95 73.7 %

          Line data    Source code
       1             : /*
       2             :  * Vbi2MsRow.cc
       3             :  *
       4             :  *  Created on: Aug 22, 2013
       5             :  *      Author: jjacobs
       6             :  */
       7             : 
       8             : #include <casacore/casa/Exceptions.h>
       9             : #include <casacore/measures/Measures/MDirection.h>
      10             : #include <msvis/MSVis/Vbi2MsRow.h>
      11             : #include <msvis/MSVis/VisibilityIterator2.h>
      12             : #include <msvis/MSVis/VisModelDataI.h>
      13             : #include <msvis/MSVis/VisBufferImpl2.h>
      14             : #include <msvis/MSVis/VisBufferImpl2Internal.h>
      15             : 
      16             : #define AssertWritable() ThrowIf (! isWritable (), "Cannot write to this MsRow object")
      17             : 
      18             : using casa::vi::VisBufferImpl2;
      19             : 
      20             : using namespace casacore;
      21             : namespace casa {
      22             : 
      23             : namespace ms {
      24             : 
      25             : 
      26       14349 : Vbi2MsRow::Vbi2MsRow (rownr_t row, const VisBufferImpl2 * vb)
      27             : : MsRow (row, vb),
      28       14349 :   correctedCache_p (& VisBufferImpl2::visCubeCorrected),
      29       14349 :   flagCache_p (& VisBufferImpl2::flagCube),
      30       14349 :   modelCache_p(& VisBufferImpl2::visCubeModel),
      31       14349 :   observedCache_p(&VisBufferImpl2::visCube),
      32       14349 :   sigmaCache_p (&VisBufferImpl2::sigma),
      33       14349 :   sigmaSpectrumCache_p(& VisBufferImpl2::sigmaSpectrum),
      34       14349 :   weightCache_p (&VisBufferImpl2::weight),
      35       14349 :   weightSpectrumCache_p(& VisBufferImpl2::weightSpectrum),
      36       28698 :   vbi2_p (const_cast<VisBufferImpl2 *> (vb))
      37             : {
      38       14349 :     configureArrayCaches ();
      39       14349 : }
      40             : 
      41             : 
      42       14691 : Vbi2MsRow::Vbi2MsRow (rownr_t row, VisBufferImpl2 * vb)
      43             : : MsRow (row, vb),
      44       14691 :   correctedCache_p (& VisBufferImpl2::visCubeCorrected),
      45       14691 :   flagCache_p (& VisBufferImpl2::flagCube),
      46       14691 :   modelCache_p(& VisBufferImpl2::visCubeModel),
      47       14691 :   observedCache_p(&VisBufferImpl2::visCube),
      48       14691 :   sigmaCache_p (&VisBufferImpl2::sigma),
      49       14691 :   sigmaSpectrumCache_p(& VisBufferImpl2::sigmaSpectrum),
      50       14691 :   weightCache_p (&VisBufferImpl2::weight),
      51       14691 :   weightSpectrumCache_p(& VisBufferImpl2::weightSpectrum),
      52       29382 :   vbi2_p (vb)
      53             : {
      54       14691 :     configureArrayCaches ();
      55       14691 : }
      56             : 
      57             : void
      58       29040 : Vbi2MsRow::configureArrayCaches ()
      59             : {
      60       29040 :     arrayCaches_p.push_back (& correctedCache_p);
      61       29040 :     arrayCaches_p.push_back (& flagCache_p);
      62       29040 :     arrayCaches_p.push_back (& modelCache_p);
      63       29040 :     arrayCaches_p.push_back (& observedCache_p);
      64       29040 :     arrayCaches_p.push_back (& sigmaCache_p);
      65       29040 :     arrayCaches_p.push_back (& sigmaSpectrumCache_p);
      66       29040 :     arrayCaches_p.push_back (& weightCache_p);
      67       29040 :     arrayCaches_p.push_back (& weightSpectrumCache_p);
      68       29040 : }
      69             : 
      70             : void
      71      467448 : Vbi2MsRow::clearArrayCaches ()
      72             : {
      73      467448 :     for (std::vector<CachedArrayBase *>::iterator i = arrayCaches_p.begin();
      74     4449914 :          i != arrayCaches_p.end();
      75     3982466 :          i ++){
      76     3982466 :         (* i)->clearCache();
      77             :     }
      78      467448 : }
      79             : 
      80             : void
      81      467448 : Vbi2MsRow::changeRow (rownr_t row)
      82             : {
      83      467448 :     MsRow::changeRow (row);
      84      467448 :     clearArrayCaches ();
      85      467448 : }
      86             : 
      87             : ////////////////////////////////////////////////////////////
      88             : //
      89             : // Scalar getters
      90             : //
      91             : 
      92             : Int
      93      228752 : Vbi2MsRow::antenna1 () const
      94             : {
      95      228752 :     return vbi2_p->antenna1 () (row ());
      96             : }
      97             : 
      98             : Int
      99      228752 : Vbi2MsRow::antenna2 () const
     100             : {
     101      228752 :     return vbi2_p->antenna2 () (row ());
     102             : }
     103             : 
     104             : Int
     105        8372 : Vbi2MsRow::arrayId () const
     106             : {
     107        8372 :     return vbi2_p->arrayId () (row ());
     108             : }
     109             : 
     110             : Int
     111           0 : Vbi2MsRow::correlationType () const
     112             : {
     113           0 :     return vbi2_p->correlationTypes () (row ());
     114             : }
     115             : 
     116             : 
     117             : template <typename T, typename U>
     118             : void
     119       25116 : Vbi2MsRow::copyIf (Bool copyThis, Vbi2MsRow * other,
     120             :                    void (Vbi2MsRow::* setter) (T),
     121             :                    U (Vbi2MsRow::* getter) () const)
     122             : {
     123       25116 :     if (copyThis){
     124       16744 :         (this ->* setter) ((other ->* getter) ());
     125             :     }
     126       25116 : }
     127             : 
     128             : void
     129        4186 : Vbi2MsRow::copy (Vbi2MsRow * other,
     130             :                  const VisBufferComponents2 & componentsToCopy)
     131             : {
     132             :     // Copy the data contents of the other row into this one
     133             : 
     134        4186 :     setAntenna1 (other->antenna1 ());
     135        4186 :     setAntenna2 (other->antenna2 ());
     136        4186 :     setArrayId (other->arrayId ());
     137        4186 :     setDataDescriptionId (other->dataDescriptionId ());
     138        4186 :     setExposure (other->exposure ());
     139        4186 :     setFeed1 (other->feed1 ());
     140        4186 :     setFeed2 (other->feed2 ());
     141        4186 :     setFieldId (other->fieldId ());
     142        4186 :     setFlags (other->flags ());
     143        4186 :     setInterval (other->interval ());
     144        4186 :     setObservationId (other->observationId ());
     145        4186 :     setProcessorId (other->processorId ());
     146        4186 :     setRowFlag (other->isRowFlagged());
     147        4186 :     setRowId (other->rowId());
     148        4186 :     setScanNumber (other->scanNumber ());
     149        4186 :     setSigma (other->sigma ());
     150        4186 :     setSpectralWindow (other->spectralWindow());
     151        4186 :     setStateId (other->stateId ());
     152        4186 :     setTime (other->time ());
     153        4186 :     setTimeCentroid (other->timeCentroid ());
     154        4186 :     setUvw (other->uvw ());
     155        4186 :     setWeight (other->weight ());
     156             : 
     157             :     // Optionally copied fields
     158             : 
     159        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::VisibilityCubeCorrected), other,
     160             :             & Vbi2MsRow::setCorrected, & Vbi2MsRow::corrected );
     161        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::VisibilityCubeModel), other,
     162             :             & Vbi2MsRow::setModel, & Vbi2MsRow::model );
     163        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::VisibilityCubeObserved), other,
     164             :             & Vbi2MsRow::setObserved, & Vbi2MsRow::observed );
     165        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::VisibilityCubeFloat), other,
     166             :             & Vbi2MsRow::setSingleDishData, & Vbi2MsRow::singleDishData );
     167        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::WeightSpectrum), other,
     168             :             & Vbi2MsRow::setWeightSpectrum, & Vbi2MsRow::weightSpectrum );
     169        4186 :     copyIf (componentsToCopy.contains (VisBufferComponent2::SigmaSpectrum), other,
     170             :             & Vbi2MsRow::setSigmaSpectrum, & Vbi2MsRow::sigmaSpectrum );
     171        4186 : }
     172             : 
     173             : 
     174             : Int
     175        8372 : Vbi2MsRow::dataDescriptionId () const
     176             : {
     177        8372 :     return vbi2_p->dataDescriptionIds () (row ());
     178             : }
     179             : 
     180             : Int
     181        8372 : Vbi2MsRow::feed1 () const
     182             : {
     183        8372 :     return vbi2_p->feed1 () (row ());
     184             : }
     185             : 
     186             : Int
     187        8372 : Vbi2MsRow::feed2 () const
     188             : {
     189        8372 :     return vbi2_p->feed2 () (row ());
     190             : }
     191             : 
     192             : Int
     193        8372 : Vbi2MsRow::fieldId () const
     194             : {
     195        8372 :     return vbi2_p->fieldId () (row ());
     196             : }
     197             : 
     198             : VisBufferImpl2 *
     199      224566 : Vbi2MsRow::getVbi () const
     200             : {
     201      224566 :     return vbi2_p;
     202             : }
     203             : 
     204             : 
     205             : Bool
     206      224566 : Vbi2MsRow::isRowFlagged () const
     207             : {
     208      224566 :     return vbi2_p->flagRow () (row ());
     209             : }
     210             : 
     211             : const Matrix<Bool> &
     212      453318 : Vbi2MsRow::flags () const
     213             : {
     214      453318 :     return flagCache_p.getCachedPlane (vbi2_p, row());
     215             : }
     216             : 
     217             : Matrix<Bool> &
     218      440760 : Vbi2MsRow::flagsMutable ()
     219             : {
     220      440760 :     return flagCache_p.getCachedPlane (vbi2_p, row());
     221             : }
     222             : 
     223             : Bool
     224           0 : Vbi2MsRow::isFlagged (Int correlation, Int channel) const
     225             : {
     226           0 :     return vbi2_p->flagCube () (correlation,channel, row ());
     227             : }
     228             : 
     229             : 
     230             : Int
     231        8372 : Vbi2MsRow::observationId () const
     232             : {
     233        8372 :     return vbi2_p->observationId () (row ());
     234             : }
     235             : 
     236             : Int
     237        8372 : Vbi2MsRow::processorId () const
     238             : {
     239        8372 :     return vbi2_p->processorId () (row ());
     240             : }
     241             : 
     242             : Int
     243        8372 : Vbi2MsRow::scanNumber () const
     244             : {
     245        8372 :     return vbi2_p->scan () (row ());
     246             : }
     247             : 
     248             : Int
     249        8372 : Vbi2MsRow::stateId () const
     250             : {
     251        8372 :     return vbi2_p->stateId () (row ());
     252             : }
     253             : 
     254             : Double
     255      444946 : Vbi2MsRow::exposure () const
     256             : {
     257      444946 :     return vbi2_p->exposure () (row ());
     258             : }
     259             : 
     260             : Double
     261      232902 : Vbi2MsRow::interval () const
     262             : {
     263      232902 :     return vbi2_p->timeInterval () (row ());
     264             : }
     265             : 
     266             : Int
     267        4186 : Vbi2MsRow::rowId () const
     268             : {
     269        4186 :     return vbi2_p->rowIds() (row());
     270             : }
     271             : 
     272             : Float
     273           0 : Vbi2MsRow::sigma (Int correlation) const
     274             : {
     275           0 :     return vbi2_p->sigma () (correlation, row ());
     276             : }
     277             : 
     278             : Int
     279      228752 : Vbi2MsRow::spectralWindow () const
     280             : {
     281      228752 :     return vbi2_p->spectralWindows() (row());
     282             : }
     283             : 
     284             : 
     285             : Double
     286      449132 : Vbi2MsRow::time () const
     287             : {
     288      449132 :     return vbi2_p->time () (row ());
     289             : }
     290             : Double
     291      449132 : Vbi2MsRow::timeCentroid () const
     292             : {
     293      449132 :     return vbi2_p->timeCentroid () (row ());
     294             : }
     295             : 
     296             : Float
     297      721380 : Vbi2MsRow::weight (Int correlation) const
     298             : {
     299      721380 :     return vbi2_p->weight () (correlation, row ());
     300             : }
     301             : 
     302             : 
     303             : ////////////////////////////////////////////////////////////
     304             : //
     305             : // Scalar setters
     306             : //
     307             : 
     308             : void
     309        8372 : Vbi2MsRow::setAntenna1 (Int value)
     310             : {
     311        8372 :     AssertWritable();
     312             : 
     313        8372 :     vbi2_p->cache_p->antenna1_p.getRef (false) (row ()) = value;
     314        8372 : }
     315             : 
     316             : void
     317        8372 : Vbi2MsRow::setAntenna2 (Int value)
     318             : {
     319        8372 :     AssertWritable();
     320             : 
     321        8372 :     vbi2_p->cache_p->antenna2_p.getRef (false)(row ()) = value;
     322        8372 : }
     323             : 
     324             : void
     325        8372 : Vbi2MsRow::setArrayId (Int value)
     326             : {
     327        8372 :     AssertWritable();
     328             : 
     329        8372 :     vbi2_p->cache_p->arrayId_p.getRef (false)(row ()) = value;
     330        8372 : }
     331             : 
     332             : void
     333           0 : Vbi2MsRow::setCorrelationType (Int value)
     334             : {
     335           0 :     AssertWritable();
     336             : 
     337           0 :     vbi2_p->cache_p->corrType_p.getRef (false)(row ()) = value;
     338           0 : }
     339             : 
     340             : 
     341             : 
     342             : void
     343        8372 : Vbi2MsRow::setDataDescriptionId (Int value)
     344             : {
     345        8372 :     AssertWritable();
     346             : 
     347        8372 :     vbi2_p->cache_p->dataDescriptionIds_p.getRef (false)(row ()) = value;
     348        8372 : }
     349             : 
     350             : void
     351        8372 : Vbi2MsRow::setFeed1 (Int value)
     352             : {
     353        8372 :     AssertWritable();
     354             : 
     355        8372 :     vbi2_p->cache_p->feed1_p.getRef (false)(row ()) = value;
     356        8372 : }
     357             : 
     358             : void
     359        8372 : Vbi2MsRow::setFeed2 (Int value)
     360             : {
     361        8372 :     AssertWritable();
     362             : 
     363        8372 :     vbi2_p->cache_p->feed2_p.getRef (false)(row ()) = value;
     364        8372 : }
     365             : 
     366             : void
     367        8372 : Vbi2MsRow::setFieldId (Int value)
     368             : {
     369        8372 :     AssertWritable();
     370             : 
     371        8372 :     vbi2_p->cache_p->fieldId_p.getRef (false)(row ()) = value;
     372        8372 : }
     373             : 
     374             : void
     375        8372 : Vbi2MsRow::setRowId (Int value)
     376             : {
     377        8372 :     AssertWritable();
     378             : 
     379        8372 :     vbi2_p->cache_p->rowIds_p.getRef (false) (row ()) = value;
     380        8372 : }
     381             : 
     382             : void
     383      232938 : Vbi2MsRow::setRowFlag (Bool isFlagged)
     384             : {
     385      232938 :     AssertWritable ();
     386             : 
     387      232938 :     vbi2_p->cache_p->flagRow_p.getRef (false)(row ()) = isFlagged;
     388      232938 : }
     389             : 
     390             : void
     391           0 : Vbi2MsRow::setFlags (Bool isFlagged, Int correlation, Int channel)
     392             : {
     393           0 :     AssertWritable ();
     394             : 
     395           0 :     vbi2_p->cache_p->flagCube_p.getRef (false)(correlation,channel, row ()) = isFlagged;
     396           0 : }
     397             : 
     398             : void
     399        8372 : Vbi2MsRow::setFlags (const Matrix<Bool> & value)
     400             : {
     401        8372 :     AssertWritable ();
     402             : 
     403        8372 :     Matrix<Bool> & flags = flagCache_p.getCachedPlane (vbi2_p, row());
     404        8372 :     flags = value;
     405        8372 : }
     406             : 
     407             : void
     408        8372 : Vbi2MsRow::setObservationId (Int value)
     409             : {
     410        8372 :     AssertWritable();
     411             : 
     412        8372 :     vbi2_p->cache_p->observationId_p.getRef (false)(row ()) = value;
     413        8372 : }
     414             : 
     415             : void
     416        8372 : Vbi2MsRow::setProcessorId (Int value)
     417             : {
     418        8372 :     AssertWritable();
     419             : 
     420        8372 :     vbi2_p->cache_p->processorId_p.getRef (false)(row ()) = value;
     421        8372 : }
     422             : 
     423             : void
     424        8372 : Vbi2MsRow::setScanNumber (Int value)
     425             : {
     426        8372 :     AssertWritable();
     427             : 
     428        8372 :     vbi2_p->cache_p->scan_p.getRef (false)(row ()) = value;
     429        8372 : }
     430             : 
     431             : void
     432        8372 : Vbi2MsRow::setSpectralWindow (Int value)
     433             : {
     434        8372 :     vbi2_p->cache_p->spectralWindows_p.getRef (false)(row ()) = value;
     435        8372 : }
     436             : 
     437             : void
     438        8372 : Vbi2MsRow::setStateId (Int value)
     439             : {
     440        8372 :     AssertWritable();
     441             : 
     442        8372 :     vbi2_p->cache_p->stateId_p.getRef (false)(row ()) = value;
     443        8372 : }
     444             : 
     445             : void
     446      224566 : Vbi2MsRow::setExposure (Double value)
     447             : {
     448      224566 :     AssertWritable();
     449             : 
     450      224566 :     vbi2_p->cache_p->exposure_p.getRef (false)(row ()) = value;
     451      224566 : }
     452             : 
     453             : void
     454       12522 : Vbi2MsRow::setInterval (Double value)
     455             : {
     456       12522 :     AssertWritable();
     457             : 
     458       12522 :     vbi2_p->cache_p->timeInterval_p.getRef (false)(row ()) = value;
     459       12522 : }
     460             : 
     461             : void
     462           0 : Vbi2MsRow::setSigma (Int correlation, Float value)
     463             : {
     464           0 :     AssertWritable();
     465             : 
     466           0 :     vbi2_p->cache_p->sigma_p.getRef (false)(correlation, row ()) = value;
     467           0 : }
     468             : 
     469             : void
     470        8372 : Vbi2MsRow::setTime (Double value)
     471             : {
     472        8372 :     AssertWritable();
     473             : 
     474        8372 :     vbi2_p->cache_p->time_p.getRef (false)(row ()) = value;
     475        8372 : }
     476             : 
     477             : void
     478      232938 : Vbi2MsRow::setTimeCentroid (Double value)
     479             : {
     480      232938 :     AssertWritable();
     481             : 
     482      232938 :     vbi2_p->cache_p->timeCentroid_p.getRef (false)(row ()) = value;
     483      232938 : }
     484             : 
     485             : void
     486           0 : Vbi2MsRow::setWeight (Int correlation, Float value)
     487             : {
     488           0 :     AssertWritable();
     489             : 
     490           0 :     vbi2_p->cache_p->weight_p.getRef (false)(correlation, row ()) = value;
     491           0 : }
     492             : 
     493             : ////////////////////////////////////////////////////////////
     494             : //
     495             : // Nonscalar getters
     496             : //
     497             : 
     498             : const Complex &
     499           0 : Vbi2MsRow::corrected (Int correlation, Int channel) const
     500             : {
     501           0 :     return vbi2_p->visCubeCorrected () (correlation, channel, row ());
     502             : }
     503             : 
     504             : 
     505             : Float
     506           0 : Vbi2MsRow::weightSpectrum (Int correlation, Int channel) const
     507             : {
     508           0 :     return vbi2_p->weightSpectrum () (correlation, channel, row ());
     509             : }
     510             : 
     511             : 
     512             : Float
     513           0 : Vbi2MsRow::sigmaSpectrum (Int correlation, Int channel) const
     514             : {
     515           0 :     return vbi2_p->sigmaSpectrum () (correlation, channel, row ());
     516             : }
     517             : 
     518             : 
     519             : const Complex &
     520           0 : Vbi2MsRow::model (Int correlation, Int channel) const
     521             : {
     522           0 :     return vbi2_p->visCubeModel () (correlation, channel, row ());
     523             : }
     524             : 
     525             : 
     526             : const Complex &
     527           0 : Vbi2MsRow::observed (Int correlation, Int channel) const
     528             : {
     529           0 :     return vbi2_p->visCube () (correlation, channel, row ());
     530             : }
     531             : 
     532           0 : const Float & Vbi2MsRow::singleDishData (Int correlation, Int channel) const
     533             : {
     534           0 :     return vbi2_p->visCubeFloat () (correlation, channel, row ());
     535             : }
     536             : 
     537             : const Vector<Double>
     538      453318 : Vbi2MsRow::uvw () const
     539             : {
     540      453318 :     return vbi2_p->uvw ().column (row());
     541             : }
     542             : 
     543             : void
     544      228752 : Vbi2MsRow::setUvw (const Vector<Double> & value)
     545             : {
     546      228752 :     vbi2_p->cache_p->uvw_p.getRef(false).column (row()) = value;
     547      228752 : }
     548             : 
     549             : const Matrix<Complex> &
     550      224566 : Vbi2MsRow::corrected () const
     551             : {
     552      224566 :     return correctedCache_p.getCachedPlane (vbi2_p, row());
     553             : }
     554             : 
     555             : Matrix<Complex> &
     556      224566 : Vbi2MsRow::correctedMutable ()
     557             : {
     558      224566 :     return correctedCache_p.getCachedPlane (vbi2_p, row());
     559             : }
     560             : 
     561             : void
     562        4186 : Vbi2MsRow::setCorrected (const Matrix<Complex> & value)
     563             : {
     564        4186 :     AssertWritable();
     565             : 
     566        4186 :     Matrix<Complex> & corrected = correctedCache_p.getCachedPlane (vbi2_p, row());
     567        4186 :     corrected = value;
     568        4186 : }
     569             : 
     570             : const Matrix<Complex> &
     571      224566 : Vbi2MsRow::model () const
     572             : {
     573      224566 :     return modelCache_p.getCachedPlane (vbi2_p, row());
     574             : }
     575             : 
     576             : Matrix<Complex> &
     577      224566 : Vbi2MsRow::modelMutable ()
     578             : {
     579      224566 :     return modelCache_p.getCachedPlane (vbi2_p, row());
     580             : }
     581             : 
     582             : void
     583        4186 : Vbi2MsRow::setModel (const Matrix<Complex> & value)
     584             : {
     585        4186 :     AssertWritable();
     586             : 
     587        4186 :     Matrix<Complex> & model = modelCache_p.getCachedPlane (vbi2_p, row());
     588        4186 :     model = value;
     589        4186 : }
     590             : 
     591             : const Matrix<Complex> &
     592           0 : Vbi2MsRow::observed () const
     593             : {
     594           0 :     return observedCache_p.getCachedPlane (vbi2_p, row());
     595             : }
     596             : 
     597             : Matrix<Complex> &
     598           0 : Vbi2MsRow::observedMutable ()
     599             : {
     600           0 :     return observedCache_p.getCachedPlane (vbi2_p, row());
     601             : }
     602             : 
     603             : void
     604           0 : Vbi2MsRow::setObserved (const Matrix<Complex> & value)
     605             : {
     606           0 :     AssertWritable();
     607             : 
     608           0 :     Matrix<Complex> & observed = observedCache_p.getCachedPlane (vbi2_p, row());
     609           0 :     observed = value;
     610           0 : }
     611             : 
     612             : const Vector<Float> &
     613      228752 : Vbi2MsRow::sigma () const
     614             : {
     615      228752 :     return sigmaCache_p.getCachedColumn (vbi2_p, row());
     616             : }
     617             : 
     618             : Vector<Float> &
     619      220380 : Vbi2MsRow::sigmaMutable () const
     620             : {
     621      220380 :     return sigmaCache_p.getCachedColumn (vbi2_p, row());
     622             : }
     623             : 
     624             : void
     625        4186 : Vbi2MsRow::setSigma (const Vector<Float> & value)
     626             : {
     627        4186 :     AssertWritable();
     628             : 
     629        4186 :     Vector<Float> & sigma = sigmaCache_p.getCachedColumn (vbi2_p, row());
     630        4186 :     sigma = value;
     631        4186 : }
     632             : 
     633           0 : const Matrix<Float> Vbi2MsRow::singleDishData () const
     634             : {
     635           0 :     return vbi2_p->visCubeFloat ().xyPlane (row());
     636             : }
     637             : 
     638             : Matrix<Float>
     639           0 : Vbi2MsRow::singleDishDataMutable ()
     640             : {
     641           0 :     return vbi2_p->visCubeFloat ().xyPlane (row());
     642             : }
     643             : 
     644             : void
     645           0 : Vbi2MsRow::setSingleDishData (const Matrix<Float> & value)
     646             : {
     647           0 :     vbi2_p->cache_p->floatDataCube_p.getRef(false).xyPlane (row()) = value;
     648           0 : }
     649             : 
     650             : 
     651             : 
     652             : const Vector<Float> &
     653      228752 : Vbi2MsRow::weight () const
     654             : {
     655      228752 :     return weightCache_p.getCachedColumn (vbi2_p, row());
     656             : }
     657             : 
     658             : Vector<Float> &
     659      220380 : Vbi2MsRow::weightMutable () const
     660             : {
     661      220380 :     return weightCache_p.getCachedColumn (vbi2_p, row());
     662             : }
     663             : 
     664             : void
     665       12558 : Vbi2MsRow::setWeight (const Vector<Float> & value)
     666             : {
     667       12558 :     AssertWritable();
     668             : 
     669       12558 :     Vector<Float> & weight = weightCache_p.getCachedColumn (vbi2_p, row());
     670       12558 :     weight = value;
     671       12558 : }
     672             : 
     673             : void
     674        8372 : Vbi2MsRow::setWeightSpectrum (const Matrix<Float> & value)
     675             : {
     676        8372 :     AssertWritable();
     677             : 
     678        8372 :     Matrix<Float> & weightSpectrum = weightSpectrumCache_p.getCachedPlane (vbi2_p, row());
     679        8372 :     weightSpectrum = value;
     680        8372 : }
     681             : 
     682             : const Matrix<Float> &
     683      241310 : Vbi2MsRow::weightSpectrum () const
     684             : {
     685      241310 :     return weightSpectrumCache_p.getCachedPlane (vbi2_p, row());
     686             : }
     687             : 
     688             : Matrix<Float> &
     689      220380 : Vbi2MsRow::weightSpectrumMutable () const
     690             : {
     691      220380 :     return weightSpectrumCache_p.getCachedPlane (vbi2_p, row());
     692             : }
     693             : 
     694             : const Matrix<Float> &
     695        8372 : Vbi2MsRow::sigmaSpectrum () const
     696             : {
     697        8372 :     return sigmaSpectrumCache_p.getCachedPlane (vbi2_p, row());
     698             : }
     699             : 
     700             : Matrix<Float> &
     701      220380 : Vbi2MsRow::sigmaSpectrumMutable () const
     702             : {
     703      220380 :     return sigmaSpectrumCache_p.getCachedPlane (vbi2_p, row());
     704             : }
     705             : 
     706             : void
     707        8372 : Vbi2MsRow::setSigmaSpectrum (const Matrix<Float> & value)
     708             : {
     709        8372 :     AssertWritable();
     710             : 
     711        8372 :     Matrix<Float> & sigmaSpectrum = sigmaSpectrumCache_p.getCachedPlane (vbi2_p, row());
     712        8372 :     sigmaSpectrum = value;
     713        8372 : }
     714             : 
     715             : ////////////////////////////////////////////////////////////
     716             : //
     717             : // Nonscalar setters
     718             : //
     719             : 
     720             : void
     721           0 : Vbi2MsRow::setCorrected (Int correlation, Int channel, const Complex & value)
     722             : {
     723           0 :     AssertWritable();
     724             : 
     725           0 :     vbi2_p->cache_p->correctedVisCube_p.getRef (false)(correlation, channel, row ()) = value;
     726           0 : }
     727             : 
     728             : void
     729           0 : Vbi2MsRow::setWeightSpectrum (Int correlation, Int channel, Float value)
     730             : {
     731           0 :     AssertWritable();
     732             : 
     733           0 :     vbi2_p->cache_p->weightSpectrum_p.getRef (false)(correlation, channel, row ()) = value;
     734           0 : }
     735             : 
     736             : 
     737             : void
     738           0 : Vbi2MsRow::setSigmaSpectrum (Int correlation, Int channel, Float value)
     739             : {
     740           0 :     AssertWritable();
     741             : 
     742           0 :     vbi2_p->cache_p->sigmaSpectrum_p.getRef (false)(correlation, channel, row ()) = value;
     743           0 : }
     744             : 
     745             : 
     746             : void
     747           0 : Vbi2MsRow::setModel (Int correlation, Int channel, const Complex & value)
     748             : {
     749           0 :     AssertWritable();
     750             : 
     751           0 :     vbi2_p->cache_p->modelVisCube_p.getRef (false)(correlation, channel, row ()) = value;
     752           0 : }
     753             : 
     754             : void
     755           0 : Vbi2MsRow::setObserved (Int correlation, Int channel, const Complex & value)
     756             : {
     757           0 :     AssertWritable();
     758             : 
     759           0 :     vbi2_p->cache_p->visCube_p.getRef (false)(correlation, channel, row ()) = value;
     760           0 : }
     761             : 
     762             : void
     763           0 : Vbi2MsRow::setSingleDishData (Int correlation, Int channel, const Float & value)
     764             : {
     765           0 :     AssertWritable();
     766             : 
     767           0 :     vbi2_p->cache_p->floatDataCube_p.getRef (false)(correlation, channel, row ()) = value;
     768           0 : }
     769             : 
     770             : 
     771             : 
     772             : }
     773             : }
     774             : 
     775             : 

Generated by: LCOV version 1.16