From 281f813ee7d127c84663f5e73147035d956991f2 Mon Sep 17 00:00:00 2001 From: AlexKurek Date: Sun, 14 Jul 2024 09:21:05 +0200 Subject: [PATCH] Remove unused modules --- jwst_reffiles/bad_pixel_mask/badpix_from_flats.py | 3 +-- .../bad_pixel_mask/mkref_bad_pixel_mask.py | 5 ----- .../bad_pixel_mask/mkref_badpix_from_flats.py | 5 ----- jwst_reffiles/dark_current/badpix_from_darks.py | 1 - jwst_reffiles/dark_current/mkref_dark.py | 8 -------- jwst_reffiles/example/example_readnoise_module.py | 1 - jwst_reffiles/mkref.py | 8 +------- jwst_reffiles/mkrefs.py | 13 +++---------- jwst_reffiles/pipeline/find_file.py | 3 +-- jwst_reffiles/plugin_wrapper.py | 8 +------- jwst_reffiles/readnoise/mkref_readnoise.py | 8 -------- jwst_reffiles/templates/plugin_template.py | 6 ------ jwst_reffiles/utils/tools.py | 5 ----- 13 files changed, 7 insertions(+), 67 deletions(-) diff --git a/jwst_reffiles/bad_pixel_mask/badpix_from_flats.py b/jwst_reffiles/bad_pixel_mask/badpix_from_flats.py index 22795d3..c8d50c3 100644 --- a/jwst_reffiles/bad_pixel_mask/badpix_from_flats.py +++ b/jwst_reffiles/bad_pixel_mask/badpix_from_flats.py @@ -52,7 +52,6 @@ - astropy - numpy """ -import argparse import copy import numpy as np import os @@ -61,7 +60,7 @@ from astropy.io import fits, ascii from astropy.stats import sigma_clip from scipy.ndimage import median_filter -from jwst.datamodels import dqflags, MaskModel, Level1bModel +from jwst.datamodels import dqflags, MaskModel from jwst.dq_init import DQInitStep from stdatamodels import util diff --git a/jwst_reffiles/bad_pixel_mask/mkref_bad_pixel_mask.py b/jwst_reffiles/bad_pixel_mask/mkref_bad_pixel_mask.py index 30ba553..306e5b6 100755 --- a/jwst_reffiles/bad_pixel_mask/mkref_bad_pixel_mask.py +++ b/jwst_reffiles/bad_pixel_mask/mkref_bad_pixel_mask.py @@ -6,18 +6,13 @@ This class is based on that in the template file: jwst_reffiles/templates/plugin_template.py """ -import argparse import copy import os -import re -import sys -import types from jwst_reffiles.plugin_wrapper import mkrefclass_template from jwst_reffiles.bad_pixel_mask import bad_pixel_mask as bpm from jwst_reffiles.utils.constants import RATE_FILE_SUFFIXES -from jwst_reffiles.utils.definitions import PIPE_STEPS class mkrefclass(mkrefclass_template): diff --git a/jwst_reffiles/bad_pixel_mask/mkref_badpix_from_flats.py b/jwst_reffiles/bad_pixel_mask/mkref_badpix_from_flats.py index be98b15..7929d8d 100755 --- a/jwst_reffiles/bad_pixel_mask/mkref_badpix_from_flats.py +++ b/jwst_reffiles/bad_pixel_mask/mkref_badpix_from_flats.py @@ -6,13 +6,8 @@ This class is based on that in the template file: jwst_reffiles/templates/plugin_template.py ''' - -import argparse import copy import os -import re -import sys -import types from jwst_reffiles.plugin_wrapper import mkrefclass_template diff --git a/jwst_reffiles/dark_current/badpix_from_darks.py b/jwst_reffiles/dark_current/badpix_from_darks.py index 5f5656c..a6e4ae7 100644 --- a/jwst_reffiles/dark_current/badpix_from_darks.py +++ b/jwst_reffiles/dark_current/badpix_from_darks.py @@ -35,7 +35,6 @@ import os from jwst.datamodels import dqflags import numpy as np -from os import path import matplotlib.pyplot as plt from scipy.stats import sigmaclip import matplotlib.cm as cm diff --git a/jwst_reffiles/dark_current/mkref_dark.py b/jwst_reffiles/dark_current/mkref_dark.py index 1ebd75b..5a3148c 100755 --- a/jwst_reffiles/dark_current/mkref_dark.py +++ b/jwst_reffiles/dark_current/mkref_dark.py @@ -7,14 +7,6 @@ This class is based on that in the template file: jwst_reffiles/templates/plugin_template.py """ - -import argparse -import copy -import os -import re -import sys -import types - from jwst_reffiles.plugin_wrapper import mkrefclass_template # import the dark current reference file script diff --git a/jwst_reffiles/example/example_readnoise_module.py b/jwst_reffiles/example/example_readnoise_module.py index 49ed349..faf1554 100644 --- a/jwst_reffiles/example/example_readnoise_module.py +++ b/jwst_reffiles/example/example_readnoise_module.py @@ -13,7 +13,6 @@ We'll also add some unique options in order to explore how to propagate those into the jwst_reffiles world. """ -import os import copy from astropy.io import fits diff --git a/jwst_reffiles/mkref.py b/jwst_reffiles/mkref.py index c609cad..f467de0 100755 --- a/jwst_reffiles/mkref.py +++ b/jwst_reffiles/mkref.py @@ -5,17 +5,11 @@ ''' import argparse -import glob import os import re import sys -import types -import astropy.io.fits as fits -import numpy as np -import scipy - -from jwst_reffiles.utils.tools import astrotableclass,yamlcfgclass +from jwst_reffiles.utils.tools import yamlcfgclass #from jwst_lib.models import RampModel diff --git a/jwst_reffiles/mkrefs.py b/jwst_reffiles/mkrefs.py index 483c1aa..86677c9 100755 --- a/jwst_reffiles/mkrefs.py +++ b/jwst_reffiles/mkrefs.py @@ -5,23 +5,16 @@ ''' import argparse import glob -import os,re,sys,types,copy,random +import os,re,sys,copy,random import logging -from logging import StreamHandler -from logging.handlers import RotatingFileHandler - -import astropy.io.fits as fits -from astropy.io import ascii -import astropy import numpy as np -import scipy from jwst_reffiles.plugin_wrapper import mkrefclass_template from jwst_reffiles.pipeline.calib_prep import CalibPrep from jwst_reffiles.pipeline import pipeline_steps -from jwst_reffiles.utils.logging_functions import configure_logging, log_info, log_fail, make_log_file +from jwst_reffiles.utils.logging_functions import configure_logging, log_info, log_fail from jwst_reffiles.utils.tools import astrotableclass, yamlcfgclass -from jwst_reffiles.utils.tools import makepath, executecommand, append2file, rmfile +from jwst_reffiles.utils.tools import makepath, executecommand, rmfile # get the root dir of the code. This is needed only if the scripts are not installed as a module! #if 'JWST_MKREFS_SRCDIR' in os.environ: diff --git a/jwst_reffiles/pipeline/find_file.py b/jwst_reffiles/pipeline/find_file.py index 8392157..f301683 100755 --- a/jwst_reffiles/pipeline/find_file.py +++ b/jwst_reffiles/pipeline/find_file.py @@ -18,8 +18,7 @@ Version 0.0 - 20 Jan 2017 - BNH ''' -import os,sys -import argparse +import os from collections import OrderedDict import fnmatch from glob import glob diff --git a/jwst_reffiles/plugin_wrapper.py b/jwst_reffiles/plugin_wrapper.py index b336d34..a880aae 100755 --- a/jwst_reffiles/plugin_wrapper.py +++ b/jwst_reffiles/plugin_wrapper.py @@ -9,17 +9,11 @@ ''' import argparse -import glob import os -import re -import sys -import types from astropy.io import ascii -import astropy.io.fits as fits -import numpy as np -from jwst_reffiles.utils.tools import astrotableclass, yamlcfgclass +from jwst_reffiles.utils.tools import yamlcfgclass class mkrefclass_template: diff --git a/jwst_reffiles/readnoise/mkref_readnoise.py b/jwst_reffiles/readnoise/mkref_readnoise.py index 1971033..37cc869 100755 --- a/jwst_reffiles/readnoise/mkref_readnoise.py +++ b/jwst_reffiles/readnoise/mkref_readnoise.py @@ -7,14 +7,6 @@ This class is based on that in the template file: jwst_reffiles/templates/plugin_template.py """ - -import argparse -import copy -import os -import re -import sys -import types - from jwst_reffiles.plugin_wrapper import mkrefclass_template # import the readnoise script diff --git a/jwst_reffiles/templates/plugin_template.py b/jwst_reffiles/templates/plugin_template.py index 2df8227..59d9d01 100644 --- a/jwst_reffiles/templates/plugin_template.py +++ b/jwst_reffiles/templates/plugin_template.py @@ -73,12 +73,6 @@ Any additional parameters (as defined in the config file and/or on the command line) will be available in the self.parameters dictionary. """ -import argparse -import os -import re -import sys -import types - from jwst_reffiles.plugin_wrapper import mkrefclass_template # import your script! diff --git a/jwst_reffiles/utils/tools.py b/jwst_reffiles/utils/tools.py index 5c2945c..12099b9 100644 --- a/jwst_reffiles/utils/tools.py +++ b/jwst_reffiles/utils/tools.py @@ -7,8 +7,6 @@ import os,io import re -import sys -import types import subprocess #import pytz @@ -17,9 +15,6 @@ from astropy.time import Time from datetime import datetime import astropy.io.fits as fits -import numpy as np -from numpy import recarray -import numpy.lib.recfunctions as nprecf import yaml