Ejemplo n.º 1
0
    def get_sensitivity(self, observation_time=50):
        if self.site in ['south', 'paranal']:
            self.E, self.sensitivity = np.loadtxt(ds.get('cta_requirements_South-50h.dat'), unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.sensitivity = np.loadtxt(ds.get('cta_requirements_North-50h.dat'), unpack=True)

        return self.E, self.sensitivity
Ejemplo n.º 2
0
    def get_effective_area(self, observation_time=50):
        """
        Return the effective area at the given observation time in hours.
        NB: Only 50h supported
        Returns the energy array and the effective area array
        Parameters
        ----------
        observation_time: optional

        Returns
        -------
        `numpy.ndarray`, `numpy.ndarray`
        """
        if self.site == 'south':
            if observation_time == 50:
                self.E, self.effective_area = np.loadtxt(
                    ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-EffArea.txt'),
                    skiprows=11, unpack=True)
            if observation_time == 0.5:
                self.E, self.effective_area = np.loadtxt(
                    ds.get('CTA-Performance-prod3b-v1-North-20deg-30m-EffArea.txt'),
                    skiprows=11, unpack=True)

        if self.site == 'north':
            if observation_time == 50:
                self.E, self.effective_area = np.loadtxt(
                    ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-EffArea.txt'),
                    skiprows=11, unpack=True)
            if observation_time == 0.5:
                self.E, self.effective_area = np.loadtxt(
                    ds.get('CTA-Performance-prod3b-v1-North-20deg-30m-EffArea.txt'),
                    skiprows=11, unpack=True)
        return self.E, self.effective_area
Ejemplo n.º 3
0
    def get_angular_resolution(self):
        if self.site == 'south':
            self.E, self.angular_resolution = np.loadtxt(ds.get('cta_requirements_South-50h-AngRes.dat'), unpack=True)
        if self.site == 'north':
            self.E, self.angular_resolution = np.loadtxt(ds.get('cta_requirements_North-50h-AngRes.dat'), unpack=True)

        return self.E, self.angular_resolution
Ejemplo n.º 4
0
    def get_energy_resolution(self):
        if self.site in ['south', 'paranal']:
            self.E, self.energy_resolution = np.loadtxt(ds.get('cta_requirements_South-50h-ERes.dat'), unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.energy_resolution = np.loadtxt(ds.get('cta_requirements_North-50h-ERes.dat'), unpack=True)

        return self.E, self.energy_resolution
Ejemplo n.º 5
0
    def get_sensitivity(self, observation_time=50):
        if self.site in ['south', 'paranal']:
            self.E, self.sensitivity = np.loadtxt(
                ds.get('cta_requirements_South-50h.dat'), unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.sensitivity = np.loadtxt(
                ds.get('cta_requirements_North-50h.dat'), unpack=True)

        return self.E, self.sensitivity
Ejemplo n.º 6
0
    def get_energy_resolution(self):
        if self.site in ['south', 'paranal']:
            self.E, self.energy_resolution = np.loadtxt(ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-Eres.txt'),
                                                        skiprows=11, unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.energy_resolution = np.loadtxt(ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-Eres.txt'),
                                                        skiprows=11, unpack=True)

        return self.E, self.energy_resolution
Ejemplo n.º 7
0
    def get_energy_resolution(self):
        if self.site in ['south', 'paranal']:
            self.E, self.energy_resolution = np.loadtxt(
                ds.get('cta_requirements_South-50h-ERes.dat'), unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.energy_resolution = np.loadtxt(
                ds.get('cta_requirements_North-50h-ERes.dat'), unpack=True)

        return self.E, self.energy_resolution
Ejemplo n.º 8
0
    def get_angular_resolution(self):
        if self.site == 'south':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('cta_requirements_South-50h-AngRes.dat'), unpack=True)
        if self.site == 'north':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('cta_requirements_North-50h-AngRes.dat'), unpack=True)

        return self.E, self.angular_resolution
Ejemplo n.º 9
0
    def get_angular_resolution(self):
        if self.site == 'south':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-Angres.txt'),
                skiprows=11, unpack=True)
        if self.site == 'north':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-Angres.txt'),
                skiprows=11, unpack=True)

        return self.E, self.angular_resolution
Ejemplo n.º 10
0
    def get_sensitivity(self, observation_time=50):
        if self.site in ['south', 'paranal']:
            Emin, Emax, self.sensitivity = np.loadtxt(ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-DiffSens.txt'),
                                                  skiprows=10, unpack=True)
            self.E = logbin_mean(np.append(Emin, Emax[-1]))

        if self.site in ['north', 'lapalma']:
            Emin, Emax, self.sensitivity = np.loadtxt(ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-DiffSens.txt'),
                                                  skiprows=10, unpack=True)
            self.E = logbin_mean(np.append(Emin, Emax[-1]))

        return self.E, self.sensitivity
Ejemplo n.º 11
0
    def get_energy_resolution(self):
        if self.site in ['south', 'paranal']:
            self.E, self.energy_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-Eres.txt'),
                skiprows=11,
                unpack=True)
        if self.site in ['north', 'lapalma']:
            self.E, self.energy_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-Eres.txt'),
                skiprows=11,
                unpack=True)

        return self.E, self.energy_resolution
