Exemple #1
0
    def explain_calib(self):
        """
        Prints out information about the practice image
        :return:
        """
        if self._practicemode is False:
            raise StupidError(
                "Oi! you don't have a practice image for me to explain.")
        else:
            print("The standard star information is:")
            print("x, y, flux")
            print("-----------")
            print('%.2f, %.2f, %.2f' % (self._practicedict['psf_x'][0],
                                        self._practicedict['psf_y'][0],
                                        self._practicedict['psf_flux'][0]))
            print("-----------")
            if self._practicedict['ronflag']:
                print("RON: %.2f added" % self._practicedict['ron'])
            else:
                print("No RON added")

            if self._practicedict['shotflag']:
                print("Shot noise added")
            else:
                print("No Shot noise added")
Exemple #2
0
    def explain_practiceima(self):
        """
        Prints out information about the practice image
        :return:
        """
        if self._practicemode is False:
            raise StupidError(
                "Oi! you don't have a practice image for me to explain.")
        else:
            print("There are %i Objects in this image" %
                  self._practicedict['npsfs'])
            print("They have the following parameters:")
            print("x, y, flux")
            print("-----------")
            for i in range(self._practicedict['npsfs']):
                print('%.2f, %.2f, %.2f' % (self._practicedict['psf_x'][i],
                                            self._practicedict['psf_y'][i],
                                            self._practicedict['psf_flux'][i]))
            print("-----------")
            print("Background level: %.2f" % self._practicedict['bg'])
            print("Radius/FWHM: %.2f/%.2f" %
                  (self._practicedict['sigma'],
                   2.35 * self._practicedict['sigma']))
            if self._practicedict['ronflag']:
                print("RON: %.2f added" % self._practicedict['ron'])
            else:
                print("No RON added")

            if self._practicedict['shotflag']:
                print("Shot noise added")
            else:
                print("No Shot noise added")
Exemple #3
0
 def guess_psf(self, x, y, flux, error, poserr):
     """
     Compare a guess of the psf properties with the results.
     Matches will by accepted within actual value +- 1 error
     :param x: guess for x
     :param y: guess for y
     :param flux: guess for flux
     :param error: error in flux guess
     :param poserr: error in position
     :return:
     """
     if self._practicemode is False:
         raise StupidError(
             "Oi! you don't have a practice image to make a guess for.")
     match = False
     print("your guess: x,y = %.2f, %.2f (+- %.2f), flux=%.2f +- %.2f" %
           (x, y, poserr, flux, error))
     for i in range(self._practicedict['npsfs']):
         xpsf, ypsf, fpsf = self._practicedict['psf_x'][i], self._practicedict['psf_y'][i],\
                            self._practicedict['psf_flux'][i]
         if xpsf - poserr < x and xpsf + poserr > x:
             print('Matched in X position')
             if ypsf - poserr < y and ypsf + poserr > y:
                 print('Matched in Y position')
                 if fpsf - error < flux and fpsf + error > flux:
                     print(
                         'Matching psf with x = %.2f, y = %.2f, flux = %.2f'
                         % (xpsf, ypsf, fpsf))
                     print('Well done!')
                     match = True
                 else:
                     print("Match in position, but not flux.")
     if match is False:
         print('No match found.')
Exemple #4
0
 def practiceima_positions(self):
     """
     Prints out information about the practice image
     :return:
     """
     if self._practicemode is False:
         raise StupidError("Oi! you don't have a practice image for me to explain.")
     else:
         print("There are %i Objects in this image with positions" % self._practicedict['npsfs'])
         print("x, y")
         print("-----------")
         for i in range(self._practicedict['npsfs']):
             print('%.2f, %.2f' %(self._practicedict['psf_x'][i], self._practicedict['psf_y'][i]))