Skip to content

Commit

Permalink
Merge branch 'master' into fixsky
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Jan 11, 2024
2 parents 99460d2 + 47411e2 commit d5b1575
Show file tree
Hide file tree
Showing 27 changed files with 1,662 additions and 5,389 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
pip install wheel
pip install .[dev]
# - name: Lint with ruff
# run: |
# pip install ruff
# ruff .
- name: Lint with ruff
run: |
pip install ruff
ruff .
- name: Test with pytest
run: |
Expand Down
14 changes: 6 additions & 8 deletions docs/nb/astro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@
Space Telescope Science Institute
Synopsis:
Synopsis:
Thse are a series of subroutines/utilites that are intended to
be of general use for astronomy applications
Description:
Description:
Notes:
Standards - do not include anything here that is specific to one
project or file format that is not very generic. These routines
should be as bulletproof as possible
History:
090208 ksl Coding begun
120129 ksl Added routines having to do with images
120129 ksl Added routines having to do with images
"""


import math
import os
import sys


# from pyraf import iraf
Expand Down Expand Up @@ -95,13 +93,13 @@ def radec2hms(ra="225.2", dec="-17.35", ra_format="", dec_format=""):
"""

if isinstance(ra, float) == False:
if isinstance(ra, float) is False:
try:
ra = eval(ra)
except TypeError:
ra = float(ra)

if isinstance(dec, float) == False:
if isinstance(dec, float) is False:
try:
dec = eval(dec)
except TypeError:
Expand Down
2 changes: 1 addition & 1 deletion python/lvmdrp/core/apertures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(self, xcenter, ycenter, radius, kmax=1000, grid_fixed=False):
self._xCenter = xcenter
self._yCenter = ycenter
self._radius = radius
if grid_fixed == True:
if grid_fixed is True:
subres = int(numpy.sqrt(kmax))
self._sampeling = numpy.indices((subres, subres)).reshape(
2, subres * subres
Expand Down
2 changes: 1 addition & 1 deletion python/lvmdrp/core/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def register_image(
np.arange(-search_box / 2.0, search_box / 2.0 + step_search, step_search)
+ guess_y
)
angles_off = np.arange(-10, 10, 2)
# angles_off = np.arange(-10, 10, 2)
offsets_xIFU = np.zeros((len(offsets_x), len(offsets_y)))
offsets_yIFU = np.zeros((len(offsets_x), len(offsets_y)))
chisq = np.zeros((len(offsets_x), len(offsets_y)))
Expand Down
14 changes: 7 additions & 7 deletions python/lvmdrp/core/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def loadFitsData(
if self._wave is None:
try:
crpix = self.getHdrValue("CRPIX3") - 1
except:
except KeyError:
crpix = 0
try:
self._wave = (
Expand Down Expand Up @@ -220,7 +220,7 @@ def loadFitsData(
self._dim_x = self._cover.shape[2]
try:
crpix = self.getHdrValue("CRPIX3") - 1
except:
except KeyError:
crpix = 0
try:
self._wave = (
Expand Down Expand Up @@ -393,8 +393,8 @@ def collapseCube(

if self._mask is not None:
data = self._data * numpy.logical_not(self._mask)
if self._error is not None:
error = self._error * numpy.logical_not(self._mask)
# if self._error is not None:
# error = self._error * numpy.logical_not(self._mask)
else:
data = self._data

Expand Down Expand Up @@ -532,8 +532,8 @@ def glueCubeSets(
wave = numpy.arange(wave1[0], wave2[-1] + disp2, disp2)
select1 = wave1 < wave2[0]
select2 = wave2 > wave1[-1]
select_overlap1 = wave1 >= wave2[0]
select_overlap2 = wave2 <= wave1[-1]
# select_overlap1 = wave1 >= wave2[0]
# select_overlap2 = wave2 <= wave1[-1]
else:
raise ValueError("The wavelength ranges do not match with each other")
else:
Expand Down Expand Up @@ -676,7 +676,7 @@ def glueCubeSets(
)
)

if mergeHdr == True:
if mergeHdr is True:
hdrs = [cube1, cube2]
combined_header = combineHdr(hdrs)
self.setHeader(combined_header.getHeader())
Expand Down
Loading

0 comments on commit d5b1575

Please sign in to comment.