Skip to content

Commit

Permalink
Update FullDetectorResponse.py
Browse files Browse the repository at this point in the history
  • Loading branch information
GallegoSav authored Jan 6, 2025
1 parent 3408ef9 commit 9a364ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cosipy/response/FullDetectorResponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def _open_rsp(cls, filename, Spectrumfile=None,norm="Linear" ,single_pixel = Fal
nlines = sum(1 for _ in gzip.open(filename,"rt"))

# Preallocate arrays
coords = np.empty([axes.ndim, nlines], dtype=np.int16)
data = np.empty(nlines, dtype=np.int16)
coords = np.empty([axes.ndim, nlines], dtype=np.uint32)
data = np.empty(nlines, dtype=np.uint32)

Check warning on line 320 in cosipy/response/FullDetectorResponse.py

View check run for this annotation

Codecov / codecov/patch

cosipy/response/FullDetectorResponse.py#L319-L320

Added lines #L319 - L320 were not covered by tests

# Calculate the memory usage in Gigabytes
memory_size = ((nlines * data.itemsize)+(axes.ndim*nlines*coords.itemsize))/(1024*1024*1024)
Expand All @@ -329,7 +329,7 @@ def _open_rsp(cls, filename, Spectrumfile=None,norm="Linear" ,single_pixel = Fal
nlines = nbins

# Preallocate arrays
data = np.empty(nlines, dtype=np.int16)
data = np.empty(nlines, dtype=np.uint32)

Check warning on line 332 in cosipy/response/FullDetectorResponse.py

View check run for this annotation

Codecov / codecov/patch

cosipy/response/FullDetectorResponse.py#L332

Added line #L332 was not covered by tests

# Calculate the memory usage in Gigabytes
memory_size = (nlines * data.itemsize)/(1024*1024*1024)
Expand Down Expand Up @@ -361,7 +361,7 @@ def _open_rsp(cls, filename, Spectrumfile=None,norm="Linear" ,single_pixel = Fal

if key == 'RD':

b = np.array(line[1:-1], dtype=np.int16)
b = np.array(line[1:-1], dtype=np.uint32)

Check warning on line 364 in cosipy/response/FullDetectorResponse.py

View check run for this annotation

Codecov / codecov/patch

cosipy/response/FullDetectorResponse.py#L364

Added line #L364 was not covered by tests
c = int(line[-1])

coords[:, sbin] = b
Expand Down

0 comments on commit 9a364ac

Please sign in to comment.