INSGEN DETAILS

In the following I have shown the output of insgen with various debugging flags to try to show how insgen works. Each section has a command line, the sample output, then a discussion of what to look for.

All of the above were done with for February 10, 2010 at 0UT with the iso=2010-02-10T00:00:00Z so you can repeat the experiments yourself with different debugging flags and options.

STARTUP
After starting insgen reads the local clock. This was overridden by the specifying the iso option.

Example 1: A a single targets with server, clock, and moon debugging information but no nogenerate:

fornax Code/telco> insgen reqid=185 iso=2010-02-10T00:00:00Z debug=0xa08 nogenerate
3 -->'tel_status'
3 <--'done tel_status name=Phony obs=Nowhere lat=31.9590 long=-111.5980 elev=2000.0 east=-90.0 west=90.0 north=75.0 south=-35.0 alt=10.0 scale=10.00 type=equat diam=0.75'
2010-02-10T00:00:00Z insgen
midnight=2010-02-10T07:40:36Z
lstMidnight=09:35:19
Sunset     2010-02-10T01:04:57Z --> 2010-02-10T14:16:15Z   47478
Nautical   2010-02-10T02:02:57Z --> 2010-02-10T13:18:15Z   40518
Fifteen    2010-02-10T02:17:14Z --> 2010-02-10T13:03:59Z   38805
Astron     2010-02-10T02:31:26Z --> 2010-02-10T12:49:46Z   37100
18:47:53.94 -24:30:31.0 2010.110 moon
Moon       2010-02-10T11:58:34Z --> 2010-02-10T21:48:43Z   35409
moon age=0.23
5 -->'ccd_status'
5 <--'done ccd_status nrow=512 ncol=256 readtime=5.0 tchip=20.0 name=phonyCCD darktime=1358677 gain=4 pixel=16.0 rot=0 tstatus=whoknows'
reqid=00185 moon dist=101.0 moondist=15.0 moonPhase=1.00
Reading the above you can see:
1) The calls to the observatory server used to determine the site location and limits.
2) The local midnight and and its LST
3) A bunch of NIGHT windows for different sun altitudes, windows are written as ISO start and end time with the seconds of blocktime.
4) The RA and dec and epoch of the moon at midnight.
5) The window that the moon is above the horizon (the real horizon, not the telescope limits or desired airmass).
6) The age of the moon with full being 1.0
7) The call to the observatory server to determine the ccd readout time.
READING THE REQUEST
Example 1: a single request (#185) with multiple exposures. The debug flag exposes: request info, database queries, coordinates and blocktime. I ran it with nopublish and nogenerate option to remove some clutter.
fornax Code/telco> insgen reqid=185 debug=0x1015 nopublish iso=2010-02-10T00:00:00Z nogenerate
2010-02-10T00:00:00Z insgen
SELECT Name,Priority,Twilight,Airmass,UTStart,ObsTime,MoonDistance,`Interval`,SunStart FROM Request WHERE RequestID=185
SELECT SUM((ExposureTime+10+5.0/(Binning*Binning))*Count) FROM Picture JOIN Target USING (TargetID) WHERE RequestID=185
SELECT COUNT(ObjectID) FROM Target WHERE RequestID=185
reqid=185 ccd=300 ntargets=1 blocktime=340
reqid=185
 name=M51
 blocktime=340
 utstart=(null)
 sunstart=(null)
 interval=86400
 priority=10
 twilight=-15.0
 moonphase=1.0
 moondist=15.0
 airmass 1.0-->3.0
SELECT RightAscension,Declination,Equinox,Name,ObjectID FROM Target JOIN Object USING(ObjectID) WHERE RequestID=185
reqid=00185 13:30:17.69 +47:08:35.0 2010.035 M51
1) The first SELECT statement determine the main properties of the request.
2) The next two SELECT statements determine the total CCD time and number of targets that are used to find the BlockTime.
4) The CCD time is calculated from the sum of the exposure time plus the ccd readout time, corrected for binning plus a overhead fudge factor.
5) The main properties of the request are summarized on the indented lines.
6) The last SELECT statement determines the target coordinates.
7) The coordinates of M51 are printed out.
OBSERVATION WINDOWS
Example 1: the same single target of M51. I have set the debugging to just expose the windows and transits.
fornax Code/telco> insgen reqid=185 debug=0x2 nopublish iso=2010-02-10T00:00:00Z
2010-02-10T00:00:00Z insgen
reqid=185 blocktime=340 priority=10 name=M51
 scheduled by Transit
 Night     2010-02-10T02:17:14Z --> 2010-02-10T13:03:59Z   38805
 Up        2010-02-10T05:35:56Z --> 2010-02-10T17:33:57Z   43081
 Visible   2010-02-10T05:35:56Z --> 2010-02-10T13:03:59Z   26883
 Best      2010-02-10T11:32:06Z --> 2010-02-10T11:37:46Z     340
 transit=  2010-02-10T11:34:56Z
