Changeset 18046 for trunk/FACT++


Ignore:
Timestamp:
01/03/15 05:32:49 (10 years ago)
Author:
Daniela Dorner
Message:
added checks for new options, fixed bug in ra/dec check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/Observation_class.js

    r17355 r18046  
    4141        ret[i].ra     = parseFloat(obs.ra);
    4242        ret[i].dec    = parseFloat(obs.dec);
     43        ret[i].zd     = parseFloat(obs.zd);
     44        ret[i].az     = parseFloat(obs.az);
     45        ret[i].lidclosed = obs.lidclosed;
     46        ret[i].rstype = obs.rstype ? obs.rstype : "default";
    4347        ret[i].sub    = i;
    4448        ret[i].start  = utc;
     
    6266                throw new Error("Observation must have either 'source' or 'task' " +
    6367                                "if 'task' == 'data' it must have also have 'source' ");
     68            if (ret[i].lidclosed == true)
     69                throw new Error("Observation must not have 'lidclosed'== true " +
     70                                "if 'task' == 'data' ");
    6471            break;
    6572
     
    7582
    7683        case 'RATESCAN':
    77             if (ret[i].source == undefined && (ret[i].ra == undefined || ret[i].dec == undefined))
     84            if (ret[i].source == undefined && (isNaN(ret[i].ra) || isNaN(ret[i].dec)))
    7885                throw new Error("Observation must have either 'source' or 'ra' & 'dec' " +
    7986                                "if 'task' == 'ratescan'");
     87            if (ret[i].lidclosed == true)
     88                throw new Error("Observation must not have 'lidclosed'== true " +
     89                                "if 'task' == 'ratescan' ");
     90            break;
     91
     92        case 'RATESCAN2':
     93            if ((ret[i].lidclosed != true) && ret[i].source == undefined && (isNaN(ret[i].ra) || isNaN(ret[i].dec)))
     94                throw new Error("Observation must have either 'source' or 'ra' & 'dec' " +
     95                                "if 'task' == 'ratescan2' and lidclosed==false or not given");
     96            if (ret[i].lidclosed == true && (isNaN(ret[i].az) || isNaN(ret[i].az)))
     97                throw new Error("Observation must have 'zd' & 'az' " +
     98                                "if 'task' == 'ratescan2' and option 'lidclosed'=='true'");
    8099            break;
    81100
Note: See TracChangeset for help on using the changeset viewer.