/** * \brief Symmetrize the exposure * * The M26C has an interlaced CCD which reads the different fields and * colors from different sides of the chip. This only works for symmetric * exposures, symmetric with respect to the center of the CCD chip. This * method computes a symmetrized exposure object. */ Exposure SxCcdM26C::symmetrize(const Exposure& exp) const { debug(LOG_DEBUG, DEBUG_LOG, 0, "symmetrizing exposure %s", exp.toString().c_str()); Exposure symexp = exp; int x[4], y[4]; x[0] = exp.x(); y[0] = exp.y(); x[1] = M26C_WIDTH - x[0]; y[1] = M26C_HEIGHT - y[0]; x[2] = exp.x() + exp.width(); y[2] = exp.y() + exp.height(); x[3] = M26C_WIDTH - x[2]; y[3] = M26C_HEIGHT - y[2]; debug(LOG_DEBUG, DEBUG_LOG, 0, "x[] = %d %d %d %d", x[0], x[1], x[2], x[3]); debug(LOG_DEBUG, DEBUG_LOG, 0, "y[] = %d %d %d %d", y[0], y[1], y[2], y[3]); // symmetrized origin ImagePoint origin(min(x, 4), min(y, 4)); // symmetrize size unsigned int sizex = max(x, 4) - symexp.x(); if (sizex > 3900) { sizex = 3900; } unsigned int sizey = max(y, 4) - symexp.y(); ImageSize size(sizex, sizey); ImageRectangle frame(origin, size); symexp.frame(frame); debug(LOG_DEBUG, DEBUG_LOG, 0, "symmetrized exposure: %s", symexp.toString().c_str()); return symexp; }
/** * \brief Symmetrize the exposure * * The M26C has an interlaced CCD which reads the different fields and * colors from different sides of the chip. This only works for symmetric * exposures, symmetric with respect to the center of the CCD chip. This * method computes a symmetrized exposure object. */ Exposure SxCcdM26C::symmetrize(const Exposure& exp) const { debug(LOG_DEBUG, DEBUG_LOG, 0, "symmetrizing exposure %s", exp.toString().c_str()); Exposure symexp = exp; int x[4], y[4]; // compute all the possible corner coordinates x[0] = exp.x(); y[0] = exp.y(); x[1] = M26C_WIDTH - x[0]; y[1] = M26C_HEIGHT - y[0]; x[2] = exp.x() + exp.width(); y[2] = exp.y() + exp.height(); x[3] = M26C_WIDTH - x[2]; y[3] = M26C_HEIGHT - y[2]; debug(LOG_DEBUG, DEBUG_LOG, 0, "x[] = %d %d %d %d", x[0], x[1], x[2], x[3]); debug(LOG_DEBUG, DEBUG_LOG, 0, "y[] = %d %d %d %d", y[0], y[1], y[2], y[3]); // make the origin with the right divisibility int xmin = ((min(x, 4) >> 2) << 2) - 4; if (xmin < 0) { xmin = 0; } int xmax = M26C_WIDTH - xmin; int ymin = ((min(y, 4) >> 2) << 2) - 4; if (ymin < 0) { ymin = 0; } int ymax = M26C_HEIGHT - ymin; // symmetrized origin ImagePoint origin(xmin, ymin); // symmetrize size unsigned int sizex = xmax - xmin; if (sizex > 3900) { sizex = 3900; } unsigned int sizey = ymax - ymin; ImageSize size(sizex, sizey); ImageRectangle frame(origin, size); symexp.frame(frame); debug(LOG_DEBUG, DEBUG_LOG, 0, "symmetrized exposure: %s", symexp.toString().c_str()); return symexp; }
/** * \brief Start an exposure on the M26C camera * * \param exposure exposure structure for the exposure to perform */ void SxCcdM26C::startExposure0(const Exposure& exposure) { debug(LOG_DEBUG, DEBUG_LOG, 0, "exposure %s requested", exposure.toString().c_str()); // remember the exposre, we need it for the second field for the // case where we do two fields one after the other this->exposure = symmetrize(exposure); m26c = m26cExposure(); // compute a better request for the M26C camera exposeField(0); timer.start(); // we are now in exposing state state = Exposure::exposing; }
/** * \brief Start an exposure on the M26C camera * * \param exposure exposure structure for the exposure to perform */ void SxCcdM26C::startExposure0(const Exposure& exposure) { debug(LOG_DEBUG, DEBUG_LOG, 0, "exposure %s requested", exposure.toString().c_str()); // remember the exposure, we need it for the second field for the // case where we do two fields one after the other this->exposure = symmetrize(exposure); // compute a better request for the M26C camera m26c = m26cExposure(); // start the exposure if (!camera.reserve("exposure M26C", 1000)) { std::string msg("cannot reserve camera"); debug(LOG_ERR, DEBUG_LOG, 0, "%s", msg.c_str()); throw std::runtime_error(msg); } exposeField(0); timer.start(); // we are now in exposing state state(CcdState::exposing); }