Exemple #1
0
 def test_dec_check_toosmall(self):
     """Check that Dec is forced to have reasonable values"""
     args = self.parser.parse_args(['--ra', str(self.skypos[0]),
                                    '--dec', str(-100),
                                    '-a', str(self.radius)])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #2
0
 def test_ra_check_toobig(self):
     """Check that RA is forced to have reasonable values"""
     args = self.parser.parse_args(['--ra', str(400),
                                    '--dec', str(self.skypos[1]),
                                    '-a', str(self.radius)])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #3
0
 def test_both_skypos(self):
     """Check that not _both_ RA/Dec and skypos are specified."""
     args = self.parser.parse_args(['--ra', str(self.skypos[0]),
                                    '--dec', str(self.skypos[1]),
                                    '--skypos', str([self.skypos[0]+1,
                                                     self.skypos[1]])])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #4
0
 def test_both_skypos(self):
     """Check that not _both_ RA/Dec and skypos are specified."""
     args = self.parser.parse_args([
         '--ra',
         str(self.skypos[0]), '--dec',
         str(self.skypos[1]), '--skypos',
         str([self.skypos[0] + 1, self.skypos[1]])
     ])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #5
0
 def test_dec_check_toosmall(self):
     """Check that Dec is forced to have reasonable values"""
     args = self.parser.parse_args([
         '--ra',
         str(self.skypos[0]), '--dec',
         str(-100), '-a',
         str(self.radius)
     ])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #6
0
 def test_ra_check_toobig(self):
     """Check that RA is forced to have reasonable values"""
     args = self.parser.parse_args([
         '--ra',
         str(400), '--dec',
         str(self.skypos[1]), '-a',
         str(self.radius)
     ])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #7
0
 def test_skypos_propagate(self):
     """Check that RA/Dec are propagated to skypos."""
     args = self.parser.parse_args(['--ra', str(self.skypos[0]),
                                    '--dec', str(self.skypos[1]),
                                    '-a', str(self.radius)])
     args = ga_check_args(args)
     self.assertAlmostEqual(args.skypos[0], self.skypos[0])
     self.assertAlmostEqual(args.skypos[1], self.skypos[1])
Exemple #8
0
 def test_annulus_propagate2(self):
     """Check that annulus propagates to inner and outer."""
     args = self.parser.parse_args(['--skypos', str(self.skypos),
                                    '-a', str(self.radius),
                                    '--annulus', str(self.annulus)])
     args = ga_check_args(args)
     self.assertAlmostEqual(self.annulus[0], args.annulus1)
     self.assertAlmostEqual(self.annulus[1], args.annulus2)
     self.assertAlmostEqual(self.annulus[0], args.annulus[0])
     self.assertAlmostEqual(self.annulus[1], args.annulus[1])
Exemple #9
0
 def test_skypos_propagate(self):
     """Check that RA/Dec are propagated to skypos."""
     args = self.parser.parse_args([
         '--ra',
         str(self.skypos[0]), '--dec',
         str(self.skypos[1]), '-a',
         str(self.radius)
     ])
     args = ga_check_args(args)
     self.assertAlmostEqual(args.skypos[0], self.skypos[0])
     self.assertAlmostEqual(args.skypos[1], self.skypos[1])
Exemple #10
0
 def test_annulus_propagate2(self):
     """Check that annulus propagates to inner and outer."""
     args = self.parser.parse_args([
         '--skypos',
         str(self.skypos), '-a',
         str(self.radius), '--annulus',
         str(self.annulus)
     ])
     args = ga_check_args(args)
     self.assertAlmostEqual(self.annulus[0], args.annulus1)
     self.assertAlmostEqual(self.annulus[1], args.annulus2)
     self.assertAlmostEqual(self.annulus[0], args.annulus[0])
     self.assertAlmostEqual(self.annulus[1], args.annulus[1])
Exemple #11
0
 def test_no_radius(self):
     """Check that the aperture radius is mandatory."""
     args = self.parser.parse_args(['--skypos', str(self.skypos)])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #12
0
 def test_no_skypos2(self):
     """Check that either RA/Dec or skypos is specified"""
     args = self.parser.parse_args(['--ra', str(self.skypos[0])])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #13
0
 def test_no_radius(self):
     """Check that the aperture radius is mandatory."""
     args = self.parser.parse_args(['--skypos', str(self.skypos)])
     with self.assertRaises(SystemExit):
         ga_check_args(args)
Exemple #14
0
 def test_no_skypos2(self):
     """Check that either RA/Dec or skypos is specified"""
     args = self.parser.parse_args(['--ra', str(self.skypos[0])])
     with self.assertRaises(SystemExit):
         ga_check_args(args)