== Photometric analysis of stars using PS1 video cells == '''Introduction''' During PS1 observations several cells are set to video mode and a guide star is observed. The measured position of these guide stars is fed back to the telescope tracking system and is used to fine tune the tracking. It was pointed out that solar system objects might pass in front of a guide star and thus could be detected by a change in measured flux for the star. The IPP team has been requested to add a new stage to perform this analysis. The rest of this page discusses this project. Bill Sweeney has been prototyping a new program called psvideophot. This program contains some code provided by Pavlos Protopapas of CfA that Bill has modified to operate on PS1 video cells within the IPP environment. This program takes a GPC1 raw image file, finds the video cell, and examines the image cube frame by frame to measure the counts detected from the guide star. Certain results are printed to the stdout. Some work needs to be done to flesh out the analysis. The following sections contain notes on various issues. An initial implementation that does not address all of these issues is described [wiki:VideophotometryPipeline here]. '''Inputs:''' * Target exposure (the analysis operates on such a small number of pixels it should be possible to process all video cells for an exposure in one job.) However separate rows in the database should be used for the results. key: exp_id, class_id, cell_id. * Astrometric solution for the exposure (The results of camRun for the exposure). '''Outputs in data base''': * flag to indicate with a guide star with signal above a specified signal to noise observed at all * background count level * nominal signal to noise of star * first "good frame" It takes several frames (~30?) for the camera to center the star in the little video window * Flag indicating a "candidate transit event" was seen. (Perhaps SNR_max SNR_min instead) * ra, decl for the guide star (should match the target as reported in the raw fits header) '''Output fits table''' * one row for each frame containing the measurements made by psvideophot and certain parameters reported by the camera in the video extension table * The video cell and video extension extracted from the raw fits file. This file can be distributed outside IfA since magic is not required for these data. '''Software Components''' * two new database tables * an ippTool to manage the contents of the new tables: Queuing runs: the selection parameters will probably be quite similar to chiptool. Target exposures will be selected by OBS_MODE, date, etc. * ippScript to gather then inputs and other parameters and pass them to psvideophot * ippTask to manage processing in pantasks * enhancements to the distribution system to support this new stage. * refinements to psvideophot to be discussed in the next section '''psvideophot''' * Currently the program uses a hard coded aperture in "video cell coordinates". This needs to be variable based on the binning used by the camera. Currently columns are unbinned and rows are binned by 2. This is expected to change. The aperture might need to be variable based on seeing. We need recipe values for controlling this feature. * The exposure time for each frame may vary based on what the camera system is doing. This needs to be taken into account. * In the first several frames the guide star may not be centered in the cell. We need to detect when the camera is settled in and indicate this in the results. This information may be derived from the contents of the video extension. Similarly the last frame(s) of the exposure may be truncated and so they should be discarded from the analysis. * Take the video cell coordinates of the object centroid, convert to chip coordintes, apply the astrometric solution and report the result. Compare with the target star.