/usr/share/cpl-plugins/xshoo-2.5.2/gasgano/config/xshoo.tpl.oca is in cpl-plugin-xshoo 2.5.2+dfsg-1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | // These are the Data Organiser's VLT DFS standard template rules.
//
// This rule file defines one template with the name "STANDARD".
//
// Questions may be directed to the author:
// Neil Ferguson - ESO/SDD/DFI/BET - <nferguso@eso.org>
// *** BEGIN RULES *** //
// Start the template log.
if(T) then
{
DO.TEMPLATE.STANDARD.LOG =
"INFO: considering file [" + LINKNAME + "] for template [STANDARD].";
}
// *** BEGIN VARIABLE INITIALISATION *** //
// Initialise persistent variables, if necessary.
if(DO.TEMPLATE.STANDARD.VAR.TPL.START is undefined) then
{
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nINFO: initialising persistent variables"
+ " for template [STANDARD].";
// The TPL.START value for the current template.
// [The time the template was started by the instrument.]
DO.TEMPLATE.STANDARD.VAR.TPL.START = "";
// The TPL.EXPNO value for the current template.
// [The exposure number of a given file within the template.]
DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO = 0;
// The TPL.NEXP value for the current template.
// [The total number of exposures forming this template.]
DO.TEMPLATE.STANDARD.VAR.TPL.NEXP = 0;
// The number of exposures currently held by this template.
DO.TEMPLATE.STANDARD.VAR.TPL.SIZE = 0;
}
// Initialise temporary variables.
if(T) then
{
// Indicates what the rules presently intend to do with this file.
//
// BASIC ERROR CHECK: perform basic error checks on the file.
// START NEW TEMPLATE: this file is the first of a new template.
// CONTINUE TEMPLATE: this file is part of an existing template.
// CLOSE TEMPLATE: the arrival of this file allows a template closure.
// TEMPLATE CLOSED: template closure is complete.
// IGNORE FILE: ignore the file; it will not become part of the template.
RULE.STATE = "BASIC ERROR CHECK";
}
// *** END VARIABLE INITIALISATION *** //
//
// *** BEGIN BASIC ERROR CHECKING *** //
// Check the file for valid template parameters.
if((RULE.STATE == "BASIC ERROR CHECK")
and ((TPL.START == "")
or (TPL.EXPNO is undefined)
or (TPL.NEXP is undefined))) then
{
// This file does not carry enough information to be part of a template.
// Log it and ignore it.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nINFO: file [" + LINKNAME
+ "] is not part of a [STANDARD] template.";
RULE.STATE = "IGNORE FILE";
}
// Range check TPL.EXPNO and TPL.NEXP:
// - values less than one are nonsensical.
// - DO templates cannot hold more than DO.MAX.TEMPLATE.EXPOSURES files.
if((RULE.STATE == "BASIC ERROR CHECK")
and ((TPL.EXPNO < 0)
or (TPL.EXPNO > DO.MAX.TEMPLATE.EXPOSURES)
or (TPL.NEXP < 0)
or (TPL.NEXP > DO.MAX.TEMPLATE.EXPOSURES))) then
{
// The file is carrying at least one invalid template parameter.
// This is an error; ignore the file.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nERROR: file [" + LINKNAME
+ "] is faulty. The exposure number [" + TPL.EXPNO
+ "] or total number of exposures [" + TPL.NEXP + "] is invalid.";
RULE.STATE = "IGNORE FILE";
}
if((RULE.STATE == "BASIC ERROR CHECK") and (TPL.EXPNO > TPL.NEXP)) then
{
// The file claims to contain an exposure whose number is greater than
// the total number of exposures in the template. This is an error;
// ignore the file.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nERROR: file [" + LINKNAME
+ "] is faulty. The exposure number [" + TPL.EXPNO
+ "] is larger than the total number of exposures ["
+ TPL.NEXP + "] in its template.";
RULE.STATE = "IGNORE FILE";
}
// *** END BASIC ERROR CHECKING *** //
//
// *** BEGIN NEW TEMPLATE CHECK *** //
// The file has cleared basic error checking.
//
// Barring certain rare errors, it will now become part of a template.
// Decide whether this file continues an existing template or starts a new one.
if((RULE.STATE == "BASIC ERROR CHECK")
and (TPL.START != DO.TEMPLATE.STANDARD.VAR.TPL.START)) then
{
// A new template has started.
RULE.STATE = "START NEW TEMPLATE";
}
if(RULE.STATE == "BASIC ERROR CHECK") then
{
// The current template is still being collated.
RULE.STATE = "CONTINUE TEMPLATE";
}
// *** END NEW TEMPLATE CHECK *** //
//
// *** BEGIN "START NEW TEMPLATE" *** //
if((RULE.STATE == "START NEW TEMPLATE")
and (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO
!= DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)) then
{
// A previous template was aborted - close it.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nWARNING: closing template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] prematurely with "
+ DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + " exposure(s); expected "
+ DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " CLOSE ";
}
if(RULE.STATE == "START NEW TEMPLATE") then
{
// Prepare to collate the new template.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nINFO: beginning new template [STANDARD][TPL.START: "
+ TPL.START + "].";
// Clear the old template's fileset.
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " CLEAR ";
// Initialise the persistent variables for the new template.
DO.TEMPLATE.STANDARD.VAR.TPL.START = TPL.START;
DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO = TPL.EXPNO;
DO.TEMPLATE.STANDARD.VAR.TPL.NEXP = TPL.NEXP;
DO.TEMPLATE.STANDARD.VAR.TPL.SIZE = 1;
// Add the current file to the new template.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nINFO: adding file [" + LINKNAME
+ "] to new template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START
+ "] as exposure " + DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO
+ " of " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " ADD ";
}
if((RULE.STATE == "START NEW TEMPLATE")
and (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO != 1)) then
{
// At least one exposure from this template has gone missing.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nERROR: template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] started with exposure "
+ DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + " (expected 1)."
+ " At least one exposure has gone missing;"
+ " attempting to collate template regardless.";
}
// *** END "START NEW TEMPLATE" *** //
//
// *** BEGIN "CONTINUE TEMPLATE" *** //
if((RULE.STATE == "CONTINUE TEMPLATE")
and (TPL.NEXP != DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)
and (TPL.NEXP < (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1))) then
{
// The file is trying to reduce the total number of exposures in the
// template to less than the number of exposures seen already.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nERROR: file [" + LINKNAME
+ "] attempts to reduce the number of exposures ["
+ DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + " -> " + TPL.NEXP
+ "] in template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START
+ "] to less than the number of exposures already seen ["
+ (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1)
+ "]. Forcing number of exposures to "
+ (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1) + ".";
// Force the number of exposures in this template to be the minimum
// required to accommodate the number seen already.
DO.TEMPLATE.STANDARD.VAR.TPL.NEXP =
DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1;
}
if((RULE.STATE == "CONTINUE TEMPLATE")
and (TPL.NEXP != DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)
and (TPL.NEXP >= (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1))) then
{
// The number of exposures in this template has changed, but it is still
// enough to accommodate all exposures.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nINFO: template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] now has " + TPL.NEXP
+ " exposure(s); was " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
// Update the number of exposures in this template.
DO.TEMPLATE.STANDARD.VAR.TPL.NEXP = TPL.NEXP;
}
if((RULE.STATE == "CONTINUE TEMPLATE")
and (TPL.EXPNO != (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1))) then
{
// The exposure number should have incremented by one, but this is not
// the case.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nWARNING: template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START
+ "] exposure number changed oddly to " + TPL.EXPNO
+ " (expected " + (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + 1) + ").";
}
if(RULE.STATE == "CONTINUE TEMPLATE") then
{
// Update the template's current exposure number and size.
DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO = TPL.EXPNO;
DO.TEMPLATE.STANDARD.VAR.TPL.SIZE = DO.TEMPLATE.STANDARD.VAR.TPL.SIZE + 1;
// Add the current file to the ongoing template.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nINFO: adding file [" + LINKNAME
+ "] to ongoing template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START
+ "] as exposure " + DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO
+ " of " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " ADD ";
}
// *** END "CONTINUE TEMPLATE" *** //
//
// *** BEGIN TEMPLATE CLOSURE CHECK *** //
if((RULE.STATE != "IGNORE FILE")
and (not (TPL.ID like "%irdifs%") or (DO.TEMPLATE.STANDARD.VAR.TPL.SIZE
== DO.TEMPLATE.STANDARD.VAR.TPL.NEXP))
and (DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO
== DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)) then
{
// This rule is not triggered for a combined IRDIS+IFS template,
// except if the last file of the template actually arrives last.
// The current template can be closed now.
//
// NOTE: this does not mean that the next exposure will start a new
// template. Some instruments - AMBER, for example - can arbitrarily
// reopen a template and add new exposures to it.
//
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nINFO: Filled template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] with "
+ DO.TEMPLATE.STANDARD.VAR.TPL.SIZE + " exposure(s)"
+ "; last exposure " + DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + "/" + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP
+ "; expected " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " CLOSE ";
RULE.STATE = "CLOSE TEMPLATE";
}
if((RULE.STATE != "IGNORE FILE")
and (RULE.STATE != "CLOSE TEMPLATE")
and (DO.TEMPLATE.STANDARD.VAR.TPL.SIZE
== DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)) then
{
// This rule is triggered for any (combined IRDIS+IFS data)
// template, that may produce out-of-order files
// The current template can be closed now.
//
// NOTE: this does not mean that the next exposure will start a new
// template. Some instruments - AMBER, for example - can arbitrarily
// reopen a template and add new exposures to it.
//
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nINFO: Closing template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] with "
+ DO.TEMPLATE.STANDARD.VAR.TPL.SIZE + " exposure(s)"
+ "; last exposure " + DO.TEMPLATE.STANDARD.VAR.TPL.EXPNO + "/" + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP
+ "; expected " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
DO.TEMPLATE.STANDARD = DO.TEMPLATE.STANDARD + " CLOSE ";
RULE.STATE = "CLOSE TEMPLATE";
}
if((RULE.STATE == "CLOSE TEMPLATE")
and (DO.TEMPLATE.STANDARD.VAR.TPL.SIZE
!= DO.TEMPLATE.STANDARD.VAR.TPL.NEXP)) then
{
// There is a mismatch between the number of exposures received for
// this template and the number it claims to contain.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nERROR: closing template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] with "
+ DO.TEMPLATE.STANDARD.VAR.TPL.SIZE + " exposure(s)"
+ "; expected " + DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + ".";
RULE.STATE = "TEMPLATE CLOSED";
}
if(RULE.STATE == "CLOSE TEMPLATE") then
{
// This template has the expected number of exposures.
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG
+ "\nINFO: closing template [STANDARD][TPL.START: "
+ DO.TEMPLATE.STANDARD.VAR.TPL.START + "] with "
+ DO.TEMPLATE.STANDARD.VAR.TPL.NEXP + " exposure(s).";
RULE.STATE = "TEMPLATE CLOSED";
}
// *** END TEMPLATE CLOSURE CHECK *** //
// Conclude the template log.
if(T) then
{
DO.TEMPLATE.STANDARD.LOG =
DO.TEMPLATE.STANDARD.LOG + "\nINFO: finished considering file ["
+ LINKNAME + "] for template [STANDARD].";
}
// *** END RULES *** //
|