Skip to content

Commit

Permalink
remove unused imports, fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
juanep97 committed Nov 21, 2024
1 parent 55a45c1 commit 23432c0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions iop4lib/instruments/dipol.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@
import matplotlib.patheffects
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.stats import sigma_clipped_stats
from photutils.aperture import CircularAperture
from photutils.detection import DAOStarFinder
from astropy.wcs import WCS
from astropy.convolution import convolve
from photutils.segmentation import make_2dgaussian_kernel
from astropy.wcs.utils import fit_wcs_from_points
from astropy.coordinates import Angle, SkyCoord
from astropy.time import Time
import itertools
import datetime
Expand All @@ -34,7 +28,7 @@
from iop4lib.enums import IMGTYPES, BANDS, OBSMODES, SRCTYPES, INSTRUMENTS, REDUCTIONMETHODS
from .instrument import Instrument
from iop4lib.utils import imshow_w_sources, get_angle_from_history, build_wcs_centered_on, get_simbad_sources
from iop4lib.utils.sourcedetection import get_sources_daofind, get_segmentation, get_cat_sources_from_segment_map, get_bkg
from iop4lib.utils.sourcedetection import get_segmentation, get_cat_sources_from_segment_map, get_bkg
from iop4lib.utils.plotting import plot_preview_astrometry
from iop4lib.utils.astrometry import BuildWCSResult
from iop4lib.telescopes import OSNT090
Expand All @@ -46,7 +40,9 @@

import typing
if typing.TYPE_CHECKING:
from iop4lib.db import RawFit, ReducedFit, Epoch
from typing import Union
from iop4lib.db import RawFit, ReducedFit


class DIPOL(Instrument):

Expand Down Expand Up @@ -354,7 +350,7 @@ def get_astrometry_position_hint(cls, rawfit: 'RawFit', allsky=False, n_field_wi
return astrometry.PositionHint(ra_deg=hintcoord.ra.deg, dec_deg=hintcoord.dec.deg, radius_deg=hintsep.to_value(u.deg))

@classmethod
def has_pairs(cls, fit_instance: 'ReducedFit' or 'RawFit') -> bool:
def has_pairs(cls, fit_instance: Union[ReducedFit, RawFit]) -> bool:
""" DIPOL ALWAYS HAS PAIRS """
return True

Expand Down Expand Up @@ -659,7 +655,7 @@ def PolyArea(x,y):

# Compute the hashes of the quads

from iop4lib.utils.quadmatching import hash_ish, distance, order, qorder_ish, find_linear_transformation
from iop4lib.utils.quadmatching import hash_ish, distance, order, qorder_ish
hash_func, qorder = hash_ish, qorder_ish

hashes_1 = np.array([hash_func(quad) for quad in quads_1])
Expand Down

0 comments on commit 23432c0

Please sign in to comment.