// // Parameters read from file TimeCycle.txt: // startTime seconds after midnight when laser cals begin // zenithSunTwilight (direction=increasing) // zenithSunNight (direction=increasing) // zenithSunEndNight (direction=decreasing) // zenithSunEnd (direction=decreasing) ControlFileRead("TimeCycle.txt","startTime","zenithSunTwilight","zenithSunNight","zenithSunEndNight","zenithSunEnd") start = $CurrentTime+30 // allow short time,30 secs, for calculations, and get next twilight SolarPosition(start,&az,&ze) for (hr=1; hr<=24; hr=hr+1) { t = hr*3600 + start zeLast=ze SolarPosition(t,&az,&ze) if(zeLast=zenithSunTwilight) { hrTwilight=hr-1 } if(zeLast=zenithSunNight) { hrNight=hr-1 } if(zeLast>zenithSunEndNight && ze<=zenithSunEndNight) { hrEndNight=hr-1 } if(zeLast>zenithSunEnd && ze<=zenithSunEnd) { hrEnd=hr-1 } } t0 = hrTwilight*3600 + start // start of hour in which twilight is angle=zenithSunTwilight s=1 // angle must be increasing CALL "ZenithTime.txt" twilightTime=t // time to start evening twilight mode t0 = hrNight*3600 + start // start of hour in which night is angle=zenithSunNight s=1 // angle must be increasing CALL "ZenithTime.txt" beginNightTime=t // time for start of datataking at end of evening twilight mode t0 = hrEndNight*3600 + start // start of hour in which end night is angle=zenithSunEndNight s=-1 // angle must be decreasing CALL "ZenithTime.txt" endNightTime=t // time to stop night mode of observations, about EndTime -30 minutes t0 = hrEnd *3600 + start // start of hour in which twilight is angle=zenithSunEnd s=-1 // angle must be decreasing CALL "ZenithTime.txt" endTime=t // time to quit datataking and to go into sleep mode until the next startTime RETURN