Skip to content

Commit

Permalink
More bugs fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
therandomfactory committed Nov 4, 2018
1 parent 7c38e8c commit 0627d38
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 92 deletions.
10 changes: 5 additions & 5 deletions andor/andor.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ global STATUS ANDOR_CFG
set ANDOR_CFG(kineticMode) 1
setKineticMode
.lowlevel.datarate configure -text ""
andorset vspeed red VSSpeed 0
andorset emhs red EMHSSpeed 0
andorset vspeed blue VSSpeed 0
andorset emhs blue EMHSSpeed 0
# andorset vspeed red VSSpeed 0
# andorset emhs red EMHSSpeed 0
# andorset vspeed blue VSSpeed 0
# andorset emhs blue EMHSSpeed 0
speckleshutter red open
speckleshutter blue open
fastvideomode
Expand Down Expand Up @@ -359,7 +359,7 @@ global ANDOR_CCD ANDOR_EMCCD
mimicMode blue temp "[format %5.1f [lindex $bluetemp 0]] degC"
.main.rcamtemp configure -text "[format %5.1f [lindex $redtemp 0]] degC"
.main.bcamtemp configure -text "[format %5.1f [lindex $bluetemp 0]] degC"
set perrun [expr int(100 / ($CAMSTATUS(blue,TKinetics) / 0.04))]
set perrun [expr int(100 / ($CAMSTATUS(blue,TKinetics) / $SCOPE(exposure))]
if { $perrun > 100 } {set perrun 100}
if { $perrun < 20 } {set perrun 20}
commandAndor red "numberkinetics $perrun"
Expand Down
46 changes: 29 additions & 17 deletions andor/andorCameraServer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ proc debuglog { msg } {
proc cAndorSetProperty { cam prop val {val2 ""} } {
global ANDOR_CFG ANDOR_ARM
if { $prop == "HSSpeed" } {
if { $val == 0 } { set res [andorSetProperty $cam HSSpeed 0 $val2] ; set prop EMHSSpeed ; set val $val2}
if { $val == 1 } { set res [andorSetProperty $cam HSSpeed 1 $val2] ; set val $val2}
if { $val == 0 } { set res [andorSetProperty $cam HSSpeed 0 $val2] ; set prop EMHSSpeed}
if { $val == 1 } { set res [andorSetProperty $cam HSSpeed 1 $val2]}
set val $val2
} else {
set res [andorSetProperty $cam $prop $val]
}
Expand Down Expand Up @@ -131,11 +132,11 @@ set ANDOR_CFG(fitds9) 0
set ANDOR_CFG($CAM,OutputAmplifier) 1
set ANDOR_CFG($CAM,PreAmpGain) 1
set ANDOR_CFG($CAM,VSSpeed) 1
set ANDOR_CFG($CAM,HSSpeed) 1
set ANDOR_CFG($CAM,HSSpeed) 0
set ANDOR_CFG($CAM,EMHSSpeed) 1
set ANDOR_CFG($CAM,hbin) 1
set ANDOR_CFG($CAM,vbin) 1
set ANDOR_CFG(configure) "1 1 1 1024 1 1024 1 1 1 1"
set ANDOR_CFG(configure) "1 1 1 1024 1 1024 1 1 0 1"
andorConfigure $CAM 1 1 1 1024 1 1024 $ANDOR_CFG($CAM,PreAmpGain) $ANDOR_CFG($CAM,VSSpeed) $ANDOR_CFG($CAM,HSSpeed) $ANDOR_CFG($CAM,EMHSSpeed)
debuglog "Configured camera id $CAM for ccd mode"

Expand Down Expand Up @@ -193,8 +194,8 @@ cAndorSetProperty $CAM EMCCDGain 1
cAndorSetProperty $CAM VSSpeed 1
#cAndorSetProperty $CAM VSAmplitude 0
cAndorSetProperty $CAM BaselineClamp 1
cAndorSetProperty $CAM PreAmpGain 1
cAndorSetProperty $CAM HSSpeed 1 1
cAndorSetProperty $CAM PreAmpGain 0
cAndorSetProperty $CAM HSSpeed 1 0
cAndorSetProperty $CAM HSSpeed 0 1
cAndorSetProperty $CAM ReadMode 4
cAndorSetProperty $CAM KineticCycleTime 0.0
Expand Down Expand Up @@ -279,25 +280,36 @@ global CAM ANDOR_CFG
# SCOPE - Array of telescope settings
#
proc configureFrame { mode } {
global CAM ANDOR_ROI ANDOR_CFG SCOPE
global CAM ANDOR_ROI ANDOR_CFG SCOPE TELEMETRY
if { $mode == "fullframe" } {
debuglog "Configure camera $CAM for fullframe"
andorConfigure $CAM $ANDOR_CFG($CAM,hbin) $ANDOR_CFG($CAM,vbin) 1 1024 1 1024 $ANDOR_CFG($CAM,PreAmpGain) $ANDOR_CFG($CAM,VSSpeed) $ANDOR_CFG($CAM,HSSpeed) $ANDOR_CFG($CAM,EMHSSpeed)
cAndorSetProperty $CAM AcquisitionMode 1
cAndorSetProperty $CAM OutputAmplifier 0
set TELEMETRY(speckle.andor.kinetic_mode) 0
# cAndorSetProperty $CAM OutputAmplifier 0
set SCOPE(numframes) 1
}
if { $mode == "roi" } {
debuglog "Configure camera $CAM for ROI : $ANDOR_ROI(xs) $ANDOR_ROI(xe) $ANDOR_ROI(ys) $ANDOR_ROI(ye)"
andorConfigure $CAM $ANDOR_CFG($CAM,hbin) $ANDOR_CFG($CAM,vbin) $ANDOR_ROI(xs) $ANDOR_ROI(xe) $ANDOR_ROI(ys) $ANDOR_ROI(ye) $ANDOR_CFG($CAM,PreAmpGain) $ANDOR_CFG($CAM,VSSpeed) $ANDOR_CFG($CAM,HSSpeed) $ANDOR_CFG($CAM,EMHSSpeed)
cAndorSetProperty $CAM AcquisitionMode 3
cAndorSetProperty $CAM OutputAmplifier 0
set TELEMETRY(speckle.andor.kinetic_mode) 1
if { $ANDOR_CFG($CAM,NumberAccumulations) > 1 } {
cAndorSetProperty $CAM AcquisitionMode 2
} else {
cAndorSetProperty $CAM AcquisitionMode 3
}
# cAndorSetProperty $CAM OutputAmplifier 0
}
if { $mode == "fullkinetic" } {
debuglog "Configure camera $CAM for fullframe"
andorConfigure $CAM $ANDOR_CFG($CAM,hbin) $ANDOR_CFG($CAM,vbin) 1 1024 1 1024 $ANDOR_CFG($CAM,PreAmpGain) $ANDOR_CFG($CAM,VSSpeed) $ANDOR_CFG($CAM,HSSpeed) $ANDOR_CFG($CAM,EMHSSpeed)
cAndorSetProperty $CAM AcquisitionMode 3
cAndorSetProperty $CAM OutputAmplifier 0
set TELEMETRY(speckle.andor.kinetic_mode) 1
if { $ANDOR_CFG($CAM,NumberAccumulations) > 1 } {
cAndorSetProperty $CAM AcquisitionMode 2
} else {
cAndorSetProperty $CAM AcquisitionMode 3
}
# cAndorSetProperty $CAM OutputAmplifier 0
}
}

Expand Down Expand Up @@ -678,10 +690,10 @@ global ANDOR_CCD ANDOR_EMCCD ANDOR_CODE CAM
}
}
switch vsspeed {
4.33usec { set res [cAndorSetProperty $CAM VSSpeed 0] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
2.2usec { set res [cAndorSetProperty $CAM VSSpeed 1] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
4.33usec { set res [cAndorSetProperty $CAM VSSpeed 4] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
2.2usec { set res [cAndorSetProperty $CAM VSSpeed 3] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
1.13usec { set res [cAndorSetProperty $CAM VSSpeed 2] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
0.6usec { set res [cAndorSetProperty $CAM VSSpeed 3] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
0.6usec { set res [cAndorSetProperty $CAM VSSpeed 1] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
}
switch vsamplitude {
normal { set res [cAndorSetProperty $CAM VSAmplitude 0] ; if { $res != $ANDOR_CODE(DRV_SUCCESS) } {return $res} }
Expand Down Expand Up @@ -880,6 +892,7 @@ global SCOPE CAM ANDOR_ARM ANDOR_CFG TELEMETRY SPECKLE_DATADIR FITSBITS
scalepeak { set ANDOR_CFG(scalepeak) [lindex $msg 1] ; puts $sock "OK"}
fitsbits { set ANDOR_CFG(fitsbits) $FITSBITS([lindex $msg 1]) ; puts $sock "OK"}
whicharm { puts $sock $ANDOR_ARM }
gettimings { set it [andorGetProperty $CAM timings] ; puts $sock $it }
forceroi { forceROI [lindex $msg 1] [lindex $msg 2] [lindex $msg 3] [lindex $msg 4] ; puts $sock "OK"}
locatestar { puts $sock "[locateStar [lindex $msg 1] [lindex $msg 2]]" }
datadir { set SPECKLE_DATADIR [lindex $msg 1] ; puts $sock "OK"}
Expand All @@ -900,7 +913,7 @@ global SCOPE CAM ANDOR_ARM ANDOR_CFG TELEMETRY SPECKLE_DATADIR FITSBITS
readmode { set it [cAndorSetProperty $CAM ReadMode [lindex $msg 1]] ; puts $sock $it}
acquisition { set it [cAndorSetProperty $CAM AcquisitionMode [lindex $msg 1]] ; puts $sock $it}
kineticcycletime { set it [cAndorSetProperty $CAM KineticCycleTime [lindex $msg 1]] ; puts $sock $it}
numberaccumulations { set it [cAndorSetProperty $CAM NumberAccumulations [lindex $msg 1]] ; puts $sock $it}
numberaccumulations { set it [cAndorSetProperty $CAM NumberAccumulations [lindex $msg 1]] ; puts $sock $it}
numberkinetics { set it [cAndorSetProperty $CAM NumberKinetics [lindex $msg 1]] ; puts $sock $it}
accumulationcycletime { set it [cAndorSetProperty $CAM AccumulationCycleTime [lindex $msg 1]] ; puts $sock $it}
setexposure { SetExposureTime [lindex $msg 1] ; puts $sock "OK"}
Expand Down Expand Up @@ -934,7 +947,6 @@ global SCOPE CAM ANDOR_ARM ANDOR_CFG TELEMETRY SPECKLE_DATADIR FITSBITS
andorConfigure $CAM $ANDOR_CFG($CAM,hbin) $ANDOR_CFG($CAM,vbin) $ANDOR_ROI(xs) $ANDOR_ROI(xe) $ANDOR_ROI(ys) $ANDOR_ROI(ye) $ANDOR_CFG($CAM,PreAmpGain) $ANDOR_CFG($CAM,VSSpeed) $ANDOR_CFG($CAM,HSSpeed) $ANDOR_CFG($CAM,EMHSSpeed)
puts $sock "OK"
}
setupcamera { set it [andorSetupCamera $CAM [lindex $msg 1]] ; puts $sock $it}
default { if { [string range [lindex $msg 0] 0 2] == "Get" } {
puts $sock [eval [lindex $msg 0]]
} else {
Expand Down
11 changes: 3 additions & 8 deletions andor/andor_tcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2851,25 +2851,25 @@ int tcl_andorConfigure(ClientData clientData, Tcl_Interp *interp, int argc, char
return TCL_ERROR;
}

/*
status = GetDetector(&andorSetup[cameraId].width, &andorSetup[cameraId].height);
status = GetTemperatureRange(&andorSetup[cameraId].minimum_temperature, &andorSetup[cameraId].maximum_temperature);
status = GetNumberPreAmpGains(&andorSetup[cameraId].num_preamp_gains);
status = GetNumberVSSpeeds(&andorSetup[cameraId].num_vertical_speeds);
/*
for(j = 0; j < ANDOR_NUM_AMPLIFIERS; j++) {
status = GetNumberHSSpeeds(0, j, &andorSetup[cameraId].num_horizontal_speeds[j]);
num_hspeeds = andorSetup[cameraId].num_horizontal_speeds[j];
for (i=0; i<num_hspeeds; i++) {
andor_get_horizontal_speed(j, i, &fspeed);
}
}
*/
status = GetEMGainRange(&andorSetup[cameraId].minimum_em_gain, &andorSetup[cameraId].maximum_em_gain);
status = GetNumberADChannels(&num_ad);

andorSetup[cameraId].amplifier = DFT_ANDOR_AMPLIFIER;
andorSetup[cameraId].em_gain = DFT_ANDOR_EM_GAIN;
andorSetup[cameraId].em_advanced = DFT_ANDOR_EM_ADVANCED;
*/

andorSetup[cameraId].horizontal_speed_index[ANDOR_CCD] = ccd_horizontal_speed;
andorSetup[cameraId].horizontal_speed_index[ANDOR_EMCCD] = em_horizontal_speed;
andorSetup[cameraId].vertical_speed_index = vertical_speed;
Expand All @@ -2887,11 +2887,6 @@ int tcl_andorConfigure(ClientData clientData, Tcl_Interp *interp, int argc, char
status = SetImage(andorSetup[cameraId].image.hbin,andorSetup[cameraId].image.vbin,andorSetup[cameraId].image.hstart,andorSetup[cameraId].image.hend,andorSetup[cameraId].image.vstart,andorSetup[cameraId].image.vend);
printf("status = %d in tcl_andorConfigure, %d,%d,%d,%d,%d,%d\n",status,andorSetup[cameraId].image.hbin,andorSetup[cameraId].image.vbin,andorSetup[cameraId].image.hstart,andorSetup[cameraId].image.hend,andorSetup[cameraId].image.vstart,andorSetup[cameraId].image.vend);

// status = andor_set_temperature(DFT_ANDOR_TEMPERATURE);
// status = andor_cooler_off();
// andor_setup_camera


return TCL_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion filtersConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set FWHEELS(red,6) "clear"
set FWHEELS(blue,1) "Blue-U"
set FWHEELS(blue,2) "Blue-G"
set FWHEELS(blue,3) "Blue-R"
set FWHEELS(blue,4) "Blue-467"
set FWHEELS(blue,4) "Blue-466"
set FWHEELS(blue,5) "Blue-562"
set FWHEELS(blue,6) "clear"

Expand Down
2 changes: 1 addition & 1 deletion filtersConfiguration.gemini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set FWHEELS(red,6) "clear"
set FWHEELS(blue,1) "Blue-u"
set FWHEELS(blue,2) "Blue-g"
set FWHEELS(blue,3) "Blue-r"
set FWHEELS(blue,4) "Blue-467"
set FWHEELS(blue,4) "Blue-466"
set FWHEELS(blue,5) "Blue-562"
set FWHEELS(blue,6) "clear"

Expand Down
2 changes: 1 addition & 1 deletion filtersConfiguration.wiyn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set FWHEELS(red,6) "clear"
set FWHEELS(blue,1) "Blue-u"
set FWHEELS(blue,2) "Blue-g"
set FWHEELS(blue,3) "Blue-r"
set FWHEELS(blue,4) "Blue-467"
set FWHEELS(blue,4) "Blue-466"
set FWHEELS(blue,5) "Blue-562"
set FWHEELS(blue,6) "clear"

Expand Down
1 change: 0 additions & 1 deletion gui-scripts/camera_init.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ set CAMSTATUS(CoolerMode) 1
set SCOPE(latitude) 31:57:11.78
set SCOPE(longitude) 07:26:27.97
set SCOPE(camera) "Andor iXon Ultra"
set SCOPE(instrument) speckle
set SCOPE(observer) ""
set SCOPE(target) test
set SCOPE(imagetype) OBJECT
Expand Down
9 changes: 4 additions & 5 deletions gui-scripts/gemini_telemetry.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ global SCOPE TELEMETRY FITSKEY IMGMETA ANDOR_CFG CAM
set TELEMETRY(speckle.andor.numberkinetics) $ANDOR_CFG(numberkinetics)
set TELEMETRY(speckle.andor.accumulationcycletime) $ANDOR_CFG(accumulationcycletime)
set TELEMETRY(speckle.andor.ccdtemp) $ANDOR_CFG(ccdtemp)
set TELEMETRY(speckle.andor.filter) $ANDOR_CFG(filter)
}

# \encdode
Expand All @@ -221,16 +220,16 @@ set ANDOR_CFG(readmode) 0
set ANDOR_CFG(configure) "1 1 1 1024 1 1024 0 0 0 0"
set ANDOR_CFG(fitsbits) default
set ANDOR_CFG(emccdgain) 0
set ANDOR_CFG(vsspeed) 0
set ANDOR_CFG(vsspeed) 1
set ANDOR_CFG(outputamp) 0
set ANDOR_CFG(preampgain) 0
set ANDOR_CFG(preampgain) 1
set ANDOR_CFG(0,SerialNumber) 12345
set ANDOR_CFG(1,SerialNumber) 54321
set ANDOR_CFG(temperature) 0.0
set ANDOR_CFG(inputzaber) "NA"
set ANDOR_CFG(fieldzaber) "NA"
set ANDOR_CFG(numberaccumulations) 0
set ANDOR_CFG(frametransfer) 0
set ANDOR_CFG(frametransfer) 1
set ANDOR_CFG(numberkinetics) 0
set ANDOR_CFG(accumulationcycletime) 0.0
set ANDOR_CFG(ccdtemp) 0.0
Expand Down Expand Up @@ -258,7 +257,7 @@ set GEMINI(lst) tcs.time.LAST
set GEMINI(mjd) tcs.time.MJD
set GEMINI(offsetdec) tcs.telescope.decoffset
set GEMINI(offsetra) tcs.telescope.raoffset
set GEMINI(programid) speckle.scope.program
set GEMINI(programid) speckle.scope.obsid
set GEMINI(rotator) tcs.nir.position
set GEMINI(targetname) speckle.scope.name
set GEMINI(targetra) tcs.target.az
Expand Down
6 changes: 4 additions & 2 deletions gui-scripts/gui2.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ set STATUS(readout) 0
# Update status display
#
showstatus "Building user interface"
set SCOPE(instrument) "SPECKLE"
set SCOPE(equinox) "2000.0"

#
Expand Down Expand Up @@ -527,6 +526,9 @@ place .main.simtlm -x 150 -y 252
if { $SCOPE(telescope) == "GEMINI" } {
checkbutton .main.simpico -bg gray -text "Picos" -variable PICOS(sim) -highlightthickness 0
place .main.simpico -x 85 -y 227
set SCOPE(instrument) "Alopeke"
} else {
set SCOPE(instrument) "NESSI"
}

menubutton .main.rawiq -text "DQ - image" -width 21 -fg black -bg gray -menu .main.rawiq.m -relief raised
Expand Down Expand Up @@ -721,7 +723,7 @@ catch {


speckleGuiMode observingGui
startfastvideo




Expand Down
4 changes: 2 additions & 2 deletions gui-scripts/headerBuilder.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ global TIMER
proc obsid { } {
global SCOPE TELEMETRY
if { $SCOPE(telescope) == "WIYN" } {
set obsid "[set SCOPE(telescope).speckle.20[exec date -u +\%y\%m\%dT\%H\%M\%S]"
set obsid "[set SCOPE(telescope)].speckle.20[exec date -u +\%y\%m\%dT\%H\%M\%S]"
} else {
set obsid $TELEMETRY(speckle.scope.program)
set obsid $TELEMETRY(speckle.scope.obsid)
}
return $obsid
}
Expand Down
2 changes: 2 additions & 0 deletions gui-scripts/headers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ header wiyn-speckle
speckle.andor.head
speckle.andor.acquisition_mode
speckle.andor.kinetic_time
speckle.andor.kinetic_mode
speckle.andor.numexp
speckle.andor.read_mode
speckle.andor.fullframe
Expand Down Expand Up @@ -103,6 +104,7 @@ header gemini-speckle
speckle.andor.head
speckle.andor.acquisition_mode
speckle.andor.kinetic_time
speckle.andor.kinetic_mode
speckle.scope.numexp
speckle.andor.read_mode
speckle.andor.fullframe
Expand Down
Loading

0 comments on commit 0627d38

Please sign in to comment.