reqid=00185 START=2010-02-10T11:32:06Z   340 M51
1) Look in the READING THE REQUEST section above at the indented details of the request. Since UTStart, and SunStart are NULL, the target is scheduled by Transit.
2) The twilight of -15 degrees, determines the NIGHT window. The coordinates, limits and airmass range of 1-3 determines the UP window. 3) The VISIBLE window is simply the logical ANDing of the UP & NIGHT.
4) The transit occurs at 11:34:56ZUT and since the BlockTime is 340 seconds, the BEST window will start 170 seconds earlier at 11:32:06UT so that transit occurs in the middle, the window length is the same as the BlockTime.
5) In this case the BEST window inside of the VISIBLE window, so the observation is scheduled at the BEST time.

Example 2: Let us look at the same target scheduled two months earlier.

fornax Code/telco> insgen reqid=185 debug=0x2 nopublish iso=2009-12-10T00:00:00Z
2009-12-10T00:00:00Z insgen
reqid=185 blocktime=340 priority=10 name=M51
 scheduled by Transit
 Night     2009-12-10T01:35:25Z --> 2009-12-10T13:02:38Z   41233
 Up        2009-12-10T09:39:41Z --> 2009-12-10T21:41:40Z   43319
 Visible   2009-12-10T09:39:41Z --> 2009-12-10T13:02:38Z   12177
 Best      2009-12-10T15:35:52Z --> 2009-12-10T15:41:32Z     340
 transit=  2009-12-10T15:38:42Z
reqid=00185 START=2009-12-10T12:56:58Z   340 M51
In this case the BEST window is outside of the VISIBLE window and the observation is scheduled at the end of the VISIBLE window.

Example 3: a cooldown request with a SunStart=0 and ObsTime=60.

insgen reqid=245 debug=0x03 nopublish iso=2010-02-10T00:00:00Z
2010-02-10T00:00:00Z insgen
reqid=245
 name=Cooldown
 blocktime=60
 utstart=(null)
 sunstart=0
 interval=86400
 priority=10
 twilight=(null)
 moonphase=(null)
 moondist=(null)
 airmass 1.0-->(null)
reqid=245 blocktime=60 priority=10 name=Cooldown
 scheduled by SunStart alt=0
 Night     *-------- 0 -------* --> *-------- 0 -------*
 Up        2010-02-10T01:04:57Z --> 2010-02-10T01:05:57Z      60
 Visible   2010-02-10T01:04:57Z --> 2010-02-10T01:05:57Z      60
 Best      2010-02-10T01:04:57Z --> 2010-02-10T01:05:57Z      60
 transit=  2010-02-10T01:05:27Z
reqid=00245 START=2010-02-10T01:04:57Z    60 Cooldown
In this case the NIGHT window is irrelevant, the UP starts when the Sun is zero degrees above the horizon and lasts for sixty seconds. The VISIBLE and BEST windows are the same.
SCHEDULING
insgen steps through the three possibilities for scheduling: Example #1 above shows when the BEST window is available and is within VISIBLE, then the observation is scheduled at the BEST window time.

Example #2 shows when the BEST window is outside the VISIBLE window and the observation is scheduled at the closest time possible.

Example #4. Now let me show an example where objects are pushed in time. The easiest one is to show what happens when you want to observe a request that could be observed at the best time, but twice in one night. In this case reqid=185 appears twice on the command line and debugging shows pushing.

 
fornax Code/telco> insgen reqid=185 reqid=185 debug=0x20 nopublish iso=2010-02-10T00:00:00Z
2010-02-10T00:00:00Z insgen
reqid=00185 M51
reqid=00185 M51
 reqid=00185 PushForward t=170 
reqid=00185 START=2010-02-10T11:29:16Z   340 M51
reqid=00185 START=2010-02-10T11:34:56Z   340 M51
1) From Example #1 we know that transit occurs at 11:34:56. 2) observation #1 is pushed earlier by 170 seconds 3) observation #2 is putshed later by 170 seconds This is ideal.

Example #5. Here is the same observation repeated 4 times.

fornax telco/graph> insgen reqid=185 reqid=185 reqid=185 reqid=185 debug=0x20 iso=2010-02-10T00:00:00Z
2010-02-10T00:00:00Z insgen
reqid=00185 M51
reqid=00185 M51
 reqid=00185 PushForward t=170 
reqid=00185 M51
 reqid=00185 PushForward t=170 
 reqid=00185 PushForward t=170 
reqid=00185 M51
 reqid=00185 PushForward t=170 
 reqid=00185 PushForward t=170 
 reqid=00185 PushForward t=170 
reqid=00185 START=2010-02-10T11:23:36Z   340 M51
reqid=00185 START=2010-02-10T11:29:16Z   340 M51
reqid=00185 START=2010-02-10T11:34:56Z   340 M51
reqid=00185 START=2010-02-10T11:40:36Z   340 M51