// AquireStoreDisplayImageNATION // // Function to take exposure with camera, readout data, save data, display data, and prepare for the next // observation // // Assumes the following variables are set: // datatype - a one character value representing the image type being taken (e.g., 'X' for exposure) /// tagtype makes X image be marked as Z image if zenith images only are taken // xTime - a real value containing the requested exposure time // logID - a four character value for the site (e.g., 'UAO_') // // Written by Jonathan J. Makela on 8 Aug 2012 based on AquireStoreDisplayImageFPI // Grab the current time for use in the filename curDateTime = $CurrentTime // Take the image TAKE_IMAGE FPI,tagtype // Convert the current time to string representation used in the filename. // This means the time is the time that the acquisition STARTED curDate = DateToInteger(curDateTime) curDate = ConvertToString("%06d",curDate) curTime = TimeToInteger(curDateTime)/1000 curTime = ConvertToString("%06d",curTime) //oStr = ConvertToString("%04d", OBSUID) LOG_OUTPUT MasterUser2, OVERWRITE //LOG_DISPLAY 2 "OBSUID: " + oStr LOG_DISPLAY 2 "START: " + curDate + curTime //LOG_OUTPUT MASTER, CLOSE xTimeExpos = xTime + 0.1 expos = RealToInteger(xTimeExpos) // Wait for exposure data collection to take place DELAY expos + 5 - 1 // wait for exposure data collection + 5 s which is overhead // Check the state of the camera until it is done with the exposure currentState = 0 while (currentState!=20073) { DELAY 1 GET_STATUS CAMERA FPI,STATE,currentState } // end of camera wait loop // Copy the image off of the camera COPY_IMAGE FPI // Create the image file name (of the form PKZ_X_20120818_030002.img) serialNumber = ConvertToString("%03d", seq) ImageName = dirImages + "\\" + logID + "_" + datatype + "_" + curDate + "_" + curTime + "_" + serialNumber + ".img" // Save the image SAVE_IMAGE ImageName // Display the image in Acquire DISPLAY_IMAGE ImageName RETURN