query_select_tod_mod = CREATE TEMPORARY TABLE IF NOT EXISTS _DA_cache AS SELECT rowid, frmInd, thetaA, phiA, thetaB, phiB FROM _TOD._DA WHERE ((sciInd NOT IN (SELECT rowid FROM _TOD.TELEMETRY WHERE (((genflags <> 0) AND (genflags <> 192)) OR (_DA <> 0)))) AND rowid NOT IN (SELECT id FROM _DA_mask) AND ((ABS(thetaA) > 15.0) AND (ABS(thetaB) > 15.0))));SELECT frmInd, thetaA, phiA, thetaB, phiB, dtemp FROM _TOD._DET INNER JOIN _DA_cache ON _TOD._DET.rowid = _DA_cache.rowid WHERE ((_DA_cache.rowid >= _BEG) AND (_DA_cache.rowid <= _END));
Select data for model fitting. Note the use of a temporary in-memory table to speed up repetitive JOIN operations. The blue term demonstrates how to selectively allow certain quality flags to enter the fit. The green part is responsible for masking. The red term shows how to exclude additional pointings from the fit.
query_select_det_tbls = SELECT name FROM _TOD.sqlite_master WHERE ((type = 'table') AND ((name <> 'LOG') AND (name <> 'ATTITUDE') AND (name <> 'TELEMETRY') AND (name <> 'K1') AND (name <> 'KA1') AND (name <> 'Q1') AND (name <> 'Q2') AND (name <> 'V1') AND (name <> 'V2') AND (name <> 'W1') AND (name <> 'W2') AND (name <> 'W3') AND (name <> 'W4') AND (name LIKE '%Q1%')));
Select detectors (tables) to process. The blue term demonstrates how to limit the processed tables to one particular assembly.