Commits
Ville Suoranta authored 039b2ab9c7b Merge
140 140 | } else { |
141 141 | loadNewCalTable(loadAxes, loadData, thread); |
142 142 | } |
143 143 | } |
144 144 | |
145 145 | // ======================== NewCalTable ========================== |
146 146 | |
147 147 | void CalCache::loadNewCalTable(vector<PMS::Axis>& loadAxes, |
148 148 | vector<PMS::DataColumn>& loadData, ThreadCommunication* thread) { |
149 149 | // Get various names, properties from cal table |
150 - | NewCalTable ct(NewCalTable::createCT(filename_, Table::Old, Table::Plain)); |
151 - | basis_ = ct.polBasis(); |
152 - | parsAreComplex_ = ct.isComplex(); |
153 - | ROCTColumns ctCol(ct); |
150 + | TableLock lock(TableLock::AutoNoReadLocking); |
151 + | NewCalTable* ct = new NewCalTable(filename_, lock, Table::Old, Table::Plain); |
152 + | basis_ = ct->polBasis(); |
153 + | parsAreComplex_ = ct->isComplex(); |
154 + | ROCTColumns ctCol(*ct); |
154 155 | antnames_ = ctCol.antenna().name().getColumn(); |
155 156 | stanames_ = ctCol.antenna().station().getColumn(); |
156 157 | antstanames_ = antnames_ + String("@") + stanames_; |
157 158 | fldnames_ = ctCol.field().name().getColumn(); |
158 159 | positions_ = ctCol.antenna().position().getColumn(); |
159 160 | nAnt_ = ctCol.antenna().nrow(); |
161 + | delete ct; |
160 162 | |
161 163 | setUpCalIter(filename_,selection_, True,True,True); |
162 164 | countChunks(*ci_p, loadAxes, loadData, thread); |
163 165 | loadCalChunks(*ci_p, loadAxes, thread); |
164 166 | if (ci_p) |
165 167 | delete ci_p; |
166 168 | ci_p = NULL; |
167 169 | } |
168 170 | |
169 171 | void CalCache::setUpCalIter(const String& ctname, |