Example #1
0
	def set_obs(self, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0):
		"""
		Returns an observation container with a single CTA observation.
		
		Keywords:
		 ra   - Right Ascension of pointing [deg] (default: 83.6331)
		 dec  - Declination of pointing [deg] (default: 22.0145)
		 emin - Minimum energy [TeV] (default: 0.1)
		 emax - Maximum energy [TeV] (default: 100.0)
		"""
		# Allocate observation container
		obs = GObservations()
	
		# Set single pointing
		pntdir = GSkyDir()
		pntdir.radec_deg(ra, dec)
		
		# Create CTA observation
		run = obsutils.set(pntdir, caldb=self.m_caldb, irf=self.m_irf, \
		                   duration=self.m_duration, deadc=self.m_deadc, \
                           emin=emin, emax=emax, rad=self.m_rad)
		
		# Append observation to container
		obs.append(run)
	
		# Return observation container
		return obs
Example #2
0
def survey_single():
    """
    Creates a single observation survey for test purposes.
    """
    # Allocate observation container
    obs = GObservations()
    
    # Set single pointing at galactic centre
    pntdir = GSkyDir()
    pntdir.lb_deg(0.0, 0.0)
    #run = set_one_obs(pntdir)
    run = obsutils.set(pntdir)
    obs.append(run)
    
    # Define single point source with Crab flux at galactic centre
    center = GSkyDir()
    center.lb_deg(0.0, 0.0)
    point_spatial  = GModelSpatialPointSource(center)
    point_spectrum = crab_spec()
    point          = GModelSky(point_spatial, point_spectrum)
    point.name('GC source')
    
    # Create model container
    models = GModels()
    models.append(point)
    obs.models(models)
    
    # Return observation container
    return obs
Example #3
0
	def set_obs(self, lpnt=0.0, bpnt=0.0, emin=0.1, emax=100.0):
		"""
		Returns an observation container with a single CTA observation.
		
		Keywords:
		 lpnt - Galactic longitude of pointing [deg] (default: 0.0)
		 bpnt - Galactic latitude of pointing [deg] (default: 0.0)
		 emin - Minimum energy [TeV] (default: 0.1)
		 emax - Maximum energy [TeV] (default: 100.0)
		"""
		# Allocate observation container
		obs = GObservations()
	
		# Set single pointing
		pntdir = GSkyDir()
		pntdir.lb_deg(lpnt, bpnt)
		
		# Create CTA observation
		run = obsutils.set(pntdir, caldb=self.m_caldb, irf=self.m_irf, \
		                   duration=self.m_duration, \
                           emin=emin, emax=emax, rad=self.m_roi)
		
		# Append observation to container
		obs.append(run)
	
		# Return observation container
		return obs
Example #4
0
def survey_single():
    """
	Creates a single observation survey for test purposes.
	"""
    # Allocate observation container
    obs = GObservations()

    # Set single pointing at galactic centre
    pntdir = GSkyDir()
    pntdir.lb_deg(0.0, 0.0)
    #run = set_one_obs(pntdir)
    run = obsutils.set(pntdir)
    obs.append(run)

    # Define single point source with Crab flux at galactic centre
    center = GSkyDir()
    center.lb_deg(0.0, 0.0)
    point_spatial = GModelSpatialPtsrc(center)
    point_spectrum = crab_spec()
    point = GModelPointSource(point_spatial, point_spectrum)
    point.name('GC source')

    # Create model container
    models = GModels()
    models.append(point)
    obs.models(models)

    # Return observation container
    return obs
Example #5
0
    def set_obs(self, ra=83.6331, dec=22.0145, emin=0.1, emax=100.0):
        """
		Returns an observation container with a single CTA observation.
		
		Keywords:
		 ra   - Right Ascension of pointing [deg] (default: 83.6331)
		 dec  - Declination of pointing [deg] (default: 22.0145)
		 emin - Minimum energy [TeV] (default: 0.1)
		 emax - Maximum energy [TeV] (default: 100.0)
		"""
        # Allocate observation container
        obs = GObservations()

        # Set single pointing
        pntdir = GSkyDir()
        pntdir.radec_deg(ra, dec)

        # Create CTA observation
        run = obsutils.set(pntdir, caldb=self.m_caldb, irf=self.m_irf, \
                           duration=self.m_duration, deadc=self.m_deadc, \
                                 emin=emin, emax=emax, rad=self.m_rad)

        # Append observation to container
        obs.append(run)

        # Return observation container
        return obs
Example #6
0
    def set_obs(self, lpnt=0.0, bpnt=0.0, emin=0.1, emax=100.0):
        """
		Returns an observation container with a single CTA observation.
		
		Keywords:
		 lpnt - Galactic longitude of pointing [deg] (default: 0.0)
		 bpnt - Galactic latitude of pointing [deg] (default: 0.0)
		 emin - Minimum energy [TeV] (default: 0.1)
		 emax - Maximum energy [TeV] (default: 100.0)
		"""
        # Allocate observation container
        obs = GObservations()

        # Set single pointing
        pntdir = GSkyDir()
        pntdir.lb_deg(lpnt, bpnt)

        # Create CTA observation
        run = obsutils.set(pntdir, caldb=self.m_caldb, irf=self.m_irf, \
                           duration=self.m_duration, \
                                 emin=emin, emax=emax, rad=self.m_rad)

        # Append observation to container
        obs.append(run)

        # Return observation container
        return obs
Example #7
0
def survey_gplane(lrange=10, lstep=2):
    """
    Creates a single observation survey for test purposes.
    
    Keywords:
     lrange - Longitude range (integer deg)
     lstep  - Longitude step size (integer deg)
    """
    # Allocate observation container
    obs = GObservations()
    
    # Loop over longitudes
    for l in range(-lrange,lrange+lstep,lstep):
        
        # Set pointing
        pntdir = GSkyDir()
        pntdir.lb_deg(l, 0.0)
        #run = set_one_obs(pntdir)
        run = obsutils.set(pntdir)
        run.id(str(l))
        obs.append(run)
    
    # Define single point source with Crab flux at galactic centre
    center = GSkyDir()
    center.lb_deg(0.0, 0.0)
    point_spatial  = GModelSpatialPointSource(center)
    point_spectrum = crab_spec()
    point          = GModelSky(point_spatial, point_spectrum)
    point.name('GC source')
    
    # Create model container
    models = GModels()
    models.append(point)
    obs.models(models)
    
    # Return observation container
    return obs
Example #8
0
def survey_gplane(lrange=10, lstep=2):
    """
	Creates a single observation survey for test purposes.
	
	Keywords:
	 lrange - Longitude range (integer deg)
	 lstep  - Longitude step size (integer deg)
	"""
    # Allocate observation container
    obs = GObservations()

    # Loop over longitudes
    for l in range(-lrange, lrange + lstep, lstep):

        # Set pointing
        pntdir = GSkyDir()
        pntdir.lb_deg(l, 0.0)
        #run = set_one_obs(pntdir)
        run = obsutils.set(pntdir)
        obs.append(run)

    # Define single point source with Crab flux at galactic centre
    center = GSkyDir()
    center.lb_deg(0.0, 0.0)
    point_spatial = GModelSpatialPtsrc(center)
    point_spectrum = crab_spec()
    point = GModelPointSource(point_spatial, point_spectrum)
    point.name('GC source')

    # Create model container
    models = GModels()
    models.append(point)
    obs.models(models)

    # Return observation container
    return obs