Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dl3 reader for LST data #7

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pybkgmodel/camera.py
IevgenVovk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, counts, xedges, yedges, energy_edges, center=None, mask=None,
ny = yedges.size - 1

if mask is None:
mask = numpy.ones((nx, ny), dtype=numpy.bool)
mask = numpy.ones((nx, ny), dtype=bool)

if exposure is None:
exposure = numpy.ones((nx, ny), dtype=numpy.float) * u.s
Expand Down Expand Up @@ -244,7 +244,7 @@ def differential_rate(self, index=None):
Parameters
----------
index: float
Power law spectral index to assume.
Power law spectral index to assume.
If none, will be dynamically determined assuming
a "node function" for the spectral shape.

Expand Down Expand Up @@ -322,14 +322,14 @@ def mask_region(self, region):
dummy_wcs.wcs.crval = [0, -90]
dummy_wcs.wcs.ctype = ["RA---AIR", "DEC--AIR"]
dummy_wcs.wcs.set_pv([(2, 1, 45.0)])

in_region = region.contains(self.pixel_coords, dummy_wcs)
self.mask[in_region] = False

def mask_reset(self):
"""_summary_
"""
self.mask = numpy.ones((self.xedges.size - 1, self.yedges.size - 1), dtype=numpy.bool)
self.mask = numpy.ones((self.xedges.size - 1, self.yedges.size - 1), dtype=bool)


def plot(self, energy_bin_id=0, ax_unit='deg', val_unit='1/s', **kwargs):
Expand Down Expand Up @@ -394,7 +394,7 @@ def get_pixel_areas(self):
for i in range(nx):
for j in range(ny):
area[i, j] = solid_angle_lat_lon_rectangle(self.xedges[i], self.xedges[i+1], self.yedges[j], self.yedges[j+1])

return area

def to_hdu(self, name='BACKGROUND'):
Expand Down
Loading
Loading