<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_comparison_image(self):
 """ Search the DB for a comparison image for this cutout. """

        # selecting comparator when on a comparator should load a new one.
        collectionID = self.comparison_image_list[self.comparison_image_index]['EXPNUM']
        ref_ra = self.reading.ra * units.degree
        ref_dec = self.reading.dec * units.degree
        radius = self.radius is not None and self.radius or config.read('CUTOUTS.SINGLETS.RADIUS') * units.arcminute
        try:
            comparison = collectionID
            hdu_list = storage.ra_dec_cutout(storage.dbimages_uri(comparison),
                                             SkyCoord(ref_ra, ref_dec), radius)
            ccd = int(hdu_list[-1].header.get('EXTVER', 0))
            obs = Observation(str(comparison), 'p',
                              ccdnum=ccd)
            x = hdu_list[-1].header.get('NAXIS1', 0) // 2.0
            y = hdu_list[-1].header.get('NAXIS2', 0) // 2.0
            ref_ra = self.reading.ra * units.degree
            ref_dec = self.reading.dec * units.degree
            reading = SourceReading(x, y, self.reading.x, self.reading.y,
                                    ref_ra, ref_dec, self.reading.x, self.reading.y, obs)
            self.comparison_image_list[self.comparison_image_index]["REFERENCE"] = SourceCutout(reading, hdu_list)
        except Exception as ex:
            print traceback.format_exc()
            print ex
            print "Failed to load comparison image;"
            self.comparison_image_index = None
            logger.error("{} {}".format(type(ex), str(ex)))
            logger.error(traceback.format_exc())