repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
spacetelescope/drizzlepac
drizzlepac/wcs_functions.py
WCSMap.backward
def backward(self,pixx,pixy): """ Transform pixx,pixy positions from the output frame back onto their original positions in the input frame. """ skyx,skyy = self.output.wcs_pix2world(pixx,pixy,self.origin) result = self.input.all_world2pix(skyx,skyy,self.origin) retur...
python
def backward(self,pixx,pixy): """ Transform pixx,pixy positions from the output frame back onto their original positions in the input frame. """ skyx,skyy = self.output.wcs_pix2world(pixx,pixy,self.origin) result = self.input.all_world2pix(skyx,skyy,self.origin) retur...
[ "def", "backward", "(", "self", ",", "pixx", ",", "pixy", ")", ":", "skyx", ",", "skyy", "=", "self", ".", "output", ".", "wcs_pix2world", "(", "pixx", ",", "pixy", ",", "self", ".", "origin", ")", "result", "=", "self", ".", "input", ".", "all_wor...
Transform pixx,pixy positions from the output frame back onto their original positions in the input frame.
[ "Transform", "pixx", "pixy", "positions", "from", "the", "output", "frame", "back", "onto", "their", "original", "positions", "in", "the", "input", "frame", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wcs_functions.py#L64-L70
spacetelescope/drizzlepac
drizzlepac/staticMask.py
createMask
def createMask(input=None, static_sig=4.0, group=None, editpars=False, configObj=None, **inputDict): """ The user can input a list of images if they like to create static masks as well as optional values for static_sig and inputDict. The configObj.cfg file will set the defaults and then override th...
python
def createMask(input=None, static_sig=4.0, group=None, editpars=False, configObj=None, **inputDict): """ The user can input a list of images if they like to create static masks as well as optional values for static_sig and inputDict. The configObj.cfg file will set the defaults and then override th...
[ "def", "createMask", "(", "input", "=", "None", ",", "static_sig", "=", "4.0", ",", "group", "=", "None", ",", "editpars", "=", "False", ",", "configObj", "=", "None", ",", "*", "*", "inputDict", ")", ":", "if", "input", "is", "not", "None", ":", "...
The user can input a list of images if they like to create static masks as well as optional values for static_sig and inputDict. The configObj.cfg file will set the defaults and then override them with the user options.
[ "The", "user", "can", "input", "a", "list", "of", "images", "if", "they", "like", "to", "create", "static", "masks", "as", "well", "as", "optional", "values", "for", "static_sig", "and", "inputDict", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L32-L55
spacetelescope/drizzlepac
drizzlepac/staticMask.py
constructFilename
def constructFilename(signature): """Construct an output filename for the given signature:: signature=[instr+detector,(nx,ny),detnum] The signature is in the image object. """ suffix = buildSignatureKey(signature) filename = os.path.join('.', suffix) return filename
python
def constructFilename(signature): """Construct an output filename for the given signature:: signature=[instr+detector,(nx,ny),detnum] The signature is in the image object. """ suffix = buildSignatureKey(signature) filename = os.path.join('.', suffix) return filename
[ "def", "constructFilename", "(", "signature", ")", ":", "suffix", "=", "buildSignatureKey", "(", "signature", ")", "filename", "=", "os", ".", "path", ".", "join", "(", "'.'", ",", "suffix", ")", "return", "filename" ]
Construct an output filename for the given signature:: signature=[instr+detector,(nx,ny),detnum] The signature is in the image object.
[ "Construct", "an", "output", "filename", "for", "the", "given", "signature", "::" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L101-L110
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.addMember
def addMember(self, imagePtr=None): """ Combines the input image with the static mask that has the same signature. Parameters ---------- imagePtr : object An imageObject reference Notes ----- The signature parameter consists of the tu...
python
def addMember(self, imagePtr=None): """ Combines the input image with the static mask that has the same signature. Parameters ---------- imagePtr : object An imageObject reference Notes ----- The signature parameter consists of the tu...
[ "def", "addMember", "(", "self", ",", "imagePtr", "=", "None", ")", ":", "numchips", "=", "imagePtr", ".", "_numchips", "log", ".", "info", "(", "\"Computing static mask:\\n\"", ")", "chips", "=", "imagePtr", ".", "group", "if", "chips", "is", "None", ":",...
Combines the input image with the static mask that has the same signature. Parameters ---------- imagePtr : object An imageObject reference Notes ----- The signature parameter consists of the tuple:: (instrument/detector, (nx,ny), chip_i...
[ "Combines", "the", "input", "image", "with", "the", "static", "mask", "that", "has", "the", "same", "signature", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L145-L205
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.getMaskArray
def getMaskArray(self, signature): """ Returns the appropriate StaticMask array for the image. """ if signature in self.masklist: mask = self.masklist[signature] else: mask = None return mask
python
def getMaskArray(self, signature): """ Returns the appropriate StaticMask array for the image. """ if signature in self.masklist: mask = self.masklist[signature] else: mask = None return mask
[ "def", "getMaskArray", "(", "self", ",", "signature", ")", ":", "if", "signature", "in", "self", ".", "masklist", ":", "mask", "=", "self", ".", "masklist", "[", "signature", "]", "else", ":", "mask", "=", "None", "return", "mask" ]
Returns the appropriate StaticMask array for the image.
[ "Returns", "the", "appropriate", "StaticMask", "array", "for", "the", "image", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L211-L217
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.getFilename
def getFilename(self,signature): """Returns the name of the output mask file that should reside on disk for the given signature. """ filename=constructFilename(signature) if(fileutil.checkFileExists(filename)): return filename else: print("\nmMask file f...
python
def getFilename(self,signature): """Returns the name of the output mask file that should reside on disk for the given signature. """ filename=constructFilename(signature) if(fileutil.checkFileExists(filename)): return filename else: print("\nmMask file f...
[ "def", "getFilename", "(", "self", ",", "signature", ")", ":", "filename", "=", "constructFilename", "(", "signature", ")", "if", "(", "fileutil", ".", "checkFileExists", "(", "filename", ")", ")", ":", "return", "filename", "else", ":", "print", "(", "\"\...
Returns the name of the output mask file that should reside on disk for the given signature.
[ "Returns", "the", "name", "of", "the", "output", "mask", "file", "that", "should", "reside", "on", "disk", "for", "the", "given", "signature", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L219-L229
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.close
def close(self): """ Deletes all static mask objects. """ for key in self.masklist.keys(): self.masklist[key] = None self.masklist = {}
python
def close(self): """ Deletes all static mask objects. """ for key in self.masklist.keys(): self.masklist[key] = None self.masklist = {}
[ "def", "close", "(", "self", ")", ":", "for", "key", "in", "self", ".", "masklist", ".", "keys", "(", ")", ":", "self", ".", "masklist", "[", "key", "]", "=", "None", "self", ".", "masklist", "=", "{", "}" ]
Deletes all static mask objects.
[ "Deletes", "all", "static", "mask", "objects", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L241-L246
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.deleteMask
def deleteMask(self,signature): """ Delete just the mask that matches the signature given.""" if signature in self.masklist: self.masklist[signature] = None else: log.warning("No matching mask")
python
def deleteMask(self,signature): """ Delete just the mask that matches the signature given.""" if signature in self.masklist: self.masklist[signature] = None else: log.warning("No matching mask")
[ "def", "deleteMask", "(", "self", ",", "signature", ")", ":", "if", "signature", "in", "self", ".", "masklist", ":", "self", ".", "masklist", "[", "signature", "]", "=", "None", "else", ":", "log", ".", "warning", "(", "\"No matching mask\"", ")" ]
Delete just the mask that matches the signature given.
[ "Delete", "just", "the", "mask", "that", "matches", "the", "signature", "given", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L248-L253
spacetelescope/drizzlepac
drizzlepac/staticMask.py
staticMask.saveToFile
def saveToFile(self,imageObjectList): """ Saves the static mask to a file it uses the signatures associated with each mask to contruct the filename for the output mask image. """ virtual = imageObjectList[0].inmemory for key in self.masklist.keys(): #...
python
def saveToFile(self,imageObjectList): """ Saves the static mask to a file it uses the signatures associated with each mask to contruct the filename for the output mask image. """ virtual = imageObjectList[0].inmemory for key in self.masklist.keys(): #...
[ "def", "saveToFile", "(", "self", ",", "imageObjectList", ")", ":", "virtual", "=", "imageObjectList", "[", "0", "]", ".", "inmemory", "for", "key", "in", "self", ".", "masklist", ".", "keys", "(", ")", ":", "#check to see if the file already exists on disk", ...
Saves the static mask to a file it uses the signatures associated with each mask to contruct the filename for the output mask image.
[ "Saves", "the", "static", "mask", "to", "a", "file", "it", "uses", "the", "signatures", "associated", "with", "each", "mask", "to", "contruct", "the", "filename", "for", "the", "output", "mask", "image", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/staticMask.py#L255-L282
spacetelescope/drizzlepac
drizzlepac/stisData.py
expand_image
def expand_image(image, shape): """ Expand image from original shape to requested shape. Output shape must be an integer multiple of input image shape for each axis. """ if (shape[0] % image.shape[0]) or (shape[1] % image.shape[1]): raise ValueError("Output shape must be an integer multiple of input...
python
def expand_image(image, shape): """ Expand image from original shape to requested shape. Output shape must be an integer multiple of input image shape for each axis. """ if (shape[0] % image.shape[0]) or (shape[1] % image.shape[1]): raise ValueError("Output shape must be an integer multiple of input...
[ "def", "expand_image", "(", "image", ",", "shape", ")", ":", "if", "(", "shape", "[", "0", "]", "%", "image", ".", "shape", "[", "0", "]", ")", "or", "(", "shape", "[", "1", "]", "%", "image", ".", "shape", "[", "1", "]", ")", ":", "raise", ...
Expand image from original shape to requested shape. Output shape must be an integer multiple of input image shape for each axis.
[ "Expand", "image", "from", "original", "shape", "to", "requested", "shape", ".", "Output", "shape", "must", "be", "an", "integer", "multiple", "of", "input", "image", "shape", "for", "each", "axis", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L415-L433
spacetelescope/drizzlepac
drizzlepac/stisData.py
bilinear_interp
def bilinear_interp(data, x, y): """ Interpolate input ``data`` at "pixel" coordinates ``x`` and ``y``. """ x = np.asarray(x) y = np.asarray(y) if x.shape != y.shape: raise ValueError("X- and Y-coordinates must have identical shapes.") out_shape = x.shape out_size = x.size x = x.rav...
python
def bilinear_interp(data, x, y): """ Interpolate input ``data`` at "pixel" coordinates ``x`` and ``y``. """ x = np.asarray(x) y = np.asarray(y) if x.shape != y.shape: raise ValueError("X- and Y-coordinates must have identical shapes.") out_shape = x.shape out_size = x.size x = x.rav...
[ "def", "bilinear_interp", "(", "data", ",", "x", ",", "y", ")", ":", "x", "=", "np", ".", "asarray", "(", "x", ")", "y", "=", "np", ".", "asarray", "(", "y", ")", "if", "x", ".", "shape", "!=", "y", ".", "shape", ":", "raise", "ValueError", "...
Interpolate input ``data`` at "pixel" coordinates ``x`` and ``y``.
[ "Interpolate", "input", "data", "at", "pixel", "coordinates", "x", "and", "y", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L436-L467
spacetelescope/drizzlepac
drizzlepac/stisData.py
STISInputImage.getflat
def getflat(self, chip): """ Method for retrieving a detector's flat field. For STIS there are three. This method will return an array the same shape as the image. """ sci_chip = self._image[self.scienceExt,chip] exten = self.errExt+','+str(chip) # The keyword f...
python
def getflat(self, chip): """ Method for retrieving a detector's flat field. For STIS there are three. This method will return an array the same shape as the image. """ sci_chip = self._image[self.scienceExt,chip] exten = self.errExt+','+str(chip) # The keyword f...
[ "def", "getflat", "(", "self", ",", "chip", ")", ":", "sci_chip", "=", "self", ".", "_image", "[", "self", ".", "scienceExt", ",", "chip", "]", "exten", "=", "self", ".", "errExt", "+", "','", "+", "str", "(", "chip", ")", "# The keyword for STIS flat ...
Method for retrieving a detector's flat field. For STIS there are three. This method will return an array the same shape as the image.
[ "Method", "for", "retrieving", "a", "detector", "s", "flat", "field", ".", "For", "STIS", "there", "are", "three", ".", "This", "method", "will", "return", "an", "array", "the", "same", "shape", "as", "the", "image", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L28-L66
spacetelescope/drizzlepac
drizzlepac/stisData.py
STISInputImage._assignSignature
def _assignSignature(self, chip): """Assign a unique signature for the image based on the instrument, detector, chip, and size this will be used to uniquely identify the appropriate static mask for the image. This also records the filename for the static mask to the...
python
def _assignSignature(self, chip): """Assign a unique signature for the image based on the instrument, detector, chip, and size this will be used to uniquely identify the appropriate static mask for the image. This also records the filename for the static mask to the...
[ "def", "_assignSignature", "(", "self", ",", "chip", ")", ":", "sci_chip", "=", "self", ".", "_image", "[", "self", ".", "scienceExt", ",", "chip", "]", "ny", "=", "sci_chip", ".", "_naxis1", "nx", "=", "sci_chip", ".", "_naxis2", "detnum", "=", "sci_c...
Assign a unique signature for the image based on the instrument, detector, chip, and size this will be used to uniquely identify the appropriate static mask for the image. This also records the filename for the static mask to the outputNames dictionary.
[ "Assign", "a", "unique", "signature", "for", "the", "image", "based", "on", "the", "instrument", "detector", "chip", "and", "size", "this", "will", "be", "used", "to", "uniquely", "identify", "the", "appropriate", "static", "mask", "for", "the", "image", "."...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L97-L113
spacetelescope/drizzlepac
drizzlepac/stisData.py
CCDInputImage.getReadNoise
def getReadNoise(self): """ Method for returning the readnoise of a detector (in DN). :units: DN This should work on a chip, since different chips to be consistant with other detector classes where different chips have different gains. """ if self.proc_unit == ...
python
def getReadNoise(self): """ Method for returning the readnoise of a detector (in DN). :units: DN This should work on a chip, since different chips to be consistant with other detector classes where different chips have different gains. """ if self.proc_unit == ...
[ "def", "getReadNoise", "(", "self", ")", ":", "if", "self", ".", "proc_unit", "==", "'native'", ":", "return", "self", ".", "_rdnoise", "/", "self", ".", "_gain", "(", ")", "return", "self", ".", "_rdnoise" ]
Method for returning the readnoise of a detector (in DN). :units: DN This should work on a chip, since different chips to be consistant with other detector classes where different chips have different gains.
[ "Method", "for", "returning", "the", "readnoise", "of", "a", "detector", "(", "in", "DN", ")", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L143-L155
spacetelescope/drizzlepac
drizzlepac/stisData.py
CCDInputImage.setInstrumentParameters
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header if self._isNotValid (instrpars['gain'], instrpars['gnkeyword...
python
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header if self._isNotValid (instrpars['gain'], instrpars['gnkeyword...
[ "def", "setInstrumentParameters", "(", "self", ",", "instrpars", ")", ":", "pri_header", "=", "self", ".", "_image", "[", "0", "]", ".", "header", "if", "self", ".", "_isNotValid", "(", "instrpars", "[", "'gain'", "]", ",", "instrpars", "[", "'gnkeyword'",...
This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided.
[ "This", "method", "overrides", "the", "superclass", "to", "set", "default", "values", "into", "the", "parameter", "dictionary", "in", "case", "empty", "entries", "are", "provided", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L157-L186
spacetelescope/drizzlepac
drizzlepac/stisData.py
NUVInputImage.doUnitConversions
def doUnitConversions(self): """Convert the data to electrons. This converts all science data extensions and saves the results back to disk. We need to make sure the data inside the chips already in memory is altered as well. """ for det in range(1,self._numchips+1,1): ...
python
def doUnitConversions(self): """Convert the data to electrons. This converts all science data extensions and saves the results back to disk. We need to make sure the data inside the chips already in memory is altered as well. """ for det in range(1,self._numchips+1,1): ...
[ "def", "doUnitConversions", "(", "self", ")", ":", "for", "det", "in", "range", "(", "1", ",", "self", ".", "_numchips", "+", "1", ",", "1", ")", ":", "chip", "=", "self", ".", "_image", "[", "self", ".", "scienceExt", ",", "det", "]", "conversionF...
Convert the data to electrons. This converts all science data extensions and saves the results back to disk. We need to make sure the data inside the chips already in memory is altered as well.
[ "Convert", "the", "data", "to", "electrons", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L286-L301
spacetelescope/drizzlepac
drizzlepac/stisData.py
FUVInputImage.setInstrumentParameters
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header usingDefaultGain = False usingDefaultReadnoise = Fals...
python
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header usingDefaultGain = False usingDefaultReadnoise = Fals...
[ "def", "setInstrumentParameters", "(", "self", ",", "instrpars", ")", ":", "pri_header", "=", "self", ".", "_image", "[", "0", "]", ".", "header", "usingDefaultGain", "=", "False", "usingDefaultReadnoise", "=", "False", "if", "self", ".", "_isNotValid", "(", ...
This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided.
[ "This", "method", "overrides", "the", "superclass", "to", "set", "default", "values", "into", "the", "parameter", "dictionary", "in", "case", "empty", "entries", "are", "provided", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/stisData.py#L316-L377
spacetelescope/drizzlepac
drizzlepac/hlautils/analyze.py
analyze_data
def analyze_data(inputFileList, **kwargs): """ Determine if images within the dataset can be aligned Parameters ========== inputFileList: list List containing FLT and/or FLC filenames for all input images which comprise an associated dataset where 'associated dataset' may be a singl...
python
def analyze_data(inputFileList, **kwargs): """ Determine if images within the dataset can be aligned Parameters ========== inputFileList: list List containing FLT and/or FLC filenames for all input images which comprise an associated dataset where 'associated dataset' may be a singl...
[ "def", "analyze_data", "(", "inputFileList", ",", "*", "*", "kwargs", ")", ":", "OBSKEY", "=", "'OBSTYPE'", "MTKEY", "=", "'MTFLAG'", "SCNKEY", "=", "'SCAN_TYP'", "FILKEY", "=", "'FILTER'", "FILKEY1", "=", "'FILTER1'", "FILKEY2", "=", "'FILTER2'", "APKEY", "...
Determine if images within the dataset can be aligned Parameters ========== inputFileList: list List containing FLT and/or FLC filenames for all input images which comprise an associated dataset where 'associated dataset' may be a single image, multiple images, an HST association, o...
[ "Determine", "if", "images", "within", "the", "dataset", "can", "be", "aligned" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/hlautils/analyze.py#L29-L264
spacetelescope/drizzlepac
drizzlepac/hlautils/analyze.py
generate_msg
def generate_msg(filename, msg, key, value): """ Generate a message for the output log indicating the file/association will not be processed as the characteristics of the data are known to be inconsistent with alignment. """ log.info('Dataset ' + filename + ' has (keyword = value) of (' + k...
python
def generate_msg(filename, msg, key, value): """ Generate a message for the output log indicating the file/association will not be processed as the characteristics of the data are known to be inconsistent with alignment. """ log.info('Dataset ' + filename + ' has (keyword = value) of (' + k...
[ "def", "generate_msg", "(", "filename", ",", "msg", ",", "key", ",", "value", ")", ":", "log", ".", "info", "(", "'Dataset '", "+", "filename", "+", "' has (keyword = value) of ('", "+", "key", "+", "' = '", "+", "str", "(", "value", ")", "+", "').'", ...
Generate a message for the output log indicating the file/association will not be processed as the characteristics of the data are known to be inconsistent with alignment.
[ "Generate", "a", "message", "for", "the", "output", "log", "indicating", "the", "file", "/", "association", "will", "not", "be", "processed", "as", "the", "characteristics", "of", "the", "data", "are", "known", "to", "be", "inconsistent", "with", "alignment", ...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/hlautils/analyze.py#L267-L277
spacetelescope/drizzlepac
drizzlepac/drizCR.py
drizCR
def drizCR(input=None, configObj=None, editpars=False, **inputDict): """ Look for cosmic rays. """ log.debug(inputDict) inputDict["input"] = input configObj = util.getDefaultConfigObj(__taskname__, configObj, inputDict, loadOnly=(not editpars)) if configObj i...
python
def drizCR(input=None, configObj=None, editpars=False, **inputDict): """ Look for cosmic rays. """ log.debug(inputDict) inputDict["input"] = input configObj = util.getDefaultConfigObj(__taskname__, configObj, inputDict, loadOnly=(not editpars)) if configObj i...
[ "def", "drizCR", "(", "input", "=", "None", ",", "configObj", "=", "None", ",", "editpars", "=", "False", ",", "*", "*", "inputDict", ")", ":", "log", ".", "debug", "(", "inputDict", ")", "inputDict", "[", "\"input\"", "]", "=", "input", "configObj", ...
Look for cosmic rays.
[ "Look", "for", "cosmic", "rays", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L34-L44
spacetelescope/drizzlepac
drizzlepac/drizCR.py
_driz_cr
def _driz_cr(sciImage, virtual_outputs, paramDict): """mask blemishes in dithered data by comparison of an image with a model image and the derivative of the model image. - ``sciImage`` is an imageObject which contains the science data - ``blotImage`` is inferred from the ``sciImage`` object here which...
python
def _driz_cr(sciImage, virtual_outputs, paramDict): """mask blemishes in dithered data by comparison of an image with a model image and the derivative of the model image. - ``sciImage`` is an imageObject which contains the science data - ``blotImage`` is inferred from the ``sciImage`` object here which...
[ "def", "_driz_cr", "(", "sciImage", ",", "virtual_outputs", ",", "paramDict", ")", ":", "grow", "=", "paramDict", "[", "\"driz_cr_grow\"", "]", "ctegrow", "=", "paramDict", "[", "\"driz_cr_ctegrow\"", "]", "crcorr_list", "=", "[", "]", "cr_mask_dict", "=", "{"...
mask blemishes in dithered data by comparison of an image with a model image and the derivative of the model image. - ``sciImage`` is an imageObject which contains the science data - ``blotImage`` is inferred from the ``sciImage`` object here which knows the name of its blotted image - ``chip``...
[ "mask", "blemishes", "in", "dithered", "data", "by", "comparison", "of", "an", "image", "with", "a", "model", "image", "and", "the", "derivative", "of", "the", "model", "image", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L101-L297
spacetelescope/drizzlepac
drizzlepac/drizCR.py
createCorrFile
def createCorrFile(outfile, arrlist, template): """ Create a _cor file with the same format as the original input image. The DQ array will be replaced with the mask array used to create the _cor file. """ # Remove the existing cor file if it exists if os.path.isfile(outfile): os.rem...
python
def createCorrFile(outfile, arrlist, template): """ Create a _cor file with the same format as the original input image. The DQ array will be replaced with the mask array used to create the _cor file. """ # Remove the existing cor file if it exists if os.path.isfile(outfile): os.rem...
[ "def", "createCorrFile", "(", "outfile", ",", "arrlist", ",", "template", ")", ":", "# Remove the existing cor file if it exists", "if", "os", ".", "path", ".", "isfile", "(", "outfile", ")", ":", "os", ".", "remove", "(", "outfile", ")", "print", "(", "\"Re...
Create a _cor file with the same format as the original input image. The DQ array will be replaced with the mask array used to create the _cor file.
[ "Create", "a", "_cor", "file", "with", "the", "same", "format", "as", "the", "original", "input", "image", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L300-L318
spacetelescope/drizzlepac
drizzlepac/drizCR.py
setDefaults
def setDefaults(configObj={}): """ Return a dictionary of the default parameters which also been updated with the user overrides. """ paramDict = { 'gain': 7, # Detector gain, e-/ADU 'grow': 1, # Radius around CR pixel to mask [default=1 for ...
python
def setDefaults(configObj={}): """ Return a dictionary of the default parameters which also been updated with the user overrides. """ paramDict = { 'gain': 7, # Detector gain, e-/ADU 'grow': 1, # Radius around CR pixel to mask [default=1 for ...
[ "def", "setDefaults", "(", "configObj", "=", "{", "}", ")", ":", "paramDict", "=", "{", "'gain'", ":", "7", ",", "# Detector gain, e-/ADU", "'grow'", ":", "1", ",", "# Radius around CR pixel to mask [default=1 for", "# 3x3 for non-NICMOS]", "'ctegrow'", ":", "0"...
Return a dictionary of the default parameters which also been updated with the user overrides.
[ "Return", "a", "dictionary", "of", "the", "default", "parameters", "which", "also", "been", "updated", "with", "the", "user", "overrides", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L321-L341
spacetelescope/drizzlepac
drizzlepac/drizCR.py
help
def help(file=None): """ Print out syntax help for running ``astrodrizzle`` Parameters ---------- file : str (Default = None) If given, write out help to the filename specified by this parameter Any previously existing file with this name will be deleted before writing out t...
python
def help(file=None): """ Print out syntax help for running ``astrodrizzle`` Parameters ---------- file : str (Default = None) If given, write out help to the filename specified by this parameter Any previously existing file with this name will be deleted before writing out t...
[ "def", "help", "(", "file", "=", "None", ")", ":", "helpstr", "=", "getHelpAsString", "(", "docstring", "=", "True", ",", "show_ver", "=", "True", ")", "if", "file", "is", "None", ":", "print", "(", "helpstr", ")", "else", ":", "with", "open", "(", ...
Print out syntax help for running ``astrodrizzle`` Parameters ---------- file : str (Default = None) If given, write out help to the filename specified by this parameter Any previously existing file with this name will be deleted before writing out the help.
[ "Print", "out", "syntax", "help", "for", "running", "astrodrizzle" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L344-L361
spacetelescope/drizzlepac
drizzlepac/drizCR.py
getHelpAsString
def getHelpAsString(docstring=False, show_ver=True): """ Return useful help from a file in the script directory called ``__taskname__.help`` """ install_dir = os.path.dirname(__file__) taskname = util.base_taskname(__taskname__, __package__) htmlfile = os.path.join(install_dir, 'htmlhelp', ...
python
def getHelpAsString(docstring=False, show_ver=True): """ Return useful help from a file in the script directory called ``__taskname__.help`` """ install_dir = os.path.dirname(__file__) taskname = util.base_taskname(__taskname__, __package__) htmlfile = os.path.join(install_dir, 'htmlhelp', ...
[ "def", "getHelpAsString", "(", "docstring", "=", "False", ",", "show_ver", "=", "True", ")", ":", "install_dir", "=", "os", ".", "path", ".", "dirname", "(", "__file__", ")", "taskname", "=", "util", ".", "base_taskname", "(", "__taskname__", ",", "__packa...
Return useful help from a file in the script directory called ``__taskname__.help``
[ "Return", "useful", "help", "from", "a", "file", "in", "the", "script", "directory", "called", "__taskname__", ".", "help" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/drizCR.py#L364-L391
spacetelescope/drizzlepac
drizzlepac/processInput.py
setCommonInput
def setCommonInput(configObj, createOutwcs=True): """ The common interface interpreter for MultiDrizzle tasks which not only runs 'process_input()' but 'createImageObject()' and 'defineOutput()' as well to fully setup all inputs for use with the rest of the MultiDrizzle steps either as stand-alone t...
python
def setCommonInput(configObj, createOutwcs=True): """ The common interface interpreter for MultiDrizzle tasks which not only runs 'process_input()' but 'createImageObject()' and 'defineOutput()' as well to fully setup all inputs for use with the rest of the MultiDrizzle steps either as stand-alone t...
[ "def", "setCommonInput", "(", "configObj", ",", "createOutwcs", "=", "True", ")", ":", "# make sure 'updatewcs' is set to False when running from GUI or if missing", "# from configObj:", "if", "'updatewcs'", "not", "in", "configObj", ":", "configObj", "[", "'updatewcs'", "]...
The common interface interpreter for MultiDrizzle tasks which not only runs 'process_input()' but 'createImageObject()' and 'defineOutput()' as well to fully setup all inputs for use with the rest of the MultiDrizzle steps either as stand-alone tasks or internally to MultiDrizzle itself. Parameters ...
[ "The", "common", "interface", "interpreter", "for", "MultiDrizzle", "tasks", "which", "not", "only", "runs", "process_input", "()", "but", "createImageObject", "()", "and", "defineOutput", "()", "as", "well", "to", "fully", "setup", "all", "inputs", "for", "use"...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L65-L234
spacetelescope/drizzlepac
drizzlepac/processInput.py
reportResourceUsage
def reportResourceUsage(imageObjectList, outwcs, num_cores, interactive=False): """ Provide some information to the user on the estimated resource usage (primarily memory) for this run. """ from . import imageObject if outwcs is None: output_mem = 0 else: ...
python
def reportResourceUsage(imageObjectList, outwcs, num_cores, interactive=False): """ Provide some information to the user on the estimated resource usage (primarily memory) for this run. """ from . import imageObject if outwcs is None: output_mem = 0 else: ...
[ "def", "reportResourceUsage", "(", "imageObjectList", ",", "outwcs", ",", "num_cores", ",", "interactive", "=", "False", ")", ":", "from", ".", "import", "imageObject", "if", "outwcs", "is", "None", ":", "output_mem", "=", "0", "else", ":", "if", "isinstance...
Provide some information to the user on the estimated resource usage (primarily memory) for this run.
[ "Provide", "some", "information", "to", "the", "user", "on", "the", "estimated", "resource", "usage", "(", "primarily", "memory", ")", "for", "this", "run", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L237-L295
spacetelescope/drizzlepac
drizzlepac/processInput.py
getMdriztabPars
def getMdriztabPars(input): """ High-level function for getting the parameters from MDRIZTAB Used primarily for TEAL interface. """ filelist,output,ivmlist,oldasndict=processFilenames(input,None) try: mdrizdict = mdzhandler.getMdriztabParameters(filelist) except KeyError: print...
python
def getMdriztabPars(input): """ High-level function for getting the parameters from MDRIZTAB Used primarily for TEAL interface. """ filelist,output,ivmlist,oldasndict=processFilenames(input,None) try: mdrizdict = mdzhandler.getMdriztabParameters(filelist) except KeyError: print...
[ "def", "getMdriztabPars", "(", "input", ")", ":", "filelist", ",", "output", ",", "ivmlist", ",", "oldasndict", "=", "processFilenames", "(", "input", ",", "None", ")", "try", ":", "mdrizdict", "=", "mdzhandler", ".", "getMdriztabParameters", "(", "filelist", ...
High-level function for getting the parameters from MDRIZTAB Used primarily for TEAL interface.
[ "High", "-", "level", "function", "for", "getting", "the", "parameters", "from", "MDRIZTAB" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L298-L311
spacetelescope/drizzlepac
drizzlepac/processInput.py
addIVMInputs
def addIVMInputs(imageObjectList,ivmlist): """ Add IVM filenames provided by user to outputNames dictionary for each input imageObject. """ if ivmlist is None: return for img,ivmname in zip(imageObjectList,ivmlist): img.updateIVMName(ivmname)
python
def addIVMInputs(imageObjectList,ivmlist): """ Add IVM filenames provided by user to outputNames dictionary for each input imageObject. """ if ivmlist is None: return for img,ivmname in zip(imageObjectList,ivmlist): img.updateIVMName(ivmname)
[ "def", "addIVMInputs", "(", "imageObjectList", ",", "ivmlist", ")", ":", "if", "ivmlist", "is", "None", ":", "return", "for", "img", ",", "ivmname", "in", "zip", "(", "imageObjectList", ",", "ivmlist", ")", ":", "img", ".", "updateIVMName", "(", "ivmname",...
Add IVM filenames provided by user to outputNames dictionary for each input imageObject.
[ "Add", "IVM", "filenames", "provided", "by", "user", "to", "outputNames", "dictionary", "for", "each", "input", "imageObject", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L313-L320
spacetelescope/drizzlepac
drizzlepac/processInput.py
checkMultipleFiles
def checkMultipleFiles(input): """ Evaluates the input to determine whether there is 1 or more than 1 valid input file. """ f,i,o,a=buildFileList(input) return len(f) > 1
python
def checkMultipleFiles(input): """ Evaluates the input to determine whether there is 1 or more than 1 valid input file. """ f,i,o,a=buildFileList(input) return len(f) > 1
[ "def", "checkMultipleFiles", "(", "input", ")", ":", "f", ",", "i", ",", "o", ",", "a", "=", "buildFileList", "(", "input", ")", "return", "len", "(", "f", ")", ">", "1" ]
Evaluates the input to determine whether there is 1 or more than 1 valid input file.
[ "Evaluates", "the", "input", "to", "determine", "whether", "there", "is", "1", "or", "more", "than", "1", "valid", "input", "file", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L322-L326
spacetelescope/drizzlepac
drizzlepac/processInput.py
createImageObjectList
def createImageObjectList(files,instrpars,group=None, undistort=True, inmemory=False): """ Returns a list of imageObject instances, 1 for each input image in the list of input filenames. """ imageObjList = [] mtflag = False mt_refimg = None for img in files: i...
python
def createImageObjectList(files,instrpars,group=None, undistort=True, inmemory=False): """ Returns a list of imageObject instances, 1 for each input image in the list of input filenames. """ imageObjList = [] mtflag = False mt_refimg = None for img in files: i...
[ "def", "createImageObjectList", "(", "files", ",", "instrpars", ",", "group", "=", "None", ",", "undistort", "=", "True", ",", "inmemory", "=", "False", ")", ":", "imageObjList", "=", "[", "]", "mtflag", "=", "False", "mt_refimg", "=", "None", "for", "im...
Returns a list of imageObject instances, 1 for each input image in the list of input filenames.
[ "Returns", "a", "list", "of", "imageObject", "instances", "1", "for", "each", "input", "image", "in", "the", "list", "of", "input", "filenames", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L328-L362
spacetelescope/drizzlepac
drizzlepac/processInput.py
_getInputImage
def _getInputImage (input,group=None): """ Factory function to return appropriate imageObject class instance""" # extract primary header and SCI,1 header from input image sci_ext = 'SCI' if group in [None,'']: exten = '[sci,1]' phdu = fits.getheader(input, memmap=False) else: ...
python
def _getInputImage (input,group=None): """ Factory function to return appropriate imageObject class instance""" # extract primary header and SCI,1 header from input image sci_ext = 'SCI' if group in [None,'']: exten = '[sci,1]' phdu = fits.getheader(input, memmap=False) else: ...
[ "def", "_getInputImage", "(", "input", ",", "group", "=", "None", ")", ":", "# extract primary header and SCI,1 header from input image", "sci_ext", "=", "'SCI'", "if", "group", "in", "[", "None", ",", "''", "]", ":", "exten", "=", "'[sci,1]'", "phdu", "=", "f...
Factory function to return appropriate imageObject class instance
[ "Factory", "function", "to", "return", "appropriate", "imageObject", "class", "instance" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L371-L449
spacetelescope/drizzlepac
drizzlepac/processInput.py
processFilenames
def processFilenames(input=None,output=None,infilesOnly=False): """Process the input string which contains the input file information and return a filelist,output """ ivmlist = None oldasndict = None if input is None: print("No input files provided to processInput") raise Val...
python
def processFilenames(input=None,output=None,infilesOnly=False): """Process the input string which contains the input file information and return a filelist,output """ ivmlist = None oldasndict = None if input is None: print("No input files provided to processInput") raise Val...
[ "def", "processFilenames", "(", "input", "=", "None", ",", "output", "=", "None", ",", "infilesOnly", "=", "False", ")", ":", "ivmlist", "=", "None", "oldasndict", "=", "None", "if", "input", "is", "None", ":", "print", "(", "\"No input files provided to pro...
Process the input string which contains the input file information and return a filelist,output
[ "Process", "the", "input", "string", "which", "contains", "the", "input", "file", "information", "and", "return", "a", "filelist", "output" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L452-L518
spacetelescope/drizzlepac
drizzlepac/processInput.py
process_input
def process_input(input, output=None, ivmlist=None, updatewcs=True, prodonly=False, wcskey=None, **workinplace): """ Create the full input list of filenames after verifying and converting files as needed. """ newfilelist, ivmlist, output, oldasndict, origflist = buildFileListOrig...
python
def process_input(input, output=None, ivmlist=None, updatewcs=True, prodonly=False, wcskey=None, **workinplace): """ Create the full input list of filenames after verifying and converting files as needed. """ newfilelist, ivmlist, output, oldasndict, origflist = buildFileListOrig...
[ "def", "process_input", "(", "input", ",", "output", "=", "None", ",", "ivmlist", "=", "None", ",", "updatewcs", "=", "True", ",", "prodonly", "=", "False", ",", "wcskey", "=", "None", ",", "*", "*", "workinplace", ")", ":", "newfilelist", ",", "ivmlis...
Create the full input list of filenames after verifying and converting files as needed.
[ "Create", "the", "full", "input", "list", "of", "filenames", "after", "verifying", "and", "converting", "files", "as", "needed", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L521-L569
spacetelescope/drizzlepac
drizzlepac/processInput.py
_process_input_wcs
def _process_input_wcs(infiles, wcskey, updatewcs): """ This is a subset of process_input(), for internal use only. This is the portion of input handling which sets/updates WCS data, and is a performance hit - a target for parallelization. Returns the expanded list of filenames. """ # Run pars...
python
def _process_input_wcs(infiles, wcskey, updatewcs): """ This is a subset of process_input(), for internal use only. This is the portion of input handling which sets/updates WCS data, and is a performance hit - a target for parallelization. Returns the expanded list of filenames. """ # Run pars...
[ "def", "_process_input_wcs", "(", "infiles", ",", "wcskey", ",", "updatewcs", ")", ":", "# Run parseinput though it's likely already been done in processFilenames", "outfiles", "=", "parseinput", ".", "parseinput", "(", "infiles", ")", "[", "0", "]", "# Disable parallel p...
This is a subset of process_input(), for internal use only. This is the portion of input handling which sets/updates WCS data, and is a performance hit - a target for parallelization. Returns the expanded list of filenames.
[ "This", "is", "a", "subset", "of", "process_input", "()", "for", "internal", "use", "only", ".", "This", "is", "the", "portion", "of", "input", "handling", "which", "sets", "/", "updates", "WCS", "data", "and", "is", "a", "performance", "hit", "-", "a", ...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L572-L610
spacetelescope/drizzlepac
drizzlepac/processInput.py
_process_input_wcs_single
def _process_input_wcs_single(fname, wcskey, updatewcs): """ See docs for _process_input_wcs. This is separated to be spawned in parallel. """ if wcskey in ['', ' ', 'INDEF', None]: if updatewcs: uw.updatewcs(fname, checkfiles=False) else: numext = fileutil.countExtn(...
python
def _process_input_wcs_single(fname, wcskey, updatewcs): """ See docs for _process_input_wcs. This is separated to be spawned in parallel. """ if wcskey in ['', ' ', 'INDEF', None]: if updatewcs: uw.updatewcs(fname, checkfiles=False) else: numext = fileutil.countExtn(...
[ "def", "_process_input_wcs_single", "(", "fname", ",", "wcskey", ",", "updatewcs", ")", ":", "if", "wcskey", "in", "[", "''", ",", "' '", ",", "'INDEF'", ",", "None", "]", ":", "if", "updatewcs", ":", "uw", ".", "updatewcs", "(", "fname", ",", "checkfi...
See docs for _process_input_wcs. This is separated to be spawned in parallel.
[ "See", "docs", "for", "_process_input_wcs", ".", "This", "is", "separated", "to", "be", "spawned", "in", "parallel", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L613-L636
spacetelescope/drizzlepac
drizzlepac/processInput.py
buildFileList
def buildFileList(input, output=None, ivmlist=None, wcskey=None, updatewcs=True, **workinplace): """ Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations. """ newfilelist, ivmlist, output, oldasndic...
python
def buildFileList(input, output=None, ivmlist=None, wcskey=None, updatewcs=True, **workinplace): """ Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations. """ newfilelist, ivmlist, output, oldasndic...
[ "def", "buildFileList", "(", "input", ",", "output", "=", "None", ",", "ivmlist", "=", "None", ",", "wcskey", "=", "None", ",", "updatewcs", "=", "True", ",", "*", "*", "workinplace", ")", ":", "newfilelist", ",", "ivmlist", ",", "output", ",", "oldasn...
Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations.
[ "Builds", "a", "file", "list", "which", "has", "undergone", "various", "instrument", "-", "specific", "checks", "for", "input", "to", "MultiDrizzle", "including", "splitting", "STIS", "associations", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L639-L648
spacetelescope/drizzlepac
drizzlepac/processInput.py
buildFileListOrig
def buildFileListOrig(input, output=None, ivmlist=None, wcskey=None, updatewcs=True, **workinplace): """ Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations. Compared to buildFileList, this version ret...
python
def buildFileListOrig(input, output=None, ivmlist=None, wcskey=None, updatewcs=True, **workinplace): """ Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations. Compared to buildFileList, this version ret...
[ "def", "buildFileListOrig", "(", "input", ",", "output", "=", "None", ",", "ivmlist", "=", "None", ",", "wcskey", "=", "None", ",", "updatewcs", "=", "True", ",", "*", "*", "workinplace", ")", ":", "# NOTE: original file name is required in order to correctly asso...
Builds a file list which has undergone various instrument-specific checks for input to MultiDrizzle, including splitting STIS associations. Compared to buildFileList, this version returns the list of the original file names as specified by the user (e.g., before GEIS->MEF, or WAIVER FITS->MEF conversion...
[ "Builds", "a", "file", "list", "which", "has", "undergone", "various", "instrument", "-", "specific", "checks", "for", "input", "to", "MultiDrizzle", "including", "splitting", "STIS", "associations", ".", "Compared", "to", "buildFileList", "this", "version", "retu...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L651-L706
spacetelescope/drizzlepac
drizzlepac/processInput.py
buildASNList
def buildASNList(rootnames, asnname, check_for_duplicates=True): """ Return the list of filenames for a given set of rootnames """ # Recognize when multiple valid inputs with the same rootname are present # this would happen when both CTE-corrected (_flc) and non-CTE-corrected (_flt) # products...
python
def buildASNList(rootnames, asnname, check_for_duplicates=True): """ Return the list of filenames for a given set of rootnames """ # Recognize when multiple valid inputs with the same rootname are present # this would happen when both CTE-corrected (_flc) and non-CTE-corrected (_flt) # products...
[ "def", "buildASNList", "(", "rootnames", ",", "asnname", ",", "check_for_duplicates", "=", "True", ")", ":", "# Recognize when multiple valid inputs with the same rootname are present", "# this would happen when both CTE-corrected (_flc) and non-CTE-corrected (_flt)", "# products are in ...
Return the list of filenames for a given set of rootnames
[ "Return", "the", "list", "of", "filenames", "for", "a", "given", "set", "of", "rootnames" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L709-L739
spacetelescope/drizzlepac
drizzlepac/processInput.py
changeSuffixinASN
def changeSuffixinASN(asnfile, suffix): """ Create a copy of the original asn file and change the name of all members to include the suffix. """ # Start by creating a new name for the ASN table _new_asn = asnfile.replace('_asn.fits','_'+suffix+'_asn.fits') if os.path.exists(_new_asn): ...
python
def changeSuffixinASN(asnfile, suffix): """ Create a copy of the original asn file and change the name of all members to include the suffix. """ # Start by creating a new name for the ASN table _new_asn = asnfile.replace('_asn.fits','_'+suffix+'_asn.fits') if os.path.exists(_new_asn): ...
[ "def", "changeSuffixinASN", "(", "asnfile", ",", "suffix", ")", ":", "# Start by creating a new name for the ASN table", "_new_asn", "=", "asnfile", ".", "replace", "(", "'_asn.fits'", ",", "'_'", "+", "suffix", "+", "'_asn.fits'", ")", "if", "os", ".", "path", ...
Create a copy of the original asn file and change the name of all members to include the suffix.
[ "Create", "a", "copy", "of", "the", "original", "asn", "file", "and", "change", "the", "name", "of", "all", "members", "to", "include", "the", "suffix", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L742-L779
spacetelescope/drizzlepac
drizzlepac/processInput.py
checkForDuplicateInputs
def checkForDuplicateInputs(rootnames): """ Check input files specified in ASN table for duplicate versions with multiple valid suffixes (_flt and _flc, for example). """ flist = [] duplist = [] for fname in rootnames: # Look for any recognized CTE-corrected products f1 = f...
python
def checkForDuplicateInputs(rootnames): """ Check input files specified in ASN table for duplicate versions with multiple valid suffixes (_flt and _flc, for example). """ flist = [] duplist = [] for fname in rootnames: # Look for any recognized CTE-corrected products f1 = f...
[ "def", "checkForDuplicateInputs", "(", "rootnames", ")", ":", "flist", "=", "[", "]", "duplist", "=", "[", "]", "for", "fname", "in", "rootnames", ":", "# Look for any recognized CTE-corrected products", "f1", "=", "fileutil", ".", "buildRootname", "(", "fname", ...
Check input files specified in ASN table for duplicate versions with multiple valid suffixes (_flt and _flc, for example).
[ "Check", "input", "files", "specified", "in", "ASN", "table", "for", "duplicate", "versions", "with", "multiple", "valid", "suffixes", "(", "_flt", "and", "_flc", "for", "example", ")", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L782-L800
spacetelescope/drizzlepac
drizzlepac/processInput.py
resetDQBits
def resetDQBits(imageObjectList, cr_bits_value=4096): """Reset the CR bit in each input image's DQ array""" if cr_bits_value > 0: for img in imageObjectList: for chip in range(1,img._numchips+1,1): sci_chip = img._image[img.scienceExt,chip] resetbits.reset_dq...
python
def resetDQBits(imageObjectList, cr_bits_value=4096): """Reset the CR bit in each input image's DQ array""" if cr_bits_value > 0: for img in imageObjectList: for chip in range(1,img._numchips+1,1): sci_chip = img._image[img.scienceExt,chip] resetbits.reset_dq...
[ "def", "resetDQBits", "(", "imageObjectList", ",", "cr_bits_value", "=", "4096", ")", ":", "if", "cr_bits_value", ">", "0", ":", "for", "img", "in", "imageObjectList", ":", "for", "chip", "in", "range", "(", "1", ",", "img", ".", "_numchips", "+", "1", ...
Reset the CR bit in each input image's DQ array
[ "Reset", "the", "CR", "bit", "in", "each", "input", "image", "s", "DQ", "array" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L823-L831
spacetelescope/drizzlepac
drizzlepac/processInput.py
update_member_names
def update_member_names(oldasndict, pydr_input): """ Update names in a member dictionary. Given an association dictionary with rootnames and a list of full file names, it will update the names in the member dictionary to contain '_*' extension. For example a rootname of 'u9600201m' will be repl...
python
def update_member_names(oldasndict, pydr_input): """ Update names in a member dictionary. Given an association dictionary with rootnames and a list of full file names, it will update the names in the member dictionary to contain '_*' extension. For example a rootname of 'u9600201m' will be repl...
[ "def", "update_member_names", "(", "oldasndict", ",", "pydr_input", ")", ":", "omembers", "=", "oldasndict", "[", "'members'", "]", ".", "copy", "(", ")", "nmembers", "=", "{", "}", "translated_names", "=", "[", "f", ".", "split", "(", "'.fits'", ")", "[...
Update names in a member dictionary. Given an association dictionary with rootnames and a list of full file names, it will update the names in the member dictionary to contain '_*' extension. For example a rootname of 'u9600201m' will be replaced by 'u9600201m_c0h' making sure that a MEf file is passed...
[ "Update", "names", "in", "a", "member", "dictionary", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L834-L863
spacetelescope/drizzlepac
drizzlepac/processInput.py
manageInputCopies
def manageInputCopies(filelist, **workinplace): """ Creates copies of all input images in a sub-directory. The copies are made prior to any processing being done to the images at all, including updating the WCS keywords. If there are already copies present, they will NOT be overwritten, but instead...
python
def manageInputCopies(filelist, **workinplace): """ Creates copies of all input images in a sub-directory. The copies are made prior to any processing being done to the images at all, including updating the WCS keywords. If there are already copies present, they will NOT be overwritten, but instead...
[ "def", "manageInputCopies", "(", "filelist", ",", "*", "*", "workinplace", ")", ":", "# Find out what directory is being used for processing", "workingdir", "=", "os", ".", "getcwd", "(", ")", "# Only create sub-directory for copies of inputs, if copies are requested", "# Creat...
Creates copies of all input images in a sub-directory. The copies are made prior to any processing being done to the images at all, including updating the WCS keywords. If there are already copies present, they will NOT be overwritten, but instead will be used to over-write the current working copies.
[ "Creates", "copies", "of", "all", "input", "images", "in", "a", "sub", "-", "directory", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L866-L918
spacetelescope/drizzlepac
drizzlepac/processInput.py
buildEmptyDRZ
def buildEmptyDRZ(input, output): """ Create an empty DRZ file. This module creates an empty DRZ file in a valid FITS format so that the HST pipeline can handle the Multidrizzle zero expossure time exception where all data has been excluded from processing. Parameters ---------- input ...
python
def buildEmptyDRZ(input, output): """ Create an empty DRZ file. This module creates an empty DRZ file in a valid FITS format so that the HST pipeline can handle the Multidrizzle zero expossure time exception where all data has been excluded from processing. Parameters ---------- input ...
[ "def", "buildEmptyDRZ", "(", "input", ",", "output", ")", ":", "# Identify the first input image", "inputfile", "=", "parseinput", ".", "parseinput", "(", "input", ")", "[", "0", "]", "if", "not", "inputfile", ":", "print", "(", "'\\n******* ERROR *******'", ","...
Create an empty DRZ file. This module creates an empty DRZ file in a valid FITS format so that the HST pipeline can handle the Multidrizzle zero expossure time exception where all data has been excluded from processing. Parameters ---------- input : str filename of the initial input to...
[ "Create", "an", "empty", "DRZ", "file", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L921-L1033
spacetelescope/drizzlepac
drizzlepac/processInput.py
checkDGEOFile
def checkDGEOFile(filenames): """ Verify that input file has been updated with NPOLFILE This function checks for the presence of 'NPOLFILE' kw in the primary header when 'DGEOFILE' kw is present and valid (i.e. 'DGEOFILE' is not blank or 'N/A'). It handles the case of science files downloaded from ...
python
def checkDGEOFile(filenames): """ Verify that input file has been updated with NPOLFILE This function checks for the presence of 'NPOLFILE' kw in the primary header when 'DGEOFILE' kw is present and valid (i.e. 'DGEOFILE' is not blank or 'N/A'). It handles the case of science files downloaded from ...
[ "def", "checkDGEOFile", "(", "filenames", ")", ":", "msg", "=", "\"\"\"\n A 'DGEOFILE' keyword is present in the primary header but 'NPOLFILE' keyword was not found.\n This version of the software uses a new format for the residual distortion DGEO files.\n Please con...
Verify that input file has been updated with NPOLFILE This function checks for the presence of 'NPOLFILE' kw in the primary header when 'DGEOFILE' kw is present and valid (i.e. 'DGEOFILE' is not blank or 'N/A'). It handles the case of science files downloaded from the archive before the new software wa...
[ "Verify", "that", "input", "file", "has", "been", "updated", "with", "NPOLFILE" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L1036-L1105
spacetelescope/drizzlepac
drizzlepac/processInput.py
_setDefaults
def _setDefaults(input_dict={}): """ Define full set of default values for unit-testing this module.[OBSOLETE]""" paramDict = { 'input':'*flt.fits', 'output':None, 'mdriztab':None, 'refimage':None, 'runfile':None, 'workinplace':False, 'updatewcs':True, ...
python
def _setDefaults(input_dict={}): """ Define full set of default values for unit-testing this module.[OBSOLETE]""" paramDict = { 'input':'*flt.fits', 'output':None, 'mdriztab':None, 'refimage':None, 'runfile':None, 'workinplace':False, 'updatewcs':True, ...
[ "def", "_setDefaults", "(", "input_dict", "=", "{", "}", ")", ":", "paramDict", "=", "{", "'input'", ":", "'*flt.fits'", ",", "'output'", ":", "None", ",", "'mdriztab'", ":", "None", ",", "'refimage'", ":", "None", ",", "'runfile'", ":", "None", ",", "...
Define full set of default values for unit-testing this module.[OBSOLETE]
[ "Define", "full", "set", "of", "default", "values", "for", "unit", "-", "testing", "this", "module", ".", "[", "OBSOLETE", "]" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/processInput.py#L1120-L1208
spacetelescope/drizzlepac
drizzlepac/nicmosData.py
NICMOSInputImage.getdarkimg
def getdarkimg(self,chip): """ Return an array representing the dark image for the detector. Returns ------- dark : array The dark array in the same shape as the image with **units of cps**. """ # Read the temperature dependeant dark file. The name...
python
def getdarkimg(self,chip): """ Return an array representing the dark image for the detector. Returns ------- dark : array The dark array in the same shape as the image with **units of cps**. """ # Read the temperature dependeant dark file. The name...
[ "def", "getdarkimg", "(", "self", ",", "chip", ")", ":", "# Read the temperature dependeant dark file. The name for the file is taken from", "# the TEMPFILE keyword in the primary header.", "tddobj", "=", "readTDD", ".", "fromcalfile", "(", "self", ".", "name", ")", "if", ...
Return an array representing the dark image for the detector. Returns ------- dark : array The dark array in the same shape as the image with **units of cps**.
[ "Return", "an", "array", "representing", "the", "dark", "image", "for", "the", "detector", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/nicmosData.py#L170-L192
spacetelescope/drizzlepac
drizzlepac/nicmosData.py
NICMOSInputImage.isCountRate
def isCountRate(self): """ isCountRate: Method or IRInputObject used to indicate if the science data is in units of counts or count rate. This method assumes that the keyword 'BUNIT' is in the header of the input FITS file. """ has_bunit = False if 'BUNIT...
python
def isCountRate(self): """ isCountRate: Method or IRInputObject used to indicate if the science data is in units of counts or count rate. This method assumes that the keyword 'BUNIT' is in the header of the input FITS file. """ has_bunit = False if 'BUNIT...
[ "def", "isCountRate", "(", "self", ")", ":", "has_bunit", "=", "False", "if", "'BUNIT'", "in", "self", ".", "_image", "[", "'sci'", ",", "1", "]", ".", "header", ":", "has_bunit", "=", "True", "countrate", "=", "False", "if", "(", "self", ".", "_imag...
isCountRate: Method or IRInputObject used to indicate if the science data is in units of counts or count rate. This method assumes that the keyword 'BUNIT' is in the header of the input FITS file.
[ "isCountRate", ":", "Method", "or", "IRInputObject", "used", "to", "indicate", "if", "the", "science", "data", "is", "in", "units", "of", "counts", "or", "count", "rate", ".", "This", "method", "assumes", "that", "the", "keyword", "BUNIT", "is", "in", "the...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/nicmosData.py#L194-L210
spacetelescope/drizzlepac
drizzlepac/nicmosData.py
NIC2InputImage.setInstrumentParameters
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header self.proc_unit = instrpars['proc_unit'] if self._isN...
python
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header self.proc_unit = instrpars['proc_unit'] if self._isN...
[ "def", "setInstrumentParameters", "(", "self", ",", "instrpars", ")", ":", "pri_header", "=", "self", ".", "_image", "[", "0", "]", ".", "header", "self", ".", "proc_unit", "=", "instrpars", "[", "'proc_unit'", "]", "if", "self", ".", "_isNotValid", "(", ...
This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided.
[ "This", "method", "overrides", "the", "superclass", "to", "set", "default", "values", "into", "the", "parameter", "dictionary", "in", "case", "empty", "entries", "are", "provided", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/nicmosData.py#L299-L342
spacetelescope/drizzlepac
drizzlepac/photeq.py
photeq
def photeq(files='*_flt.fits', sciext='SCI', errext='ERR', ref_phot=None, ref_phot_ext=None, phot_kwd='PHOTFLAM', aux_phot_kwd='PHOTFNU', search_primary=True, readonly=True, clobber=False, logfile='photeq.log'): """ Adjust data values of images by equalizing each chip...
python
def photeq(files='*_flt.fits', sciext='SCI', errext='ERR', ref_phot=None, ref_phot_ext=None, phot_kwd='PHOTFLAM', aux_phot_kwd='PHOTFNU', search_primary=True, readonly=True, clobber=False, logfile='photeq.log'): """ Adjust data values of images by equalizing each chip...
[ "def", "photeq", "(", "files", "=", "'*_flt.fits'", ",", "sciext", "=", "'SCI'", ",", "errext", "=", "'ERR'", ",", "ref_phot", "=", "None", ",", "ref_phot_ext", "=", "None", ",", "phot_kwd", "=", "'PHOTFLAM'", ",", "aux_phot_kwd", "=", "'PHOTFNU'", ",", ...
Adjust data values of images by equalizing each chip's PHOTFLAM value to a single common value so that all chips can be treated equally by ``AstroDrizzle``. Parameters ---------- files : str (Default = ``'*_flt.fits'``) A string containing one of the following: * a comma-sepa...
[ "Adjust", "data", "values", "of", "images", "by", "equalizing", "each", "chip", "s", "PHOTFLAM", "value", "to", "a", "single", "common", "value", "so", "that", "all", "chips", "can", "be", "treated", "equally", "by", "AstroDrizzle", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/photeq.py#L68-L591
spacetelescope/drizzlepac
drizzlepac/tweakreg.py
_managePsets
def _managePsets(configobj, section_name, task_name, iparsobj=None, input_dict=None): """ Read in parameter values from PSET-like configobj tasks defined for source-finding algorithms, and any other PSET-like tasks under this task, and merge those values into the input configobj dictionary. """ ...
python
def _managePsets(configobj, section_name, task_name, iparsobj=None, input_dict=None): """ Read in parameter values from PSET-like configobj tasks defined for source-finding algorithms, and any other PSET-like tasks under this task, and merge those values into the input configobj dictionary. """ ...
[ "def", "_managePsets", "(", "configobj", ",", "section_name", ",", "task_name", ",", "iparsobj", "=", "None", ",", "input_dict", "=", "None", ")", ":", "# Merge all configobj instances into a single object", "configobj", "[", "section_name", "]", "=", "{", "}", "#...
Read in parameter values from PSET-like configobj tasks defined for source-finding algorithms, and any other PSET-like tasks under this task, and merge those values into the input configobj dictionary.
[ "Read", "in", "parameter", "values", "from", "PSET", "-", "like", "configobj", "tasks", "defined", "for", "source", "-", "finding", "algorithms", "and", "any", "other", "PSET", "-", "like", "tasks", "under", "this", "task", "and", "merge", "those", "values",...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakreg.py#L46-L74
spacetelescope/drizzlepac
drizzlepac/tweakreg.py
edit_imagefindpars
def edit_imagefindpars(): """ Allows the user to edit the imagefindpars configObj in a TEAL GUI """ teal.teal(imagefindpars.__taskname__, returnAs=None, autoClose=True, loadOnly=False, canExecute=False)
python
def edit_imagefindpars(): """ Allows the user to edit the imagefindpars configObj in a TEAL GUI """ teal.teal(imagefindpars.__taskname__, returnAs=None, autoClose=True, loadOnly=False, canExecute=False)
[ "def", "edit_imagefindpars", "(", ")", ":", "teal", ".", "teal", "(", "imagefindpars", ".", "__taskname__", ",", "returnAs", "=", "None", ",", "autoClose", "=", "True", ",", "loadOnly", "=", "False", ",", "canExecute", "=", "False", ")" ]
Allows the user to edit the imagefindpars configObj in a TEAL GUI
[ "Allows", "the", "user", "to", "edit", "the", "imagefindpars", "configObj", "in", "a", "TEAL", "GUI" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakreg.py#L81-L85
spacetelescope/drizzlepac
drizzlepac/tweakreg.py
edit_refimagefindpars
def edit_refimagefindpars(): """ Allows the user to edit the refimagefindpars configObj in a TEAL GUI """ teal.teal(refimagefindpars.__taskname__, returnAs=None, autoClose=True, loadOnly=False, canExecute=False)
python
def edit_refimagefindpars(): """ Allows the user to edit the refimagefindpars configObj in a TEAL GUI """ teal.teal(refimagefindpars.__taskname__, returnAs=None, autoClose=True, loadOnly=False, canExecute=False)
[ "def", "edit_refimagefindpars", "(", ")", ":", "teal", ".", "teal", "(", "refimagefindpars", ".", "__taskname__", ",", "returnAs", "=", "None", ",", "autoClose", "=", "True", ",", "loadOnly", "=", "False", ",", "canExecute", "=", "False", ")" ]
Allows the user to edit the refimagefindpars configObj in a TEAL GUI
[ "Allows", "the", "user", "to", "edit", "the", "refimagefindpars", "configObj", "in", "a", "TEAL", "GUI" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakreg.py#L87-L91
spacetelescope/drizzlepac
drizzlepac/tweakreg.py
run
def run(configobj): """ Primary Python interface for image registration code This task replaces 'tweakshifts' """ print('TweakReg Version %s(%s) started at: %s \n'%( __version__,__version_date__,util._ptime()[0])) util.print_pkg_versions() # make sure 'updatewcs' is set ...
python
def run(configobj): """ Primary Python interface for image registration code This task replaces 'tweakshifts' """ print('TweakReg Version %s(%s) started at: %s \n'%( __version__,__version_date__,util._ptime()[0])) util.print_pkg_versions() # make sure 'updatewcs' is set ...
[ "def", "run", "(", "configobj", ")", ":", "print", "(", "'TweakReg Version %s(%s) started at: %s \\n'", "%", "(", "__version__", ",", "__version_date__", ",", "util", ".", "_ptime", "(", ")", "[", "0", "]", ")", ")", "util", ".", "print_pkg_versions", "(", "...
Primary Python interface for image registration code This task replaces 'tweakshifts'
[ "Primary", "Python", "interface", "for", "image", "registration", "code", "This", "task", "replaces", "tweakshifts" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakreg.py#L95-L683
spacetelescope/drizzlepac
drizzlepac/hlautils/get_git_rev_info.py
print_rev_id
def print_rev_id(localRepoPath): """prints information about the specified local repository to STDOUT. Expected method of execution: command-line or shell script call Parameters ---------- localRepoPath: string Local repository path. Returns ======= Nothing as such. subroutine ...
python
def print_rev_id(localRepoPath): """prints information about the specified local repository to STDOUT. Expected method of execution: command-line or shell script call Parameters ---------- localRepoPath: string Local repository path. Returns ======= Nothing as such. subroutine ...
[ "def", "print_rev_id", "(", "localRepoPath", ")", ":", "start_path", "=", "os", ".", "getcwd", "(", ")", "try", ":", "log", ".", "info", "(", "\"Local repository path: {}\"", ".", "format", "(", "localRepoPath", ")", ")", "os", ".", "chdir", "(", "localRep...
prints information about the specified local repository to STDOUT. Expected method of execution: command-line or shell script call Parameters ---------- localRepoPath: string Local repository path. Returns ======= Nothing as such. subroutine will exit with a state of 0 if everythin...
[ "prints", "information", "about", "the", "specified", "local", "repository", "to", "STDOUT", ".", "Expected", "method", "of", "execution", ":", "command", "-", "line", "or", "shell", "script", "call" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/hlautils/get_git_rev_info.py#L35-L71
spacetelescope/drizzlepac
drizzlepac/hlautils/get_git_rev_info.py
get_rev_id
def get_rev_id(localRepoPath): """returns the current full git revision id of the specified local repository. Expected method of execution: python subroutine call Parameters ---------- localRepoPath: string Local repository path. Returns ======= full git revision ID of the spec...
python
def get_rev_id(localRepoPath): """returns the current full git revision id of the specified local repository. Expected method of execution: python subroutine call Parameters ---------- localRepoPath: string Local repository path. Returns ======= full git revision ID of the spec...
[ "def", "get_rev_id", "(", "localRepoPath", ")", ":", "start_path", "=", "os", ".", "getcwd", "(", ")", "try", ":", "os", ".", "chdir", "(", "localRepoPath", ")", "instream", "=", "os", ".", "popen", "(", "\"git --no-pager log --max-count=1 | head -1\"", ")", ...
returns the current full git revision id of the specified local repository. Expected method of execution: python subroutine call Parameters ---------- localRepoPath: string Local repository path. Returns ======= full git revision ID of the specified repository if everything ran OK,...
[ "returns", "the", "current", "full", "git", "revision", "id", "of", "the", "specified", "local", "repository", ".", "Expected", "method", "of", "execution", ":", "python", "subroutine", "call" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/hlautils/get_git_rev_info.py#L73-L103
spacetelescope/drizzlepac
drizzlepac/updatenpol.py
update
def update(input,refdir="jref$",local=None,interactive=False,wcsupdate=True): """ Updates headers of files given as input to point to the new reference files NPOLFILE and D2IMFILE required with the new C version of MultiDrizzle. Parameters ----------- input : string or list Name...
python
def update(input,refdir="jref$",local=None,interactive=False,wcsupdate=True): """ Updates headers of files given as input to point to the new reference files NPOLFILE and D2IMFILE required with the new C version of MultiDrizzle. Parameters ----------- input : string or list Name...
[ "def", "update", "(", "input", ",", "refdir", "=", "\"jref$\"", ",", "local", "=", "None", ",", "interactive", "=", "False", ",", "wcsupdate", "=", "True", ")", ":", "print", "(", "'UPDATENPOL Version'", ",", "__version__", "+", "'('", "+", "__version_date...
Updates headers of files given as input to point to the new reference files NPOLFILE and D2IMFILE required with the new C version of MultiDrizzle. Parameters ----------- input : string or list Name of input file or files acceptable forms: - single filename with or with...
[ "Updates", "headers", "of", "files", "given", "as", "input", "to", "point", "to", "the", "new", "reference", "files", "NPOLFILE", "and", "D2IMFILE", "required", "with", "the", "new", "C", "version", "of", "MultiDrizzle", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/updatenpol.py#L85-L255
spacetelescope/drizzlepac
drizzlepac/updatenpol.py
find_d2ifile
def find_d2ifile(flist,detector): """ Search a list of files for one that matches the detector specified. """ d2ifile = None for f in flist: fdet = fits.getval(f, 'detector', memmap=False) if fdet == detector: d2ifile = f return d2ifile
python
def find_d2ifile(flist,detector): """ Search a list of files for one that matches the detector specified. """ d2ifile = None for f in flist: fdet = fits.getval(f, 'detector', memmap=False) if fdet == detector: d2ifile = f return d2ifile
[ "def", "find_d2ifile", "(", "flist", ",", "detector", ")", ":", "d2ifile", "=", "None", "for", "f", "in", "flist", ":", "fdet", "=", "fits", ".", "getval", "(", "f", ",", "'detector'", ",", "memmap", "=", "False", ")", "if", "fdet", "==", "detector",...
Search a list of files for one that matches the detector specified.
[ "Search", "a", "list", "of", "files", "for", "one", "that", "matches", "the", "detector", "specified", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/updatenpol.py#L257-L265
spacetelescope/drizzlepac
drizzlepac/updatenpol.py
find_npolfile
def find_npolfile(flist,detector,filters): """ Search a list of files for one that matches the configuration of detector and filters used. """ npolfile = None for f in flist: fdet = fits.getval(f, 'detector', memmap=False) if fdet == detector: filt1 = fits.getval(f, '...
python
def find_npolfile(flist,detector,filters): """ Search a list of files for one that matches the configuration of detector and filters used. """ npolfile = None for f in flist: fdet = fits.getval(f, 'detector', memmap=False) if fdet == detector: filt1 = fits.getval(f, '...
[ "def", "find_npolfile", "(", "flist", ",", "detector", ",", "filters", ")", ":", "npolfile", "=", "None", "for", "f", "in", "flist", ":", "fdet", "=", "fits", ".", "getval", "(", "f", ",", "'detector'", ",", "memmap", "=", "False", ")", "if", "fdet",...
Search a list of files for one that matches the configuration of detector and filters used.
[ "Search", "a", "list", "of", "files", "for", "one", "that", "matches", "the", "configuration", "of", "detector", "and", "filters", "used", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/updatenpol.py#L267-L281
spacetelescope/drizzlepac
drizzlepac/updatenpol.py
run
def run(configobj=None,editpars=False): """ Teal interface for running this code. """ if configobj is None: configobj =teal.teal(__taskname__,loadOnly=(not editpars)) update(configobj['input'],configobj['refdir'], local=configobj['local'],interactive=configobj['interactive'], w...
python
def run(configobj=None,editpars=False): """ Teal interface for running this code. """ if configobj is None: configobj =teal.teal(__taskname__,loadOnly=(not editpars)) update(configobj['input'],configobj['refdir'], local=configobj['local'],interactive=configobj['interactive'], w...
[ "def", "run", "(", "configobj", "=", "None", ",", "editpars", "=", "False", ")", ":", "if", "configobj", "is", "None", ":", "configobj", "=", "teal", ".", "teal", "(", "__taskname__", ",", "loadOnly", "=", "(", "not", "editpars", ")", ")", "update", ...
Teal interface for running this code.
[ "Teal", "interface", "for", "running", "this", "code", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/updatenpol.py#L286-L295
spacetelescope/drizzlepac
drizzlepac/hlautils/astroquery_utils.py
retrieve_observation
def retrieve_observation(obsid, suffix=['FLC'], archive=False,clobber=False): """Simple interface for retrieving an observation from the MAST archive If the input obsid is for an association, it will request all members with the specified suffixes. Parameters ----------- obsid : string ...
python
def retrieve_observation(obsid, suffix=['FLC'], archive=False,clobber=False): """Simple interface for retrieving an observation from the MAST archive If the input obsid is for an association, it will request all members with the specified suffixes. Parameters ----------- obsid : string ...
[ "def", "retrieve_observation", "(", "obsid", ",", "suffix", "=", "[", "'FLC'", "]", ",", "archive", "=", "False", ",", "clobber", "=", "False", ")", ":", "local_files", "=", "[", "]", "# Query MAST for the data with an observation type of either \"science\" or \"calib...
Simple interface for retrieving an observation from the MAST archive If the input obsid is for an association, it will request all members with the specified suffixes. Parameters ----------- obsid : string ID for observation to be retrieved from the MAST archive. Only the IPPSSOOT...
[ "Simple", "interface", "for", "retrieving", "an", "observation", "from", "the", "MAST", "archive" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/hlautils/astroquery_utils.py#L15-L123
spacetelescope/drizzlepac
drizzlepac/resetbits.py
reset_dq_bits
def reset_dq_bits(input,bits,extver=None,extname='dq'): """ This function resets bits in the integer array(s) of a FITS file. Parameters ---------- filename : str full filename with path bits : str sum or list of integers corresponding to all the bits to be reset extver : int,...
python
def reset_dq_bits(input,bits,extver=None,extname='dq'): """ This function resets bits in the integer array(s) of a FITS file. Parameters ---------- filename : str full filename with path bits : str sum or list of integers corresponding to all the bits to be reset extver : int,...
[ "def", "reset_dq_bits", "(", "input", ",", "bits", ",", "extver", "=", "None", ",", "extname", "=", "'dq'", ")", ":", "# Interpret bits value", "bits", "=", "interpret_bit_flags", "(", "bits", ")", "flist", ",", "fcol", "=", "parseinput", ".", "parseinput", ...
This function resets bits in the integer array(s) of a FITS file. Parameters ---------- filename : str full filename with path bits : str sum or list of integers corresponding to all the bits to be reset extver : int, optional List of version numbers of the DQ arrays ...
[ "This", "function", "resets", "bits", "in", "the", "integer", "array", "(", "s", ")", "of", "a", "FITS", "file", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/resetbits.py#L87-L156
spacetelescope/drizzlepac
drizzlepac/pixreplace.py
replace
def replace(input, **pars): """ Replace pixels in `input` that have a value of `pixvalue` with a value given by `newvalue`. """ pixvalue = pars.get('pixvalue', np.nan) if pixvalue is None: pixvalue = np.nan # insure that None == np.nan newvalue = pars.get('newvalue', 0.0) ext = pars.g...
python
def replace(input, **pars): """ Replace pixels in `input` that have a value of `pixvalue` with a value given by `newvalue`. """ pixvalue = pars.get('pixvalue', np.nan) if pixvalue is None: pixvalue = np.nan # insure that None == np.nan newvalue = pars.get('newvalue', 0.0) ext = pars.g...
[ "def", "replace", "(", "input", ",", "*", "*", "pars", ")", ":", "pixvalue", "=", "pars", ".", "get", "(", "'pixvalue'", ",", "np", ".", "nan", ")", "if", "pixvalue", "is", "None", ":", "pixvalue", "=", "np", ".", "nan", "# insure that None == np.nan",...
Replace pixels in `input` that have a value of `pixvalue` with a value given by `newvalue`.
[ "Replace", "pixels", "in", "input", "that", "have", "a", "value", "of", "pixvalue", "with", "a", "value", "given", "by", "newvalue", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/pixreplace.py#L67-L104
spacetelescope/drizzlepac
drizzlepac/tweakback.py
tweakback
def tweakback(drzfile, input=None, origwcs = None, newname = None, wcsname = None, extname='SCI', force=False, verbose=False): """ Apply WCS solution recorded in drizzled file to distorted input images (``_flt.fits`` files) used to create the drizzled file. This task relies...
python
def tweakback(drzfile, input=None, origwcs = None, newname = None, wcsname = None, extname='SCI', force=False, verbose=False): """ Apply WCS solution recorded in drizzled file to distorted input images (``_flt.fits`` files) used to create the drizzled file. This task relies...
[ "def", "tweakback", "(", "drzfile", ",", "input", "=", "None", ",", "origwcs", "=", "None", ",", "newname", "=", "None", ",", "wcsname", "=", "None", ",", "extname", "=", "'SCI'", ",", "force", "=", "False", ",", "verbose", "=", "False", ")", ":", ...
Apply WCS solution recorded in drizzled file to distorted input images (``_flt.fits`` files) used to create the drizzled file. This task relies on the original WCS and updated WCS to be recorded in the drizzled image's header as the last 2 alternate WCSs. Parameters ---------- drzfile : str (D...
[ "Apply", "WCS", "solution", "recorded", "in", "drizzled", "file", "to", "distorted", "input", "images", "(", "_flt", ".", "fits", "files", ")", "used", "to", "create", "the", "drizzled", "file", ".", "This", "task", "relies", "on", "the", "original", "WCS"...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakback.py#L49-L245
spacetelescope/drizzlepac
drizzlepac/tweakback.py
extract_input_filenames
def extract_input_filenames(drzfile): """ Generate a list of filenames from a drizzled image's header """ data_kws = fits.getval(drzfile, 'd*data', ext=0, memmap=False) if len(data_kws) == 0: return None fnames = [] for kw in data_kws.cards: f = kw.value.split('[')[0] ...
python
def extract_input_filenames(drzfile): """ Generate a list of filenames from a drizzled image's header """ data_kws = fits.getval(drzfile, 'd*data', ext=0, memmap=False) if len(data_kws) == 0: return None fnames = [] for kw in data_kws.cards: f = kw.value.split('[')[0] ...
[ "def", "extract_input_filenames", "(", "drzfile", ")", ":", "data_kws", "=", "fits", ".", "getval", "(", "drzfile", ",", "'d*data'", ",", "ext", "=", "0", ",", "memmap", "=", "False", ")", "if", "len", "(", "data_kws", ")", "==", "0", ":", "return", ...
Generate a list of filenames from a drizzled image's header
[ "Generate", "a", "list", "of", "filenames", "from", "a", "drizzled", "image", "s", "header" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakback.py#L351-L364
spacetelescope/drizzlepac
drizzlepac/tweakback.py
determine_orig_wcsname
def determine_orig_wcsname(header, wnames, wkeys): """ Determine the name of the original, unmodified WCS solution """ orig_wcsname = None orig_key = None if orig_wcsname is None: for k,w in wnames.items(): if w[:4] == 'IDC_': orig_wcsname = w ...
python
def determine_orig_wcsname(header, wnames, wkeys): """ Determine the name of the original, unmodified WCS solution """ orig_wcsname = None orig_key = None if orig_wcsname is None: for k,w in wnames.items(): if w[:4] == 'IDC_': orig_wcsname = w ...
[ "def", "determine_orig_wcsname", "(", "header", ",", "wnames", ",", "wkeys", ")", ":", "orig_wcsname", "=", "None", "orig_key", "=", "None", "if", "orig_wcsname", "is", "None", ":", "for", "k", ",", "w", "in", "wnames", ".", "items", "(", ")", ":", "if...
Determine the name of the original, unmodified WCS solution
[ "Determine", "the", "name", "of", "the", "original", "unmodified", "WCS", "solution" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakback.py#L379-L396
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
parse_atfile_cat
def parse_atfile_cat(input): """ Return the list of catalog filenames specified as part of the input @-file """ with open(input[1:]) as f: catlist = [] catdict = {} for line in f.readlines(): if line[0] == '#' or not line.strip(): continue ...
python
def parse_atfile_cat(input): """ Return the list of catalog filenames specified as part of the input @-file """ with open(input[1:]) as f: catlist = [] catdict = {} for line in f.readlines(): if line[0] == '#' or not line.strip(): continue ...
[ "def", "parse_atfile_cat", "(", "input", ")", ":", "with", "open", "(", "input", "[", "1", ":", "]", ")", "as", "f", ":", "catlist", "=", "[", "]", "catdict", "=", "{", "}", "for", "line", "in", "f", ".", "readlines", "(", ")", ":", "if", "line...
Return the list of catalog filenames specified as part of the input @-file
[ "Return", "the", "list", "of", "catalog", "filenames", "specified", "as", "part", "of", "the", "input", "@", "-", "file" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L94-L114
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
parse_skypos
def parse_skypos(ra, dec): """ Function to parse RA and Dec input values and turn them into decimal degrees Input formats could be: ["nn","nn","nn.nn"] "nn nn nn.nnn" "nn:nn:nn.nn" "nnH nnM nn.nnS" or "nnD nnM nn.nnS" nn.nnnnnnnn "nn.nnnnnnn" """ ...
python
def parse_skypos(ra, dec): """ Function to parse RA and Dec input values and turn them into decimal degrees Input formats could be: ["nn","nn","nn.nn"] "nn nn nn.nnn" "nn:nn:nn.nn" "nnH nnM nn.nnS" or "nnD nnM nn.nnS" nn.nnnnnnnn "nn.nnnnnnn" """ ...
[ "def", "parse_skypos", "(", "ra", ",", "dec", ")", ":", "rval", "=", "make_val_float", "(", "ra", ")", "dval", "=", "make_val_float", "(", "dec", ")", "if", "rval", "is", "None", ":", "rval", ",", "dval", "=", "radec_hmstodd", "(", "ra", ",", "dec", ...
Function to parse RA and Dec input values and turn them into decimal degrees Input formats could be: ["nn","nn","nn.nn"] "nn nn nn.nnn" "nn:nn:nn.nn" "nnH nnM nn.nnS" or "nnD nnM nn.nnS" nn.nnnnnnnn "nn.nnnnnnn"
[ "Function", "to", "parse", "RA", "and", "Dec", "input", "values", "and", "turn", "them", "into", "decimal", "degrees" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L173-L191
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
radec_hmstodd
def radec_hmstodd(ra, dec): """ Function to convert HMS values into decimal degrees. This function relies on the astropy.coordinates package to perform the conversion to decimal degrees. Parameters ---------- ra : list or array List or array of input RA positio...
python
def radec_hmstodd(ra, dec): """ Function to convert HMS values into decimal degrees. This function relies on the astropy.coordinates package to perform the conversion to decimal degrees. Parameters ---------- ra : list or array List or array of input RA positio...
[ "def", "radec_hmstodd", "(", "ra", ",", "dec", ")", ":", "hmstrans", "=", "string", ".", "maketrans", "(", "string", ".", "ascii_letters", ",", "' '", "*", "len", "(", "string", ".", "ascii_letters", ")", ")", "if", "isinstance", "(", "ra", ",", "list"...
Function to convert HMS values into decimal degrees. This function relies on the astropy.coordinates package to perform the conversion to decimal degrees. Parameters ---------- ra : list or array List or array of input RA positions dec : list or array ...
[ "Function", "to", "convert", "HMS", "values", "into", "decimal", "degrees", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L201-L270
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
parse_exclusions
def parse_exclusions(exclusions): """ Read in exclusion definitions from file named by 'exclusions' and return a list of positions and distances """ fname = fileutil.osfn(exclusions) if os.path.exists(fname): with open(fname) as f: flines = f.readlines() else: pri...
python
def parse_exclusions(exclusions): """ Read in exclusion definitions from file named by 'exclusions' and return a list of positions and distances """ fname = fileutil.osfn(exclusions) if os.path.exists(fname): with open(fname) as f: flines = f.readlines() else: pri...
[ "def", "parse_exclusions", "(", "exclusions", ")", ":", "fname", "=", "fileutil", ".", "osfn", "(", "exclusions", ")", "if", "os", ".", "path", ".", "exists", "(", "fname", ")", ":", "with", "open", "(", "fname", ")", "as", "f", ":", "flines", "=", ...
Read in exclusion definitions from file named by 'exclusions' and return a list of positions and distances
[ "Read", "in", "exclusion", "definitions", "from", "file", "named", "by", "exclusions", "and", "return", "a", "list", "of", "positions", "and", "distances" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L273-L331
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
parse_colname
def parse_colname(colname): """ Common function to interpret input column names provided by the user. This function translates column specification provided by the user into a column number. Notes ----- This function will understand the following inputs:: '1,2,...
python
def parse_colname(colname): """ Common function to interpret input column names provided by the user. This function translates column specification provided by the user into a column number. Notes ----- This function will understand the following inputs:: '1,2,...
[ "def", "parse_colname", "(", "colname", ")", ":", "if", "isinstance", "(", "colname", ",", "list", ")", ":", "cname", "=", "''", "for", "c", "in", "colname", ":", "cname", "+=", "str", "(", "c", ")", "+", "','", "cname", "=", "cname", ".", "rstrip"...
Common function to interpret input column names provided by the user. This function translates column specification provided by the user into a column number. Notes ----- This function will understand the following inputs:: '1,2,3' or 'c1,c2,c3' or ['c1','c2','c3...
[ "Common", "function", "to", "interpret", "input", "column", "names", "provided", "by", "the", "user", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L334-L390
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
readcols
def readcols(infile, cols=None): """ Function which reads specified columns from either FITS tables or ASCII files This function reads in the columns specified by the user into numpy arrays regardless of the format of the input table (ASCII or FITS table). Parameters ...
python
def readcols(infile, cols=None): """ Function which reads specified columns from either FITS tables or ASCII files This function reads in the columns specified by the user into numpy arrays regardless of the format of the input table (ASCII or FITS table). Parameters ...
[ "def", "readcols", "(", "infile", ",", "cols", "=", "None", ")", ":", "if", "_is_str_none", "(", "infile", ")", "is", "None", ":", "return", "None", "if", "infile", ".", "endswith", "(", "'.fits'", ")", ":", "outarr", "=", "read_FITS_cols", "(", "infil...
Function which reads specified columns from either FITS tables or ASCII files This function reads in the columns specified by the user into numpy arrays regardless of the format of the input table (ASCII or FITS table). Parameters ---------- infile : string ...
[ "Function", "which", "reads", "specified", "columns", "from", "either", "FITS", "tables", "or", "ASCII", "files" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L393-L421
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
read_FITS_cols
def read_FITS_cols(infile, cols=None): # noqa: N802 """ Read columns from FITS table """ with fits.open(infile, memmap=False) as ftab: extnum = 0 extfound = False for extn in ftab: if 'tfields' in extn.header: extfound = True break ...
python
def read_FITS_cols(infile, cols=None): # noqa: N802 """ Read columns from FITS table """ with fits.open(infile, memmap=False) as ftab: extnum = 0 extfound = False for extn in ftab: if 'tfields' in extn.header: extfound = True break ...
[ "def", "read_FITS_cols", "(", "infile", ",", "cols", "=", "None", ")", ":", "# noqa: N802", "with", "fits", ".", "open", "(", "infile", ",", "memmap", "=", "False", ")", "as", "ftab", ":", "extnum", "=", "0", "extfound", "=", "False", "for", "extn", ...
Read columns from FITS table
[ "Read", "columns", "from", "FITS", "table" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L424-L447
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
read_ASCII_cols
def read_ASCII_cols(infile, cols=[1, 2, 3]): # noqa: N802 """ Interpret input ASCII file to return arrays for specified columns. Notes ----- The specification of the columns should be expected to have lists for each 'column', with all columns in each list combined into a single ...
python
def read_ASCII_cols(infile, cols=[1, 2, 3]): # noqa: N802 """ Interpret input ASCII file to return arrays for specified columns. Notes ----- The specification of the columns should be expected to have lists for each 'column', with all columns in each list combined into a single ...
[ "def", "read_ASCII_cols", "(", "infile", ",", "cols", "=", "[", "1", ",", "2", ",", "3", "]", ")", ":", "# noqa: N802", "# build dictionary representing format of each row", "# Format of dictionary: {'colname':col_number,...}", "# This provides the mapping between column name a...
Interpret input ASCII file to return arrays for specified columns. Notes ----- The specification of the columns should be expected to have lists for each 'column', with all columns in each list combined into a single entry. For example:: cols = ['1,2,3','4,...
[ "Interpret", "input", "ASCII", "file", "to", "return", "arrays", "for", "specified", "columns", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L450-L541
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
write_shiftfile
def write_shiftfile(image_list, filename, outwcs='tweak_wcs.fits'): """ Write out a shiftfile for a given list of input Image class objects """ rows = '' nrows = 0 for img in image_list: row = img.get_shiftfile_row() if row is not None: rows += row nrows += 1 ...
python
def write_shiftfile(image_list, filename, outwcs='tweak_wcs.fits'): """ Write out a shiftfile for a given list of input Image class objects """ rows = '' nrows = 0 for img in image_list: row = img.get_shiftfile_row() if row is not None: rows += row nrows += 1 ...
[ "def", "write_shiftfile", "(", "image_list", ",", "filename", ",", "outwcs", "=", "'tweak_wcs.fits'", ")", ":", "rows", "=", "''", "nrows", "=", "0", "for", "img", "in", "image_list", ":", "row", "=", "img", ".", "get_shiftfile_row", "(", ")", "if", "row...
Write out a shiftfile for a given list of input Image class objects
[ "Write", "out", "a", "shiftfile", "for", "a", "given", "list", "of", "input", "Image", "class", "objects" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L544-L572
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
createWcsHDU
def createWcsHDU(wcs): # noqa: N802 """ Generate a WCS header object that can be used to populate a reference WCS HDU. For most applications, stwcs.wcsutil.HSTWCS.wcs2header() will work just as well. """ header = wcs.to_header() header['EXTNAME'] = 'WCS' header['EXTVER'] = 1 # No...
python
def createWcsHDU(wcs): # noqa: N802 """ Generate a WCS header object that can be used to populate a reference WCS HDU. For most applications, stwcs.wcsutil.HSTWCS.wcs2header() will work just as well. """ header = wcs.to_header() header['EXTNAME'] = 'WCS' header['EXTVER'] = 1 # No...
[ "def", "createWcsHDU", "(", "wcs", ")", ":", "# noqa: N802", "header", "=", "wcs", ".", "to_header", "(", ")", "header", "[", "'EXTNAME'", "]", "=", "'WCS'", "header", "[", "'EXTVER'", "]", "=", "1", "# Now, update original image size information", "header", "...
Generate a WCS header object that can be used to populate a reference WCS HDU. For most applications, stwcs.wcsutil.HSTWCS.wcs2header() will work just as well.
[ "Generate", "a", "WCS", "header", "object", "that", "can", "be", "used", "to", "populate", "a", "reference", "WCS", "HDU", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L575-L609
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
gauss_array
def gauss_array(nx, ny=None, fwhm=1.0, sigma_x=None, sigma_y=None, zero_norm=False): """ Computes the 2D Gaussian with size nx*ny. Parameters ---------- nx : int ny : int [Default: None] Size of output array for the generated Gaussian. If ny == None, ...
python
def gauss_array(nx, ny=None, fwhm=1.0, sigma_x=None, sigma_y=None, zero_norm=False): """ Computes the 2D Gaussian with size nx*ny. Parameters ---------- nx : int ny : int [Default: None] Size of output array for the generated Gaussian. If ny == None, ...
[ "def", "gauss_array", "(", "nx", ",", "ny", "=", "None", ",", "fwhm", "=", "1.0", ",", "sigma_x", "=", "None", ",", "sigma_y", "=", "None", ",", "zero_norm", "=", "False", ")", ":", "if", "ny", "is", "None", ":", "ny", "=", "nx", "if", "sigma_x",...
Computes the 2D Gaussian with size nx*ny. Parameters ---------- nx : int ny : int [Default: None] Size of output array for the generated Gaussian. If ny == None, output will be an array nx X nx pixels. fwhm : float [Default: 1.0] Full-width, ...
[ "Computes", "the", "2D", "Gaussian", "with", "size", "nx", "*", "ny", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L659-L718
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
gauss
def gauss(x, sigma): """ Compute 1-D value of gaussian at position x relative to center.""" return (np.exp(-np.power(x, 2) / (2 * np.power(sigma, 2))) / (sigma * np.sqrt(2 * np.pi)))
python
def gauss(x, sigma): """ Compute 1-D value of gaussian at position x relative to center.""" return (np.exp(-np.power(x, 2) / (2 * np.power(sigma, 2))) / (sigma * np.sqrt(2 * np.pi)))
[ "def", "gauss", "(", "x", ",", "sigma", ")", ":", "return", "(", "np", ".", "exp", "(", "-", "np", ".", "power", "(", "x", ",", "2", ")", "/", "(", "2", "*", "np", ".", "power", "(", "sigma", ",", "2", ")", ")", ")", "/", "(", "sigma", ...
Compute 1-D value of gaussian at position x relative to center.
[ "Compute", "1", "-", "D", "value", "of", "gaussian", "at", "position", "x", "relative", "to", "center", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L721-L724
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
make_vector_plot
def make_vector_plot(coordfile, columns=[1, 2, 3, 4], data=None, figure_id=None, title=None, axes=None, every=1, labelsize=8, ylimit=None, limit=None, xlower=None, ylower=None, output=None, headl=4, headw=3, xsh=0.0, ysh=0.0, fit=None, ...
python
def make_vector_plot(coordfile, columns=[1, 2, 3, 4], data=None, figure_id=None, title=None, axes=None, every=1, labelsize=8, ylimit=None, limit=None, xlower=None, ylower=None, output=None, headl=4, headw=3, xsh=0.0, ysh=0.0, fit=None, ...
[ "def", "make_vector_plot", "(", "coordfile", ",", "columns", "=", "[", "1", ",", "2", ",", "3", ",", "4", "]", ",", "data", "=", "None", ",", "figure_id", "=", "None", ",", "title", "=", "None", ",", "axes", "=", "None", ",", "every", "=", "1", ...
Convert a XYXYMATCH file into a vector plot or set of residuals plots. This function provides a single interface for generating either a vector plot of residuals or a set of 4 plots showing residuals. The data being plotted can also be adjusted for a linear fit on-the-fly. Para...
[ "Convert", "a", "XYXYMATCH", "file", "into", "a", "vector", "plot", "or", "set", "of", "residuals", "plots", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L728-L964
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
find_xy_peak
def find_xy_peak(img, center=None, sigma=3.0): """ Find the center of the peak of offsets """ # find level of noise in histogram istats = imagestats.ImageStats(img.astype(np.float32), nclip=1, fields='stddev,mode,mean,max,min') if istats.stddev == 0.0: istats =...
python
def find_xy_peak(img, center=None, sigma=3.0): """ Find the center of the peak of offsets """ # find level of noise in histogram istats = imagestats.ImageStats(img.astype(np.float32), nclip=1, fields='stddev,mode,mean,max,min') if istats.stddev == 0.0: istats =...
[ "def", "find_xy_peak", "(", "img", ",", "center", "=", "None", ",", "sigma", "=", "3.0", ")", ":", "# find level of noise in histogram", "istats", "=", "imagestats", ".", "ImageStats", "(", "img", ".", "astype", "(", "np", ".", "float32", ")", ",", "nclip"...
Find the center of the peak of offsets
[ "Find", "the", "center", "of", "the", "peak", "of", "offsets" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L1000-L1054
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
plot_zeropoint
def plot_zeropoint(pars): """ Plot 2d histogram. Pars will be a dictionary containing: data, figure_id, vmax, title_str, xp,yp, searchrad """ from matplotlib import pyplot as plt xp = pars['xp'] yp = pars['yp'] searchrad = int(pars['searchrad'] + 0.5) plt.figure(num=pars['figu...
python
def plot_zeropoint(pars): """ Plot 2d histogram. Pars will be a dictionary containing: data, figure_id, vmax, title_str, xp,yp, searchrad """ from matplotlib import pyplot as plt xp = pars['xp'] yp = pars['yp'] searchrad = int(pars['searchrad'] + 0.5) plt.figure(num=pars['figu...
[ "def", "plot_zeropoint", "(", "pars", ")", ":", "from", "matplotlib", "import", "pyplot", "as", "plt", "xp", "=", "pars", "[", "'xp'", "]", "yp", "=", "pars", "[", "'yp'", "]", "searchrad", "=", "int", "(", "pars", "[", "'searchrad'", "]", "+", "0.5"...
Plot 2d histogram. Pars will be a dictionary containing: data, figure_id, vmax, title_str, xp,yp, searchrad
[ "Plot", "2d", "histogram", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L1057-L1101
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
build_xy_zeropoint
def build_xy_zeropoint(imgxy, refxy, searchrad=3.0, histplot=False, figure_id=1, plotname=None, interactive=True): """ Create a matrix which contains the delta between each XY position and each UV position. """ print('Computing initial guess for X and Y shifts...') # run ...
python
def build_xy_zeropoint(imgxy, refxy, searchrad=3.0, histplot=False, figure_id=1, plotname=None, interactive=True): """ Create a matrix which contains the delta between each XY position and each UV position. """ print('Computing initial guess for X and Y shifts...') # run ...
[ "def", "build_xy_zeropoint", "(", "imgxy", ",", "refxy", ",", "searchrad", "=", "3.0", ",", "histplot", "=", "False", ",", "figure_id", "=", "1", ",", "plotname", "=", "None", ",", "interactive", "=", "True", ")", ":", "print", "(", "'Computing initial gue...
Create a matrix which contains the delta between each XY position and each UV position.
[ "Create", "a", "matrix", "which", "contains", "the", "delta", "between", "each", "XY", "position", "and", "each", "UV", "position", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L1105-L1154
spacetelescope/drizzlepac
drizzlepac/tweakutils.py
build_pos_grid
def build_pos_grid(start, end, nstep, mesh=False): """ Return a grid of positions starting at X,Y given by 'start', and ending at X,Y given by 'end'. The grid will be completely filled in X and Y by every 'step' interval. """ # Build X and Y arrays dx = end[0] - start[0] if dx < 0: ...
python
def build_pos_grid(start, end, nstep, mesh=False): """ Return a grid of positions starting at X,Y given by 'start', and ending at X,Y given by 'end'. The grid will be completely filled in X and Y by every 'step' interval. """ # Build X and Y arrays dx = end[0] - start[0] if dx < 0: ...
[ "def", "build_pos_grid", "(", "start", ",", "end", ",", "nstep", ",", "mesh", "=", "False", ")", ":", "# Build X and Y arrays", "dx", "=", "end", "[", "0", "]", "-", "start", "[", "0", "]", "if", "dx", "<", "0", ":", "nstart", "=", "end", "end", ...
Return a grid of positions starting at X,Y given by 'start', and ending at X,Y given by 'end'. The grid will be completely filled in X and Y by every 'step' interval.
[ "Return", "a", "grid", "of", "positions", "starting", "at", "X", "Y", "given", "by", "start", "and", "ending", "at", "X", "Y", "given", "by", "end", ".", "The", "grid", "will", "be", "completely", "filled", "in", "X", "and", "Y", "by", "every", "step...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/tweakutils.py#L1158-L1182
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.find_DQ_extension
def find_DQ_extension(self): """ Return the suffix for the data quality extension and the name of the file which that DQ extension should be read from. """ dqfile = None # Look for additional file with DQ array, primarily for WFPC2 data indx = self._filename.find('.fits...
python
def find_DQ_extension(self): """ Return the suffix for the data quality extension and the name of the file which that DQ extension should be read from. """ dqfile = None # Look for additional file with DQ array, primarily for WFPC2 data indx = self._filename.find('.fits...
[ "def", "find_DQ_extension", "(", "self", ")", ":", "dqfile", "=", "None", "# Look for additional file with DQ array, primarily for WFPC2 data", "indx", "=", "self", ".", "_filename", ".", "find", "(", "'.fits'", ")", "if", "indx", ">", "3", ":", "suffix", "=", "...
Return the suffix for the data quality extension and the name of the file which that DQ extension should be read from.
[ "Return", "the", "suffix", "for", "the", "data", "quality", "extension", "and", "the", "name", "of", "the", "file", "which", "that", "DQ", "extension", "should", "be", "read", "from", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L58-L97
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.setInstrumentParameters
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header self.proc_unit = instrpars['proc_unit'] instrpars['gn...
python
def setInstrumentParameters(self, instrpars): """ This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided. """ pri_header = self._image[0].header self.proc_unit = instrpars['proc_unit'] instrpars['gn...
[ "def", "setInstrumentParameters", "(", "self", ",", "instrpars", ")", ":", "pri_header", "=", "self", ".", "_image", "[", "0", "]", ".", "header", "self", ".", "proc_unit", "=", "instrpars", "[", "'proc_unit'", "]", "instrpars", "[", "'gnkeyword'", "]", "=...
This method overrides the superclass to set default values into the parameter dictionary, in case empty entries are provided.
[ "This", "method", "overrides", "the", "superclass", "to", "set", "default", "values", "into", "the", "parameter", "dictionary", "in", "case", "empty", "entries", "are", "provided", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L111-L165
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.doUnitConversions
def doUnitConversions(self): """ Apply unit conversions to all the chips, ignoring the group parameter. This insures that all the chips get the same conversions when this gets done, even if only 1 chip was specified to be processed. """ # Image information _handl...
python
def doUnitConversions(self): """ Apply unit conversions to all the chips, ignoring the group parameter. This insures that all the chips get the same conversions when this gets done, even if only 1 chip was specified to be processed. """ # Image information _handl...
[ "def", "doUnitConversions", "(", "self", ")", ":", "# Image information", "_handle", "=", "fileutil", ".", "openImage", "(", "self", ".", "_filename", ",", "mode", "=", "'readonly'", ",", "memmap", "=", "False", ")", "# Now convert the SCI array(s) units", "for", ...
Apply unit conversions to all the chips, ignoring the group parameter. This insures that all the chips get the same conversions when this gets done, even if only 1 chip was specified to be processed.
[ "Apply", "unit", "conversions", "to", "all", "the", "chips", "ignoring", "the", "group", "parameter", ".", "This", "insures", "that", "all", "the", "chips", "get", "the", "same", "conversions", "when", "this", "gets", "done", "even", "if", "only", "1", "ch...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L182-L227
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.getdarkcurrent
def getdarkcurrent(self,exten): """ Return the dark current for the WFPC2 detector. This value will be contained within an instrument specific keyword. The value in the image header will be converted to units of electrons. Returns ------- darkcurrent : f...
python
def getdarkcurrent(self,exten): """ Return the dark current for the WFPC2 detector. This value will be contained within an instrument specific keyword. The value in the image header will be converted to units of electrons. Returns ------- darkcurrent : f...
[ "def", "getdarkcurrent", "(", "self", ",", "exten", ")", ":", "darkrate", "=", "0.005", "# electrons / s", "if", "self", ".", "proc_unit", "==", "'native'", ":", "darkrate", "=", "darkrate", "/", "self", ".", "getGain", "(", "exten", ")", "#count/s", "try"...
Return the dark current for the WFPC2 detector. This value will be contained within an instrument specific keyword. The value in the image header will be converted to units of electrons. Returns ------- darkcurrent : float Dark current for the WFPC3 detector...
[ "Return", "the", "dark", "current", "for", "the", "WFPC2", "detector", ".", "This", "value", "will", "be", "contained", "within", "an", "instrument", "specific", "keyword", ".", "The", "value", "in", "the", "image", "header", "will", "be", "converted", "to",...
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L229-L264
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.getReadNoise
def getReadNoise(self, exten): """ Method for returning the readnoise of a detector (in counts). Returns ------- readnoise : float The readnoise of the detector in **units of counts/electrons**. """ rn = self._image[exten]._rdnoise if self.pr...
python
def getReadNoise(self, exten): """ Method for returning the readnoise of a detector (in counts). Returns ------- readnoise : float The readnoise of the detector in **units of counts/electrons**. """ rn = self._image[exten]._rdnoise if self.pr...
[ "def", "getReadNoise", "(", "self", ",", "exten", ")", ":", "rn", "=", "self", ".", "_image", "[", "exten", "]", ".", "_rdnoise", "if", "self", ".", "proc_unit", "==", "'native'", ":", "rn", "=", "self", ".", "_rdnoise", "/", "self", ".", "getGain", ...
Method for returning the readnoise of a detector (in counts). Returns ------- readnoise : float The readnoise of the detector in **units of counts/electrons**.
[ "Method", "for", "returning", "the", "readnoise", "of", "a", "detector", "(", "in", "counts", ")", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L266-L279
spacetelescope/drizzlepac
drizzlepac/wfpc2Data.py
WFPC2InputImage.buildMask
def buildMask(self, chip, bits=0, write=False): """ Build masks as specified in the user parameters found in the configObj object. """ sci_chip = self._image[self.scienceExt,chip] ### For WFPC2 Data, build mask files using: maskname = sci_chip.dqrootname+'_dqmask.fits...
python
def buildMask(self, chip, bits=0, write=False): """ Build masks as specified in the user parameters found in the configObj object. """ sci_chip = self._image[self.scienceExt,chip] ### For WFPC2 Data, build mask files using: maskname = sci_chip.dqrootname+'_dqmask.fits...
[ "def", "buildMask", "(", "self", ",", "chip", ",", "bits", "=", "0", ",", "write", "=", "False", ")", ":", "sci_chip", "=", "self", ".", "_image", "[", "self", ".", "scienceExt", ",", "chip", "]", "### For WFPC2 Data, build mask files using:", "maskname", ...
Build masks as specified in the user parameters found in the configObj object.
[ "Build", "masks", "as", "specified", "in", "the", "user", "parameters", "found", "in", "the", "configObj", "object", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/wfpc2Data.py#L281-L293
spacetelescope/drizzlepac
drizzlepac/catalogs.py
generateCatalog
def generateCatalog(wcs, mode='automatic', catalog=None, src_find_filters=None, **kwargs): """ Function which determines what type of catalog object needs to be instantiated based on what type of source selection algorithm the user specified. Parameters ---------- wcs : obj ...
python
def generateCatalog(wcs, mode='automatic', catalog=None, src_find_filters=None, **kwargs): """ Function which determines what type of catalog object needs to be instantiated based on what type of source selection algorithm the user specified. Parameters ---------- wcs : obj ...
[ "def", "generateCatalog", "(", "wcs", ",", "mode", "=", "'automatic'", ",", "catalog", "=", "None", ",", "src_find_filters", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "isinstance", "(", "catalog", ",", "Catalog", ")", ":", "if", "mod...
Function which determines what type of catalog object needs to be instantiated based on what type of source selection algorithm the user specified. Parameters ---------- wcs : obj WCS object generated by STWCS or PyWCS catalog : str or ndarray Filename of existing catalog or nd...
[ "Function", "which", "determines", "what", "type", "of", "catalog", "object", "needs", "to", "be", "instantiated", "based", "on", "what", "type", "of", "source", "selection", "algorithm", "the", "user", "specified", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L43-L76
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.generateRaDec
def generateRaDec(self): """ Convert XY positions into sky coordinates using STWCS methods. """ self.prefix = self.PAR_PREFIX if not isinstance(self.wcs,pywcs.WCS): print( textutil.textbox( 'WCS not a valid PyWCS object. ' 'Con...
python
def generateRaDec(self): """ Convert XY positions into sky coordinates using STWCS methods. """ self.prefix = self.PAR_PREFIX if not isinstance(self.wcs,pywcs.WCS): print( textutil.textbox( 'WCS not a valid PyWCS object. ' 'Con...
[ "def", "generateRaDec", "(", "self", ")", ":", "self", ".", "prefix", "=", "self", ".", "PAR_PREFIX", "if", "not", "isinstance", "(", "self", ".", "wcs", ",", "pywcs", ".", "WCS", ")", ":", "print", "(", "textutil", ".", "textbox", "(", "'WCS not a val...
Convert XY positions into sky coordinates using STWCS methods.
[ "Convert", "XY", "positions", "into", "sky", "coordinates", "using", "STWCS", "methods", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L162-L197
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.apply_exclusions
def apply_exclusions(self,exclusions): """ Trim sky catalog to remove any sources within regions specified by exclusions file. """ # parse exclusion file into list of positions and distances exclusion_coords = tweakutils.parse_exclusions(exclusions) if exclusion_coord...
python
def apply_exclusions(self,exclusions): """ Trim sky catalog to remove any sources within regions specified by exclusions file. """ # parse exclusion file into list of positions and distances exclusion_coords = tweakutils.parse_exclusions(exclusions) if exclusion_coord...
[ "def", "apply_exclusions", "(", "self", ",", "exclusions", ")", ":", "# parse exclusion file into list of positions and distances", "exclusion_coords", "=", "tweakutils", ".", "parse_exclusions", "(", "exclusions", ")", "if", "exclusion_coords", "is", "None", ":", "return...
Trim sky catalog to remove any sources within regions specified by exclusions file.
[ "Trim", "sky", "catalog", "to", "remove", "any", "sources", "within", "regions", "specified", "by", "exclusions", "file", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L199-L241
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.apply_flux_limits
def apply_flux_limits(self): """ Apply any user-specified limits on source selection Limits based on fluxes. """ if not self._apply_flux_limits: return # only if limits are set should they be applied if ((self.maxflux is None and self.minflux is None) or...
python
def apply_flux_limits(self): """ Apply any user-specified limits on source selection Limits based on fluxes. """ if not self._apply_flux_limits: return # only if limits are set should they be applied if ((self.maxflux is None and self.minflux is None) or...
[ "def", "apply_flux_limits", "(", "self", ")", ":", "if", "not", "self", ".", "_apply_flux_limits", ":", "return", "# only if limits are set should they be applied", "if", "(", "(", "self", ".", "maxflux", "is", "None", "and", "self", ".", "minflux", "is", "None"...
Apply any user-specified limits on source selection Limits based on fluxes.
[ "Apply", "any", "user", "-", "specified", "limits", "on", "source", "selection", "Limits", "based", "on", "fluxes", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L243-L337
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.buildCatalogs
def buildCatalogs(self, exclusions=None, **kwargs): """ Primary interface to build catalogs based on user inputs. """ self.generateXY(**kwargs) self.generateRaDec() if exclusions: self.apply_exclusions(exclusions) # apply selection limits as specified by the ...
python
def buildCatalogs(self, exclusions=None, **kwargs): """ Primary interface to build catalogs based on user inputs. """ self.generateXY(**kwargs) self.generateRaDec() if exclusions: self.apply_exclusions(exclusions) # apply selection limits as specified by the ...
[ "def", "buildCatalogs", "(", "self", ",", "exclusions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "self", ".", "generateXY", "(", "*", "*", "kwargs", ")", "self", ".", "generateRaDec", "(", ")", "if", "exclusions", ":", "self", ".", "apply_exclus...
Primary interface to build catalogs based on user inputs.
[ "Primary", "interface", "to", "build", "catalogs", "based", "on", "user", "inputs", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L339-L348
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.plotXYCatalog
def plotXYCatalog(self, **kwargs): """ Method which displays the original image and overlays the positions of the detected sources from this image's catalog. Plotting `kwargs` that can be provided are: vmin, vmax, cmap, marker Default colormap is `summer`. ...
python
def plotXYCatalog(self, **kwargs): """ Method which displays the original image and overlays the positions of the detected sources from this image's catalog. Plotting `kwargs` that can be provided are: vmin, vmax, cmap, marker Default colormap is `summer`. ...
[ "def", "plotXYCatalog", "(", "self", ",", "*", "*", "kwargs", ")", ":", "try", ":", "from", "matplotlib", "import", "pyplot", "as", "pl", "except", ":", "pl", "=", "None", "if", "pl", "is", "not", "None", ":", "# If the pyplot package could be loaded...", ...
Method which displays the original image and overlays the positions of the detected sources from this image's catalog. Plotting `kwargs` that can be provided are: vmin, vmax, cmap, marker Default colormap is `summer`.
[ "Method", "which", "displays", "the", "original", "image", "and", "overlays", "the", "positions", "of", "the", "detected", "sources", "from", "this", "image", "s", "catalog", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L350-L389
spacetelescope/drizzlepac
drizzlepac/catalogs.py
Catalog.writeXYCatalog
def writeXYCatalog(self,filename): """ Write out the X,Y catalog to a file """ if self.xypos is None: warnstr = textutil.textbox( 'WARNING: \n No X,Y source catalog to write to file. ') for line in warnstr.split('\n'): log.warning(line) ...
python
def writeXYCatalog(self,filename): """ Write out the X,Y catalog to a file """ if self.xypos is None: warnstr = textutil.textbox( 'WARNING: \n No X,Y source catalog to write to file. ') for line in warnstr.split('\n'): log.warning(line) ...
[ "def", "writeXYCatalog", "(", "self", ",", "filename", ")", ":", "if", "self", ".", "xypos", "is", "None", ":", "warnstr", "=", "textutil", ".", "textbox", "(", "'WARNING: \\n No X,Y source catalog to write to file. '", ")", "for", "line", "in", "warnstr", "....
Write out the X,Y catalog to a file
[ "Write", "out", "the", "X", "Y", "catalog", "to", "a", "file" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L391-L416
spacetelescope/drizzlepac
drizzlepac/catalogs.py
ImageCatalog.generateXY
def generateXY(self, **kwargs): """ Generate source catalog from input image using DAOFIND-style algorithm """ #x,y,flux,sharp,round = idlphot.find(array,self.pars['hmin'],self.pars['fwhm'], # roundlim=self.pars['roundlim'], sharplim=self.pars['sharplim']) prin...
python
def generateXY(self, **kwargs): """ Generate source catalog from input image using DAOFIND-style algorithm """ #x,y,flux,sharp,round = idlphot.find(array,self.pars['hmin'],self.pars['fwhm'], # roundlim=self.pars['roundlim'], sharplim=self.pars['sharplim']) prin...
[ "def", "generateXY", "(", "self", ",", "*", "*", "kwargs", ")", ":", "#x,y,flux,sharp,round = idlphot.find(array,self.pars['hmin'],self.pars['fwhm'],", "# roundlim=self.pars['roundlim'], sharplim=self.pars['sharplim'])", "print", "(", "\" # Source finding for '{}', E...
Generate source catalog from input image using DAOFIND-style algorithm
[ "Generate", "source", "catalog", "from", "input", "image", "using", "DAOFIND", "-", "style", "algorithm" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L541-L633
spacetelescope/drizzlepac
drizzlepac/catalogs.py
UserCatalog.generateXY
def generateXY(self, **kwargs): """ Method to interpret input catalog file as columns of positions and fluxes. """ self.num_objects = 0 xycols = self._readCatalog() if xycols is not None: # convert the catalog into attribute self.xypos = xycols[:3...
python
def generateXY(self, **kwargs): """ Method to interpret input catalog file as columns of positions and fluxes. """ self.num_objects = 0 xycols = self._readCatalog() if xycols is not None: # convert the catalog into attribute self.xypos = xycols[:3...
[ "def", "generateXY", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "num_objects", "=", "0", "xycols", "=", "self", ".", "_readCatalog", "(", ")", "if", "xycols", "is", "not", "None", ":", "# convert the catalog into attribute", "self", ".", ...
Method to interpret input catalog file as columns of positions and fluxes.
[ "Method", "to", "interpret", "input", "catalog", "file", "as", "columns", "of", "positions", "and", "fluxes", "." ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L694-L730
spacetelescope/drizzlepac
drizzlepac/catalogs.py
UserCatalog.plotXYCatalog
def plotXYCatalog(self, **kwargs): """ Plots the source catalog positions using matplotlib's `pyplot.plot()` Plotting `kwargs` that can also be passed include any keywords understood by matplotlib's `pyplot.plot()` function such as:: vmin, vmax, cmap, marker """ ...
python
def plotXYCatalog(self, **kwargs): """ Plots the source catalog positions using matplotlib's `pyplot.plot()` Plotting `kwargs` that can also be passed include any keywords understood by matplotlib's `pyplot.plot()` function such as:: vmin, vmax, cmap, marker """ ...
[ "def", "plotXYCatalog", "(", "self", ",", "*", "*", "kwargs", ")", ":", "try", ":", "from", "matplotlib", "import", "pyplot", "as", "pl", "except", ":", "pl", "=", "None", "if", "pl", "is", "not", "None", ":", "pl", ".", "clf", "(", ")", "pl", "....
Plots the source catalog positions using matplotlib's `pyplot.plot()` Plotting `kwargs` that can also be passed include any keywords understood by matplotlib's `pyplot.plot()` function such as:: vmin, vmax, cmap, marker
[ "Plots", "the", "source", "catalog", "positions", "using", "matplotlib", "s", "pyplot", ".", "plot", "()" ]
train
https://github.com/spacetelescope/drizzlepac/blob/15bec3c929a6a869d9e71b9398ced43ede0620f1/drizzlepac/catalogs.py#L732-L749