repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
drizzlepac | drizzlepac-master/drizzlepac/outputimage.py | """
This module manages the creation of the output image FITS file.
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import time
from astropy.io import fits
from stsci.tools import fileutil, logutil
from . import wcs_functions
from . import __version__
from . import updatehdr
from fitsblender import blendheaders... | 35,363 | 39.648276 | 155 | py |
drizzlepac | drizzlepac-master/drizzlepac/findobj.py | """
A suite of functions for finding sources in images.
:Authors: Warren Hack, Mihai Cara
:License: :doc:`LICENSE`
"""
import sys
import math
import numpy as np
from scipy import ndimage
import stsci.imagestats as imagestats
from . import cdriz
__all__ = ['gaussian1', 'gausspars', 'gaussian', 'moments', 'errfunc... | 16,376 | 30.373563 | 96 | py |
drizzlepac | drizzlepac-master/drizzlepac/irData.py | """
Class used to model IR specific instrument data.
:Authors: Christopher Hanley
:License: :doc:`LICENSE`
"""
from .imageObject import imageObject
class IRInputImage(imageObject):
"""
IRInputImage
------------
The IRInputImage class is the parent class for all of
the IR based instrument class... | 1,458 | 23.728814 | 83 | py |
drizzlepac | drizzlepac-master/drizzlepac/wfc3Data.py | """
``wfc3Data`` module provides classes used to import WFC3 specific instrument data.
:Authors: Megan Sosey, Christopher Hanley
:License: :doc:`LICENSE`
"""
from stsci.tools import fileutil
from .imageObject import imageObject
import numpy as np
class WFC3InputImage(imageObject):
SEPARATOR = '_'
def __in... | 12,511 | 39.102564 | 96 | py |
drizzlepac | drizzlepac-master/drizzlepac/run_hapsequencer.py | import os
import sys
from drizzlepac import hapsequencer
from drizzlepac.devutils.confirm_execution import confirm_execution
#----------------------------------------------------------------------------------------------------------------
if __name__ == '__main__':
print("Current working directory: "+os.getcwd())
... | 664 | 38.117647 | 125 | py |
drizzlepac | drizzlepac-master/drizzlepac/pixreplace.py | """ Pixreplace -- Replace pixels which have one value with another value
:License: :doc:`LICENSE`
"""
import os
import numpy as np
from astropy.io import fits
from stsci.tools import parseinput
from . import util
__all__ = ['replace', 'help', 'getHelpAsString']
__taskname__ = 'pixreplace'
def replace(inpu... | 3,759 | 27.70229 | 98 | py |
drizzlepac | drizzlepac-master/drizzlepac/imageObject.py | """
A class which makes image objects for each input filename.
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import copy, os, re, sys
import numpy as np
from stwcs import distortion
from stsci.tools import fileutil, logutil, textutil
from astropy.io import fits
from . import util
from . import wcs_functions
f... | 49,788 | 39.055511 | 169 | py |
drizzlepac | drizzlepac-master/drizzlepac/config_testbed.py | import pdb
import os
import json
from stsci.tools import teal
# __taskname__ = 'config_testbed'
#
# configobj = teal.load(__taskname__)
inst_det = "acs_wfc"
code_dir = os.path.abspath(__file__)
base_dir = os.path.dirname(os.path.dirname(code_dir))
pars_dir = os.path.join(base_dir,"drizzlepac","pars")
cfg_index_fileanm... | 679 | 24.185185 | 80 | py |
drizzlepac | drizzlepac-master/drizzlepac/util.py | #!/usr/bin/env python
"""
A library of utility functions
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import logging
import functools
import os
import sys
import string
import errno
import platform
import numpy as np
import astropy
from astropy.io import fits
from stsci.tools import fileutil, teal, cfgpars,... | 41,364 | 31.673776 | 146 | py |
drizzlepac | drizzlepac-master/drizzlepac/refimagefindpars.py | """
:Authors: Warren Hack, Mihai Cara
:License: :doc:`LICENSE`
"""
import os
from stsci.tools import teal
from . import util
from . import __version__
__taskname__ = 'refimagefindpars'
__doc__ = util._def_help_functions(
locals(), module_file=__file__, task_name=__taskname__, module_doc=__doc__
)
| 308 | 15.263158 | 78 | py |
drizzlepac | drizzlepac-master/drizzlepac/buildmask.py | """
Functions to build mask files for PyDrizzle.
- buildMaskImage(rootname,bitvalue,extname='DQ',extver=None):
This function takes the DQ array(or array from extension given)
and builds a bit mask as an input weighting mask for 'drizzle'.
- buildShadowMaskImage(rootname,detnum,replace=no):
... | 11,023 | 33.45 | 108 | py |
drizzlepac | drizzlepac-master/drizzlepac/adrizzle.py | """
Interfaces to main drizzle functions.
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import os
import copy
import time
import platform
from . import util
import numpy as np
from astropy.io import fits
from stsci.tools import fileutil, logutil, mputil, teal
from . import outputimage, wcs_functions
import stwc... | 44,603 | 37.090521 | 129 | py |
drizzlepac | drizzlepac-master/drizzlepac/pixtosky.py | """ pixtosky - A module to perform coordinate transformation from pixel to sky coordinates.
:Authors: Warren Hack
:License: :doc:`LICENSE`
PARAMETERS
----------
input : str
full filename with path of input image, an extension name ['sci',1] should be
provided if input is a multi-e... | 7,500 | 34.719048 | 99 | py |
drizzlepac | drizzlepac-master/drizzlepac/runastrodriz.py | #!/usr/bin/env python
""" runastrodriz.py - Module to control operation of astrodrizzle to
remove distortion and combine HST images in the pipeline.
:License: :doc:`LICENSE`
USAGE: runastrodriz.py [-bdahfginv] inputFilename [newpath]
Alternative USAGE:
python
from acstools import runastrodriz
ru... | 96,640 | 43.14847 | 137 | py |
drizzlepac | drizzlepac-master/drizzlepac/stisData.py | """
``stisData`` module provides classes used to import STIS specific instrument
data.
:Authors: Megan Sosey, Christopher Hanley, Mihai Cara
:License: :doc:`LICENSE`
"""
from stsci.tools import fileutil
import numpy as np
from .imageObject import imageObject
class STISInputImage (imageObject):
SEPARATOR = '_'... | 16,945 | 35.286938 | 142 | py |
drizzlepac | drizzlepac-master/drizzlepac/ablot.py | """
In this step the median image now gets blotted back to create median-cleaned
images which can be compared directly with each input image to identify
cosmic-rays.
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import os
import sys
import numpy as np
from stsci.tools import fileutil, teal, logutil
from . impor... | 15,364 | 35.152941 | 104 | py |
drizzlepac | drizzlepac-master/drizzlepac/__init__.py | """ DrizzlePac - Python tasks to 'dither' combine images
This package provides the tools to align, manage and combine images using
algorithms originally developed as part of IRAF's 'dither' package. Tasks
supported by this package include:
* astrodrizzle
* tweakreg
* resetbits
* updatenpol
* pixtosky, skytop... | 5,260 | 39.782946 | 190 | py |
drizzlepac | drizzlepac-master/drizzlepac/regfilter.py | """
`regfilter` provides functions for filtering out regions outside the image space.
:Authors: Mihai Cara
:License: :doc:`LICENSE`
"""
__author__ = 'Mihai Cara'
def fast_filter_outer_regions(reglist, width, height, origin=1):
# fast_filter_outer_regions filters regions that are outside a rectangle
# ('ima... | 4,146 | 29.270073 | 81 | py |
drizzlepac | drizzlepac-master/drizzlepac/make_cfgobj_files.py | from configobj import ConfigObj
from validate import Validator
import os
param_dict = {
"ACS HRC": {
"astrodrizzle": {
"SCALE": 0.025,
"PIXFRAC": 1.0,
"KERNEL": "square",
"OUTNX": None,
"OUTNY": None,
"ROT": 0.0,
"BITS": 25... | 8,695 | 36.973799 | 179 | py |
drizzlepac | drizzlepac-master/drizzlepac/hapmultisequencer.py | #!/usr/bin/env python
""" This script defines the HST Advanced Products (HAP) Multi-visit (MVM) generation
portion of the calibration pipeline. This portion of the pipeline produces mosaic
products. This script provides similar functionality as compared to the Hubble
Legacy Archive (HLA) pipeline in that ... | 32,016 | 50.557166 | 171 | py |
drizzlepac | drizzlepac-master/drizzlepac/sky.py | #!/usr/bin/env python
"""
This step measures, subtracts and/or equalizes the sky from each
input image while recording the subtracted value in the image header.
:Authors:
Christopher Hanley, Megan Sosey, Mihai Cara
:License: :doc:`LICENSE`
"""
import os, sys
import numpy as np
from stsci.tools import fileutil,... | 32,711 | 38.270108 | 106 | py |
drizzlepac | drizzlepac-master/drizzlepac/wcs_functions.py | """
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
from astropy.io import fits as pyfits
import copy
import numpy as np
from numpy import linalg
from stsci.tools import fileutil, logutil
from . import util
from astropy import wcs
from stwcs import wcsutil
from stwcs.distortion import coeff_converter, utils
fro... | 39,871 | 32.421626 | 102 | py |
drizzlepac | drizzlepac-master/drizzlepac/hapsequencer.py | #!/usr/bin/env python
""" This script defines the HST Advanced Products (HAP) generation portion of the
calibration pipeline. This portion of the pipeline produces mosaic and catalog
products. This script provides similar functionality as compared to the Hubble
Legacy Archive (HLA) pipeline in that it act... | 74,411 | 49.176669 | 192 | py |
drizzlepac | drizzlepac-master/drizzlepac/processInput.py | """
Process input to MultiDrizzle/PyDrizzle.
:Authors: Warren Hack
:License: :doc:`LICENSE`
The input can be one of:
* a python list of files
* a comma separated string of filenames (including wild card characters)
* an association table
* an @file (can have a second column with names of ivm files)
... | 46,698 | 36.69088 | 119 | py |
drizzlepac | drizzlepac-master/drizzlepac/pixtopix.py | """ pixtopix - A module to perform coordinate transformation from pixel
coordinates in one image to pixel coordinates in another frame
:Authors: Warren Hack
:License: :doc:`LICENSE`
PARAMETERS
----------
inimage : str
full filename with path of input image, an extension name ``['sci',... | 7,930 | 33.938326 | 82 | py |
drizzlepac | drizzlepac-master/drizzlepac/mdzhandler.py | """
This module supports the interpretation of the ``MDRIZTAB`` for
processing as used in the pipeline.
:Authors: Warren Hack, Ivo Busko, Christopher Hanley
:License: :doc:`LICENSE`
"""
import string, os
from astropy.io import fits
import numpy as np
from stsci.tools import fileutil
def getMdriztabParameters(file... | 6,090 | 30.723958 | 91 | py |
drizzlepac | drizzlepac-master/drizzlepac/resetbits.py | #!/usr/bin/env python
"""
resetbits - A module to set the value of specified array pixels to zero
This module allows a user to reset the pixel values of any integer array,
such as the DQ array from an HST image, to zero.
:Authors: Warren Hack
:License: :doc:`LICENSE`
PARAMETERS
----------
filename : str
full f... | 5,615 | 27.653061 | 92 | py |
drizzlepac | drizzlepac-master/drizzlepac/minmed.py | """
Create an image combination algroithm that chooses between a minimum
or median image based up bad pixel identification.
:Authors: Christopher Hanley
:License: :doc:`LICENSE`
"""
# PROGRAM: numcombine.py
# AUTHOR: Christopher Hanley (based upon original code of Anton Koekemoer)
# DATE: February 11, 2004
... | 30,075 | 46.438486 | 127 | py |
drizzlepac | drizzlepac-master/drizzlepac/nicmosData.py | """
Class used to model NICMOS specific instrument data.
:Authors: Christopher Hanley, David Grumm, Megan Sosey
:License: :doc:`LICENSE`
"""
import numpy as np
from stsci.tools import fileutil
from .imageObject import imageObject
class NICMOSInputImage(imageObject):
SEPARATOR = '_'
def __init__(self, f... | 16,970 | 34.803797 | 146 | py |
drizzlepac | drizzlepac-master/drizzlepac/drizCR.py | """
Mask blemishes in dithered data by comparison of an image with a model
image and the derivative of the model image.
:Authors: Warren Hack
:License: :doc:`LICENSE`
"""
import os
import re
import numpy as np
from scipy import signal
from astropy.io import fits
from stsci.tools import fileutil, logutil, mputil, te... | 13,122 | 36.601719 | 79 | py |
drizzlepac | drizzlepac-master/drizzlepac/linearfit.py | """
##################
# DEVELOPMENT NOTE:
#
# This code needs to be refactored into a class for computing
# and applying the fit.
#
##################
:Authors: Warren Hack, Mihai Cara
:License: :doc:`LICENSE`
"""
import numpy as np
from numpy import linalg as npla
from stsci.tools imp... | 16,742 | 28.951699 | 89 | py |
drizzlepac | drizzlepac-master/drizzlepac/tweakback.py | """
``tweakback`` - propagate the "tweaked" solutions back to the original
input files.
Version 0.4.0 - replaced previous algorithm that used fitting of WCS
footprints to reconstruct the transformation that was applied to the
old drizzled image (to align it with another image) to obtain the new
drizzled image WCS with... | 35,298 | 38.00442 | 99 | py |
drizzlepac | drizzlepac-master/drizzlepac/hapcatalog.py | #!/usr/bin/env python
import argparse
import datetime
import os
import sys
from stsci.tools import logutil
from drizzlepac import util
from drizzlepac.devutils.confirm_execution import confirm_execution
from drizzlepac import hapsequencer
from drizzlepac.haputils import config_utils
from drizzlepac.haputils import p... | 2,903 | 40.485714 | 269 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/test_hla_flag_filter.py | #!/usr/bin/env python
"""script to run hla_flag_filter and compare_sourcelists to test hla_flag_filter parameter updates"""
import argparse
from datetime import datetime
import glob
import json
import logging
import os
import pdb
import pickle
import shutil
import sys
from stsci.tools import logutil
from drizzlepac i... | 16,619 | 50.138462 | 190 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/hap_pars_attendance_checker.py | #!/usr/bin/env python
"""This script checks to make sure all necessary HAP json parameter files are present"""
import glob
import os
from pathlib import Path
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def attendance_checker(base_pars_path):
... | 3,263 | 40.316456 | 119 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/json_splitter.py | #!/usr/bin/env python
"""searches through hap_pars subdirectory tree and splits the json file 'default_values' dictinary into one
file, and the 'parameter_values' into another."""
import json
import glob
import os
from pathlib import Path
import pdb
# build hap_path full path and recursivly find all .json pars files
... | 2,161 | 35.644068 | 107 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/fix_json_files.py | #!/usr/bin/env python
"""This script removes the 'input' and 'output' fields and sets the 'build' and
['STATE OF INPUT FILES']['clean'] fields to 'True' in all astrodrizzle parameter .json files."""
import json
import glob
from pathlib import Path
code_dir = os.path.abspath(__file__)
base_dir = os.path.dirname(os.pa... | 1,720 | 38.113636 | 111 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/plot_ci_vs_fwhm.py | #!/usr/bin/env python
import argparse
import pdb
from astropy.stats import sigma_clipped_stats
from astropy.table import Table, vstack
import matplotlib.pyplot as plt
import numpy as np
from drizzlepac.devutils.comparison_tools import compare_sourcelists
from drizzlepac.haputils.diagnostic_utils import read_json_file... | 5,379 | 41.698413 | 135 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/generate_ttim_psfs.py | import pexpect
import os
import sys
import re
import time
acs_filter_dict = {'WFC': ['f435w', 'f475w', 'f555w', 'f606w', 'f625w',
'f775w', 'f814w', 'f850lp', 'f550m',
'f502n', 'f658n', 'f660n', 'f892n'],
'HRC': ['f220w', 'f250w', 'f330w', 'f435w', '... | 12,279 | 34.085714 | 104 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/hla2ecsv.py | #!/usr/bin/env python
import sys
from astropy.table import Table
import numpy as np
infilename = sys.argv[1]
outfilename = infilename.replace(".txt",".ecsv")
source_cat = Table.read(infilename, format='ascii')
source_cat.write(outfilename, format="ascii.ecsv")
| 265 | 19.461538 | 51 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/analyze_mvm_gaia_alignment.py | #!/usr/bin/env python
"""Statistically quantify how well MVM products are aligned to GAIA sources found in the image footprint
defined by the SVM-processed fl(c/t).fits input files. Statistics are reported on the differences in X, Y and
RA, Dec positions of GAIA sources compared to positions of matching point-sources ... | 25,844 | 51.961066 | 124 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/validate_hla_flag_filter.py | #!/usr/bin/env python
"""script to run hla_flag_filter and compare_sourcelists to test hla_flag_filter parameter updates"""
import argparse
from datetime import datetime
import glob
import json
import logging
import os
import pdb
import pickle
import shutil
import sys
from stsci.tools import logutil
from drizzlepac i... | 16,623 | 50.150769 | 190 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/disp_sources_by_flag.py | #!/usr/bin/env python
"""
This script breaks down the flag values in the specified sourcelist by flag bit value and plots source locations by
bit value
NOTE: This script requires the "pyds9" library.
"""
import sys
# import pdb
from astropy.io import fits as fits
from astropy.table import Table
import numpy as np
impo... | 5,943 | 30.786096 | 121 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/search_skyframes.py | #!/usr/bin/env python
""" This script allows users to query a master observations .csv file by any combination of exposure name,
skycell name, instrument/detector, and/or filter name. The results are printed the screen and optionally
written to a user-specified output .csv file. The results will be sorted firs... | 21,065 | 49.517986 | 177 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/sourcelist_flag_breakdown.py | #!/usr/bin/env python
"""
This script simply breaks down the flagging by bit value for a user-specified sourcelist.
"""
import sys
from astropy.table import Table
import numpy as np
bit_list = [0, 1, 2, 4, 8, 16, 32, 64, 128]
flag_meanings = ['Point Source', 'Extended Source', 'Single-Pixel Saturation', 'Multi-Pixel S... | 2,120 | 34.35 | 125 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/reset_flags.py | #!/usr/bin/env python
import fileinput
import pdb
import sys
"""Simple little script to reset source flags in the last column of HLA classic and HAP sorucelists to zero"""
for line in fileinput.input(sys.argv[1], inplace=True):
if sys.argv[1].endswith("daophot.txt"):
if not line.startswith("X-Center") an... | 756 | 29.28 | 110 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/alignment_viewer.py | """Viewer for aligned datasets
This code can be used to summarize a set of results after running runastrodriz.
The results will be a multi-page PDF document with a title page that summarizes
the number of tests found along with stats on the number of various types of
WCS solutions in the final drizzle products. A sep... | 12,401 | 41.472603 | 152 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/__init__.py | 0 | 0 | 0 | py | |
drizzlepac | drizzlepac-master/drizzlepac/devutils/pars_utils.py | import os
import drizzlepac
from stsci.tools import teal
import json
def cfg2json(cfgfilename, outpath=None):
"""Convert config files to json format
Parameters
----------
cfgfilename : str
Input .cfg file to be converted to json format.
outpath : str, optional
Destination path of ... | 4,655 | 32.73913 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/make_hla_classic_region_file.py | #!/usr/bin/env python
import sys
from astropy.table import Table
import numpy as np
infilename = sys.argv[1]
outfilename = infilename.replace(".txt",".reg")
source_cat = Table.read(infilename, format='ascii')
out_table = source_cat.copy()
# Remove all other columns besides 'X-Center and Y-Center
out_table.keep_c... | 685 | 27.583333 | 93 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/confirm_execution.py | #!/usr/bin/env python
import random
import string
import sys
def confirm_execution():
"""
This subroutine prevents accidental execution by requiring the user to type in a randomly generated 4-character
confirmation string. If the string is typed in incorrectly, the script will simply exit to the command lin... | 706 | 38.277778 | 115 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/starmatch_hist.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
A set of routines used in matching sources by offset histograms
Path
----
HLApipeline/regression_testing/starmatch_hist.py
Dependencies
------------
* HLApipeline/regression_testing/infrot.py
Inputs
------
None.
Classes and Functio... | 35,401 | 39.459429 | 333 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/interdetector_sourcelist_crossmatch.py | #!/usr/bin/env python
"""perform interdetector sourcelist crossmatch. This can be either HAP vs. HAP or HAP vs. HLA or
HLA vs. HLA."""
import argparse
import os
import sys
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.stats import sigma_clipped_stats
import numpy as np
from driz... | 16,132 | 50.708333 | 225 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/compare_sourcelist_flagging.py | #!/usr/bin/env python
"""
This script allows the user to compare the flagging in two filter sourcelists on a bit-by-bit basis. It breaks down
the flag values in the specified sourcelists by flag bit value and plots source locations by bit value
NOTE: This script requires the "pyds9" library.
"""
import argparse
import... | 10,033 | 40.808333 | 282 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/run_regression_test.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
This script automates the execution of regression_testing/compare_images.py and
regression_testing/compare_sourcelists.py.
* compare_images compares all images common to both user-specified input paths.
* compare_sourcelists compares... | 7,455 | 43.915663 | 284 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/compare_images.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
This script compares images with the same name in two user-specified paths and displays various measures of their
differences.
The following items are inspected:
- File structure (Number of FITS extensions, extension names, imag... | 15,088 | 41.866477 | 232 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/compare_sourcelists.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""This script compares sources common to two user-specified sourcelists and displays various measures of their
differences. The differences can be calculated using one of three user-selectable methods:
* Absolute: Just a simple differenc... | 101,635 | 54.327164 | 473 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/infrot.py | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
Functions to compute and apply infinitesimal rotations to correct small shifts
and rotations in spherical coordinates
Uses formulae from `Budavari & Lubow (2012, ApJ, 761, 188) <http://adsabs.harvard.edu/abs/2012ApJ...761..188B>`_
Created by R. White from... | 9,390 | 30.199336 | 148 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/__init__.py | 0 | 0 | 0 | py | |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/integrate_read_hla_catalog.py | #!/usr/bin/env python
import os
import pdb
import sys
from astropy.table import Table
import numpy as np
from drizzlepac import hapsequencer
from drizzlepac.haputils import hla_flag_filter
from drizzlepac.devutils.comparison_tools import compare_sourcelists
from drizzlepac.devutils.comparison_tools.read_hla import read... | 5,481 | 46.258621 | 187 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/read_hla/read_hla_catalog.py | """read_hla_catalog.py: read an HLA catalog (from a file or from HLA webservice) and correct astrometry
R. White, 2019 June 12
"""
import sys
from drizzlepac.devutils.comparison_tools.read_hla import omegaxyz
from astropy.table import Table
from stsci.tools import logutil
__taskname__ = 'read_hla_catalog'
MSG_DATEFM... | 5,739 | 35.56051 | 124 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/read_hla/read_hla_image.py | """read_hla_image.py: read an HLA image (from a file or from HLA webservice) and correct WCS
R. White, 2019 June 20
"""
import os
from astropy.io import fits
from drizzlepac.devutils.comparison_tools.read_hla import omegaxyz
def read_hla_image(dataset, applyomega=True, verbose=False, url="https://hla.stsci.edu/cgi-b... | 3,367 | 32.019608 | 109 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/read_hla/omegaxyz.py | """Functions to get and apply HSC infinitesimal rotations to correct small shifts and rotations in spherical coordinates
Uses formulae from `Budavari & Lubow (2012, ApJ, 761, 188) <http://adsabs.harvard.edu/abs/2012ApJ...761..188B>`_
vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
2019 June 12, Rick White
"... | 17,587 | 30.633094 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/read_hla/__init__.py | 0 | 0 | 0 | py | |
drizzlepac | drizzlepac-master/drizzlepac/devutils/comparison_tools/read_hla/hla_test.py | # write image and catalogs with and without WCS correction
from drizzlepac.devutils.comparison_tools.read_hla.read_hla_catalog import read_hla_catalog
from drizzlepac.devutils.comparison_tools.read_hla.read_hla_image import write_hla_image
if __name__ == "__main__":
dataset = 'hst_10265_01_acs_wfc_f606w'
catt... | 1,626 | 42.972973 | 91 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/_detection_utils.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements common utility functions and classes for the star
finders. This is a copy of photutils private functions, which have been
refactored. Use of these tools can likely be removed after drizzlepac
requires photutils >= 1.2.0.
"""
imp... | 22,026 | 32.992284 | 147 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/poller_utils.py | """Utilities to interpret the pipeline poller obset information and generate product filenames
The function, interpret_obset_input, parses the file generated by the pipeline
poller, and produces a tree listing of the output products. The function,
parse_obset_tree, converts the tree into product catagories.
"""
from... | 60,505 | 45.686728 | 229 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/pipeline_graphics.py | """Module for generating Q&A plots for pipeline processed data"""
import argparse
import os
import sys
from bokeh.layouts import row, column
from bokeh.plotting import figure, output_file, save
from bokeh.models import ColumnDataSource, Label, Range1d, Paragraph
import numpy as np
from stsci.tools import logutil
f... | 19,209 | 37.729839 | 118 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/mvm_quality_analysis.py | """Code that evaluates the quality of the MVM products generated by the drizzlepac package.
This module is ONLY for generating the output JSON information. Visualization is
done by mvm_quality_graphics.py.
The JSON files generated here can be converted directly into a Pandas DataFrame
using the syntax:
>>> import j... | 59,328 | 52.353417 | 222 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/read_hla_catalog.py | """read_hla_catalog.py: read an HLA catalog (from a file or from HLA webservice) and correct astrometry
R. White, 2019 June 12
"""
import sys
from drizzlepac.haputils import omegaxyz
from astropy.table import Table
from stsci.tools import logutil
__taskname__ = 'read_hla_catalog'
MSG_DATEFMT = '%Y%j%H%M%S'
SPLUNK_MS... | 5,713 | 35.394904 | 124 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/which_skycell.py | #!/usr/bin/env python
"""Reports the name(s) of the projection cell(s)/skycell(s) that the observations in the user-specified input
file occupy.
USAGE:
>>> python drizzlepac/haputils/which_skycell.py -[i]
- The '-i' optional input allows users to specify the name of a file containing a list of calibrated fits... | 2,776 | 37.041096 | 110 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/processing_utils.py | """Utilities to support creation of Hubble Advanced Pipeline(HAP) products.
"""
import sys
import os
import shutil
import numpy as np
from astropy.io import fits as fits
from astropy.io.fits import Column
from astropy.time import Time
from stsci.tools import logutil
from stsci.tools.fileutil import countExtn
from st... | 19,202 | 33.85118 | 111 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/svm_quality_analysis.py | """Code that evaluates the quality of the SVM products generated by the drizzlepac package.
The JSON files generated here can be converted directly into a Pandas DataFrame
using the syntax:
>>> import json
>>> import pandas as pd
>>> with open("<rootname>_astrometry_resids.json") as jfile:
>>> resids = json.load(... | 127,867 | 55.578761 | 265 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/qa_harvest.py | import glob
import json
import os
import pandas as pd
import pdb
import sys
def make_dataset_df(dirname, pattern='*_photometry.json'):
"""Convert dir full of JSON files into a DataFrame"""
jpatt = os.path.join(dirname, pattern)
hdr = None
pdtabs = []
print(sorted(glob.glob(jpatt)))
for jfilena... | 1,810 | 27.746032 | 87 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/starmatch_hist.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
A set of routines used in matching sources by offset histograms
Path
----
HLApipeline/regression_testing/starmatch_hist.py
Dependencies
------------
* HLApipeline/regression_testing/infrot.py
Inputs
------
None.
Classes and Functio... | 35,384 | 39.44 | 333 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/constants.py | """Module which holds constant values to be shared between modules
"""
# Indicator for missing data for data that could not be computed
# or measured.
FLAG = -9999.0
# Absolute tolerance for "isclose" with regard to how close the photflam
# value is to zero.
TOLERANCE = 1.0e-22
| 282 | 24.727273 | 73 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/pandas_utils.py | """ Definition of PandasDFReader class for reading the SVM harvester file.
This class is responsible for reading the SVM "harvester file" which
contains a Pandas dataframe stored in an HDF5 file. The harvester file
is the collection of JSON output generated by the SVM quality analysis
tests.
"""
impo... | 8,825 | 37.881057 | 122 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/config_utils.py | #!/usr/bin/env python
"""This script contains code to create the complete set of configuration parameters required to run hapsequencer.py
given the specified observation conditions and instrument/detector used in the observations"""
import collections
import json
import os
import sys
from astropy.time import Time
fr... | 33,224 | 46.12766 | 165 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/align_utils.py | import os
import datetime
import copy
import sys
import traceback
import warnings
from packaging.version import Version
from collections import OrderedDict
import numpy as np
from scipy import ndimage
from scipy.signal import fftconvolve
import astropy
from astropy.io import fits
from astropy.table import Table
from... | 69,680 | 43.638693 | 127 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/svm_quality_graphics.py | """Code that evaluates the quality of the SVM products generated by the drizzlepac package.
The JSON files generated here can be converted directly into a Pandas DataFrame
using the syntax:
>>> import json
>>> import pandas as pd
>>> with open("<rootname>_astrometry_resids.json") as jfile:
>>> resids = json.load(... | 75,430 | 44.882603 | 183 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/deconvolve_utils.py | """This script contains code to support creation of photometric sourcelists using two techniques:
aperture photometry and segmentation-map based photometry."""
import os
import sys
import shutil
import warnings
import numpy as np
import skimage
from astropy.io import fits as fits
from photutils.detection import Sta... | 38,093 | 36.791667 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/generate_custom_svm_mvm_param_file.py | #!/usr/bin/env python
""" generate_custom_mvm_svm_param_file - a module to create a template SVM/MVM processing pipeline parameter
file based on the observations present in the current working directory for the user to customize
Command-line USAGE:
>>> python generate_custom_svm_mvm_param_file.py [-clop] poller_fi... | 11,926 | 58.338308 | 148 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/ci_table.py | """
return CI limits as a function of detector and filter using table
Dependencies
------------
ci_ap_cor_table_ap_20_2016.txt
"""
import os
import sys
from stsci.tools import logutil
__taskname__ = 'ci_table'
MSG_DATEFMT = '%Y%j%H%M%S'
SPLUNK_MSG_FORMAT = '%(asctime)s %(levelname)s src=%(name)s- %(message)s'
l... | 8,204 | 32.904959 | 116 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/mvm_quality_graphics.py | """Code that evaluates the quality of the MVM products generated by the drizzlepac package.
Visualization of these Pandas DataFrames with Bokeh can follow the example
from:
https://programminghistorian.org/en/lessons/visualizing-with-bokeh
PUBLIC INTERFACE FOR THIS MODULE
- build_mvm_plots(HDF5_FILE, output_basenam... | 51,386 | 47.661932 | 210 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/hla_flag_filter.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""Identify and flag sources as either stellar sources, extended sources or anomalous sources
Anomalous sources fall into several categories:
- Saturated sources: the pixel values in the cores of these sources are maxed out at the detect... | 77,962 | 42.997178 | 204 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/make_poller_files.py | #!/usr/bin/env python
"""Generates a poller file that will be used as input to runsinglehap.py, hapsequencer.py, runmultihap.py or
hapmultisequencer.py based on the files or rootnames listed user-specified list file.
USAGE
>>> python drizzlepac/haputils/make_poller_files.py <input filename> -[ost]
- input fil... | 13,732 | 52.854902 | 191 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/astrometric_utils.py | """Utilities to support creation of astrometrically accurate reference catalogs
The function, create_astrometric_catalog, allows the user to query an
astrometric catalog online to generate a catalog of astrometric sources that
should fall within the field-of-view of all the input images.
This module relies on the def... | 104,088 | 40.48625 | 181 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/catalog_utils.py | """This script contains code to support creation of photometric sourcelists using two techniques:
aperture photometry and segmentation-map based photometry."""
import copy
import math
import sys
from collections import OrderedDict
from packaging.version import Version
from astropy.io import fits as fits
from astropy.... | 162,392 | 53.585882 | 302 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/testutils.py | import sys
import os
import traceback
from astropy.io import fits
from stsci.tools import logutil
from stwcs import updatewcs
from stwcs.wcsutil import headerlet
from ci_watson.hst_helpers import ref_from_image, download_crds
from .. import align
__taskname__ = 'testutils'
log = logutil.create_logger(__name__, lev... | 7,125 | 42.987654 | 94 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/astroquery_utils.py | """Wrappers for astroquery-related functionality"""
import shutil
import os
try:
from astroquery.mast import Observations
except FileExistsError:
Observations = None
import sys
from stsci.tools import logutil
__taskname__ = 'astroquery_utils'
product_type_dict = {'HAP': 'HAP', 'pipeline': 'DADS', 'both': ''... | 7,039 | 40.411765 | 94 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/omegaxyz.py | """Functions to get and apply HSC infinitesimal rotations to correct small shifts and rotations in spherical coordinates
Uses formulae from `Budavari & Lubow (2012, ApJ, 761, 188) <http://adsabs.harvard.edu/abs/2012ApJ...761..188B>`_
vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
2019 June 12, Rick White
"... | 17,587 | 30.633094 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/graph_utils.py | """ Definition of Class to handle HAP SVM Bokeh Graphics
"""
import logging
import sys
import os
import traceback
import shutil
from stsci.tools import logutil
from astropy.io import fits
import numpy as np
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Label, Circle, Range1d
from bokeh... | 20,631 | 39.774704 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/n_gaia_sources_graphics.py | #!/usr/bin/env python
"""This script harvests the hdf5 .h5 file generated by diagnostic_json_harvester.py and generates a
histogram of the number of GAIA sources as a function of the number of total-level products present in the
dataframe. (x axis: Number of GAIA sources; y axis: total-level products)"""
# Standard l... | 10,452 | 41.149194 | 120 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/quality_analysis.py | """Code that evaluates the quality of products generated by the drizzlepac package.
The JSON files generated here can be converted directly into a Pandas DataFrame
using the syntax:
>>> import json
>>> import pandas as pd
>>> with open("<rootname>_astrometry_resids.json") as jfile:
>>> resids = json.load(jfile)
>... | 24,079 | 43.675325 | 139 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/diagnostic_utils.py | #!/usr/bin/env python
"""Code related to the creation and modification of diagnostic .json files"""
import collections
from datetime import datetime
import glob
import json
import os
import pdb
import random
import re
import string
import sys
import time
from astropy.io.fits import getheader
from astropy.table impor... | 27,571 | 43.75974 | 183 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/infrot.py | # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai :
"""
Functions to compute and apply infinitesimal rotations to correct small shifts
and rotations in spherical coordinates
Uses formulae from `Budavari & Lubow (2012, ApJ, 761, 188) <http://adsabs.harvard.edu/abs/2012ApJ...761..188B>`_
Created by R. White from... | 9,390 | 30.199336 | 148 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/cell_utils.py | import os
import shutil
from itertools import chain, combinations
from matplotlib import path
from matplotlib import pyplot as plt
from matplotlib.path import Path
from skimage.feature import corner_peaks, corner_harris
from scipy import ndimage
from scipy.spatial import distance
import numpy as np
import astropy
from... | 73,098 | 39.386188 | 169 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/get_git_rev_info.py | #!/bin/env python
"""
Displays revision information on the specified git-controlled repository
Path
----
hlapipeline/hlapipeline/utils/get_git_rev_info.py
Dependencies
------------
None.
Inputs
------
* Required input
1: *code_path*
* Path to query for git revision information.
Example
-------
Get git r... | 4,803 | 32.594406 | 119 | py |
drizzlepac | drizzlepac-master/drizzlepac/haputils/__init__.py | 0 | 0 | 0 | py | |
drizzlepac | drizzlepac-master/drizzlepac/haputils/analyze.py | """ Utilities to analyze an input and determine whether the input is viable for a given process
The fundamental function analyze_data opens an input list containing FLT and/or FLC FITS
filenames in order to access the primary header data. Based upon the values of specific
FITS keywords, the function determines whethe... | 31,808 | 41.131126 | 118 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.