Ejemplo n.º 12
0
    def get_angular_resolution(self):
        if self.site == 'south':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-South-20deg-50h-Angres.txt'),
                skiprows=11,
                unpack=True)
        if self.site == 'north':
            self.E, self.angular_resolution = np.loadtxt(
                ds.get('CTA-Performance-prod3b-v1-North-20deg-50h-Angres.txt'),
                skiprows=11,
                unpack=True)

        return self.E, self.angular_resolution
Ejemplo n.º 13
0
    def get_sensitivity(self, observation_time=50):
        if self.site in ['south', 'paranal']:
            Emin, Emax, self.sensitivity = np.loadtxt(ds.get(
                'CTA-Performance-prod3b-v1-South-20deg-50h-DiffSens.txt'),
                                                      skiprows=10,
                                                      unpack=True)
            self.E = logbin_mean(np.append(Emin, Emax[-1]))

        if self.site in ['north', 'lapalma']:
            Emin, Emax, self.sensitivity = np.loadtxt(ds.get(
                'CTA-Performance-prod3b-v1-North-20deg-50h-DiffSens.txt'),
                                                      skiprows=10,
                                                      unpack=True)
            self.E = logbin_mean(np.append(Emin, Emax[-1]))

        return self.E, self.sensitivity
Ejemplo n.º 14
0
    def get_effective_area(self, observation_time=50):
        """
        Return the effective area at the given observation time in hours.
        NB: Only 0.5h supported
        Returns the energy array and the effective area array
        Parameters
        ----------
        observation_time: optional

        Returns
        -------
        `numpy.ndarray`, `numpy.ndarray`
        """
        if self.site == 'south':
            self.E, self.effective_area = np.loadtxt(ds.get('cta_requirements_South-30m-EffectiveArea.dat'),
                                                     unpack=True)
        if self.site == 'north':
            self.E, self.effective_area = np.loadtxt(ds.get('cta_requirements_North-30m-EffectiveArea.dat'),
                                                     unpack=True)

        return self.E, self.effective_area
Ejemplo n.º 15
0
    def get_effective_area(self, observation_time=50):
        """
        Return the effective area at the given observation time in hours.
        NB: Only 0.5h supported
        Returns the energy array and the effective area array
        Parameters
        ----------
        observation_time: optional

        Returns
        -------
        `numpy.ndarray`, `numpy.ndarray`
        """
        if self.site == 'south':
            self.E, self.effective_area = np.loadtxt(
                ds.get('cta_requirements_South-30m-EffectiveArea.dat'),
                unpack=True)
        if self.site == 'north':
            self.E, self.effective_area = np.loadtxt(
                ds.get('cta_requirements_North-30m-EffectiveArea.dat'),
                unpack=True)

        return self.E, self.effective_area
Ejemplo n.º 16
0
    def get_effective_area(self, observation_time=50):
        """
        Return the effective area at the given observation time in hours.
        NB: Only 50h supported
        Returns the energy array and the effective area array
        Parameters
        ----------
        observation_time: optional

        Returns
        -------
        `numpy.ndarray`, `numpy.ndarray`
        """
        if self.site == 'south':
            if observation_time == 50:
                self.E, self.effective_area = np.loadtxt(ds.get(
                    'CTA-Performance-prod3b-v1-South-20deg-50h-EffArea.txt'),
                                                         skiprows=11,
                                                         unpack=True)
            if observation_time == 0.5:
                self.E, self.effective_area = np.loadtxt(ds.get(
                    'CTA-Performance-prod3b-v1-North-20deg-30m-EffArea.txt'),
                                                         skiprows=11,
                                                         unpack=True)

        if self.site == 'north':
            if observation_time == 50:
                self.E, self.effective_area = np.loadtxt(ds.get(
                    'CTA-Performance-prod3b-v1-North-20deg-50h-EffArea.txt'),
                                                         skiprows=11,
                                                         unpack=True)
            if observation_time == 0.5:
                self.E, self.effective_area = np.loadtxt(ds.get(
                    'CTA-Performance-prod3b-v1-North-20deg-30m-EffArea.txt'),
                                                         skiprows=11,
                                                         unpack=True)
        return self.E, self.effective_area
Ejemplo n.º 17
0
def test_get_datasets():
    for file in filelist:
        assert get(file)