def on_accept(self, auto=False):
        """
        Initiates acceptance procedure, gathering required data.
        @param auto: Set on_accept to automatic measure of source?
        """

        if self.model.is_current_source_named():
            provisional_name = self.model.get_current_source_name()
        else:
            provisional_name = self._generate_provisional_name()

        band = self.model.get_current_band()
        logger.debug("Got band {} and provisional_name {}".format(band, provisional_name))
        default_comment = ""

        source_cutout = self.model.get_current_cutout()

        if not auto:
            result = self.view.ds9.get('imexam key coordinate wcs fk5 degrees')
            # result = display.get("""imexam key coordinate $x $y $filename""")
            if not isinstance(result, str):
                print result
                result = str(result)
            values = result.split()
            ra = Quantity(float(values[1]), unit=units.degree)
            dec = Quantity(float(values[2]), unit=units.degree)
            key = values[0]
            (x, y, hdulist_index) = source_cutout.world2pix(ra, dec, usepv=False)
            source_cutout.update_pixel_location((float(x), float(y)), hdulist_index)
            source_cutout.reading.inverted = False
            (ra, dec) = source_cutout.pix2world(x, y, hdulist_index, usepv=True)
            self.place_marker(ra, dec, radius=int(source_cutout.apcor.ap_in*0.185+1)*units.arcsec,
                              colour='green', force=True)
        else:
            key = isinstance(auto, bool) and " " or auto
            ra = source_cutout.reading.ra * units.degree
            dec = source_cutout.reading.dec * units.degree
            self.place_marker(ra, dec, radius=int(source_cutout.apcor.ap_in*0.185+1)*units.arcsec,
                              colour='cyan', force=True)
            (x, y, hdulist_index) = source_cutout.world2pix(ra, dec, usepv=False)
            source_cutout.update_pixel_location((float(x), float(y)), hdulist_index)
            # now we've reset the pixel locations, so they are no longer inverted.
            source_cutout.reading.inverted = False

        marked_skycoord = source_cutout.reading.sky_coord

        try:
            phot = self.model.get_current_source_observed_magnitude()
            cen_x = phot['XCENTER'][0]
            cen_y = phot['YCENTER'][0]
            obs_mag = phot['MAG'][0]
            obs_mag_err = phot['MERR'][0]
            if phot.mask[0]['MAG'] or phot.mask[0]['MERR']:
                obs_mag = None
                obs_mag_err = None
            phot_failure = phot['PIER'][0] != 0 or phot.mask[0]['MAG']
            sky_failure = phot['SIER'][0] != 0 or phot.mask[0]['MAG']
            cen_failure = phot['CIER'][0] != 0
            if key != 'h':
                source_cutout.update_pixel_location((cen_x, cen_y), hdulist_index)
        except Exception as er:
            print("DAOPhot failure: {}".format(er))
            logger.critical("PHOT ERROR: {}".format(er))
            phot_failure = sky_failure = cen_failure = True
            obs_mag = None
            obs_mag_err = None
            band = ''
            default_comment = str(er)

        obs_mag = phot_failure and None or obs_mag
        obs_mag_err = phot_failure and None or obs_mag_err
        self.place_marker(source_cutout.ra * units.degree, source_cutout.dec*units.degree,
                          radius=int(source_cutout.apcor.ap_in*0.185+1)*units.arcsec,
                          colour='white',
                          force=True)

        # compare the RA/DEC position of the reading now that we have measured it to the initial value.
        if marked_skycoord.separation(source_cutout.reading.sky_coord) > 1 * units.arcsec or cen_failure:
            # check if the user wants to use the selected location or the DAOPhot centroid.
            self.view.show_offset_source_dialog(source_cutout.reading.sky_coord, marked_skycoord)

        note1_default = ""
        if self.model.is_current_source_adjusted():
            note1_default = config.read("MPC.NOTE1_HAND_ADJUSTED")
        else:
            for note in config.read("MPC.NOTE1OPTIONS"):
                if note.lower().startswith(key):
                    note1_default = note
                    break
        note1 = len(note1_default) > 0 and note1_default[0] or note1_default

        if isinstance(self, ProcessTracksController):
            this_observation = mpc.Observation(
                null_observation=False,
                provisional_name=provisional_name,
                note1=note1,
                note2=config.read('MPC.NOTE2DEFAULT')[0],
                date=self.model.get_current_observation_date(),
                ra=self.model.get_current_ra(),
                dec=self.model.get_current_dec(),
                mag=obs_mag,
                mag_err=obs_mag_err,
                band=band,
                observatory_code=config.read("MPC.DEFAULT_OBSERVATORY_CODE"),
                discovery=self.is_discovery,
                comment=None,
                xpos=source_cutout.reading.x,
                ypos=source_cutout.reading.y,
                frame=source_cutout.reading.obs.rawname,
                astrometric_level=source_cutout.astrom_header.get('ASTLEVEL', None))

            try:
                previous_observations = self.model.get_writer().get_chronological_buffered_observations()
                for idx, observation in enumerate(previous_observations):
                    try:
                        if observation.comment.frame.strip() == this_observation.comment.frame.strip():
                            previous_observations[idx] = this_observation
                            this_observation = False
                            break
                    except Exception as ex:
                        print type(ex), str(ex)
                if this_observation:
                    previous_observations.append(this_observation)
                print Orbfit(previous_observations).summarize()
            except Exception as ex:
                logger.error(str(type(ex))+" "+str(ex))
                print "Failed to compute preliminary orbit."

        if obs_mag < 24 and auto is not False:
            self.on_do_accept(None,
                              provisional_name,
                              sky_failure and "S  poor sky" or note1_default,
                              config.read("MPC.NOTE2DEFAULT"),
                              self.model.get_current_observation_date(),
                              self.model.get_current_ra(),
                              self.model.get_current_dec(),
                              obs_mag,
                              obs_mag_err,
                              band,
                              config.read("MPC.DEFAULT_OBSERVATORY_CODE"), ""
                              )
        else:
            self.view.show_accept_source_dialog(
                provisional_name,
                self.model.get_current_observation_date(),
                self.model.get_current_ra(),
                self.model.get_current_dec(),
                obs_mag,
                obs_mag_err,
                band,
                note1_choices=config.read("MPC.NOTE1OPTIONS"),
                note2_choices=config.read("MPC.NOTE2OPTIONS"),
                note1_default=sky_failure and "S  poor sky" or note1_default,
                note2_default=config.read("MPC.NOTE2DEFAULT"),
                default_observatory_code=config.read("MPC.DEFAULT_OBSERVATORY_CODE"),
                default_comment=default_comment,
                phot_failure=phot_failure,
                pixel_x=source_cutout.pixel_x,
                pixel_y=source_cutout.pixel_y)