Changeset 19452 for trunk/FACT++/scripts/Main.js
- Timestamp:
- 03/28/19 18:40:40 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r19014 r19452 194 194 // ================================================================ 195 195 196 function OpenLid( )196 function OpenLid(fast) 197 197 { 198 198 /* … … 227 227 dim.log("Camera response: "+ret.data.replace(/\n/g,"/")+" ["+ret.rc+"]"); 228 228 } 229 230 if (!fast) 231 return; 232 229 233 dim.wait("LID_CONTROL", "Open", 30000); 230 234 … … 1508 1512 // ...no drs calibration was done yet 1509 1513 var drscal = (run%4==0 && (remaining>15 && diff>70)) || diff==null; 1510 1514 1511 1515 if (point) 1512 1516 { … … 1545 1549 } 1546 1550 1547 if (drscal )1551 if (drscal && !obs[sub].nodrs) 1548 1552 { 1549 1553 doDrsCalibration("data"); // will turn voltage off … … 1562 1566 continue; 1563 1567 1564 OpenLid(); 1565 1566 // This is now th right time to wait for th drive to be stable 1567 dim.wait("DRIVE_CONTROL", "OnTrack", 150000); // 110s for turning and 30s for stabilizing 1568 OpenLid(obs[sub].grb); 1569 1570 // This is now the right time to wait for the drive to be stable 1571 if (!obs[sub].grb) 1572 dim.wait("DRIVE_CONTROL", "OnTrack", 150000); // 110s for turning and 30s for stabilizing 1573 else 1574 v8.timeout(150000, function() { if (dim.state("DRIVE_CONTROL").name=="Approaching" || dim.state("DRIVE_CONTROL").name=="Tracking" || dim.state("DRIVE_CONTROL").name=="OnTrack") return true; }); 1568 1575 1569 1576 // Now check the voltage... (do not start a lot of stuff just to do nothing) … … 1578 1585 // and wait for the feedback to get stable 1579 1586 service_feedback.voltageOn(); 1580 service_feedback.waitForVoltageOn(); 1587 if (!obs[sub].grb) 1588 service_feedback.waitForVoltageOn(); 1589 1590 // For the first run to be taken (ratecontrol) 1591 // Lid must be != Closed 1592 // Drive must be >= Moving 1593 // Setting the threshold can take 2-3 seconds 1594 1595 if (obs[sub].grb && run==0) 1596 { 1597 // Instead of a pedestal run, we take a very short grb mode run 1598 // which is a classical data run but does not change the thresholds 1599 // This gives the voltages (typ. 5s) and currents (typ. 3s) time to 1600 // stabilize and threshold setting for the next run will be 1601 // reliable and fast but we have data already 1602 dim.log("Starting GRB mode."); 1603 1604 // Whatever we do... it does not make sense to start with a closed lid 1605 // If the lid is not yet open, wait for the lid to be open and 1606 // go on as usual. 1607 if (dim.state("LID_CONTROL")!="Open") 1608 { 1609 dim.wait("LID_CONTROL", "Open", 30000); 1610 service_feedback.waitForVoltageOn(); 1611 } 1612 1613 // Doing this manually makes it more flexible but turns off 1614 // automatic Critical mode checking of the feedback and 1615 // automatic reconnect 1616 var nextrun = sub_startrun.get().obj['next']; 1617 dim.log("Take run %3d".$(nextrun)+" [grb-mode]"); 1618 1619 dim.send("MCP/START", -1, -1, "grb"); // Use previous threshold settings if ratecontrol "InProgress" 1620 dim.wait("MCP", "TakingData", 15000); 1621 1622 dim.wait("FEEDBACK", "InProgress", 45000); // This is most likely the first to happen 1623 dim.wait("DRIVE_CONTROL", "Tracking", 150000); // 110s for turning and 30s for stabilizing 1624 1625 v8.wait(1000); // By now we should have collected the required three current events in FEEDBACK 1626 // Current are averaged over 10s. So by now we should have a reasonable idea of the brightness of the sky 1627 // Individual pixels might still suffer wrong settings 1628 // Starting a new run takes less than 2s (for 60s runs this is 3%) 1629 } 1581 1630 1582 1631 // If pointing had changed, do calibration 1583 if (!irq && point )1632 if (!irq && point && !obs[sub].grb) 1584 1633 { 1585 1634 dim.log("Starting calibration."); … … 1603 1652 var twilight = Sun.horizon(-16).isUp; 1604 1653 1605 if (twilight )1654 if (twilight || obs[sub].grb) 1606 1655 { 1607 1656 for (var i=0; i<5 && !irq; i++)
Note:
See TracChangeset
for help on using the changeset viewer.