Skip to content

Commit

Permalink
HLA-837: Invalid Reference to Pyraf (spacetelescope#1726)
Browse files Browse the repository at this point in the history
Co-authored-by: codesee-maps[bot] <86324825+codesee-maps[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and mdlpstsci committed Feb 21, 2024
1 parent b650e5f commit a7bdd08
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 82 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened]

name: CodeSee

permissions: read-all

jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
name: Analyze the repo with CodeSee
steps:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
codesee-url: https://app.codesee.io
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ coverage.xml
*.egg-info
*.swp
*~
astrodrizzle.log
hapcut_utility.log
headerlet.log
svm_poller_file.txt
.vscode/settings.json
2 changes: 1 addition & 1 deletion doc/source/mast_data_products/astrometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ The **only** WCS solution that gets used to perform coordinate transformations o

Dependent Packages
^^^^^^^^^^^^^^^^^^^^
Working with the WCS solutions and headerlets gets performed using `STWCS package <https://stwcs.readthedocs.io/en/latest/>`_. Examples of how to work with this package will assume that the user has already installed this package into their working Python environment and has started a python shell. In addition, the following example relies on the Astropy IO package to work with the FITS headers and extensions.
Working with the WCS solutions and headerlets gets performed using `STWCS package <https://stwcs.readthedocs.io/en/latest/>`_. Examples of how to work with this package will assume that the user has already installed this package into their working Python environment and has started a Python shell. In addition, the following example relies on the Astropy IO package to work with the FITS headers and extensions.

Finally, the example described here will rely on additional functionality included in the V3.2.0 or later of the Drizzlepac package. These new functions support the generation of drizzle combined products which have been aligned to an astrometric standard catalog such as GAIA DR2.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/mast_data_products/catalog_generation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contains all default pipeline parameters and allows users to adjust any/or all o
overwriting the hard-coded default values stored in /drizzlepac/pars/hap_pars/svm_parameters/. To run the single-visit
mosaic pipeline using the custom parameter file, users simply need to specify the name of the file with the '-c'
optional command-line argument when using `~drizzlepac.runsinglehap` or the 'input_custom_pars_file' optional input
argument when executing ``run_hap_processing()`` in `~drizzlepac.hapsequencer` from Python or from another python script.
argument when executing ``run_hap_processing()`` in `~drizzlepac.hapsequencer` from Python or from another Python script.

.. warning::
Modification of values in the parameter files stored in /drizzlepac/pars/hap_pars/svm_parameters/ is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ GUI Usage under Python (Legacy only)
>>> import wfc3tools
>>> cfg = teal.teal('runastrodriz')

PyRAF Usage (Legacy only)
=========================

>>> epar runastrodriz



Options
=======
Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/adrizzle.help
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ of them::

Examples
--------
Basic example of how to call static yourself from a python command line,
Basic example of how to call static yourself from a Python command line,
using the default parameters for the task.

>>> from drizzlepac import adrizzle
Expand Down
26 changes: 6 additions & 20 deletions drizzlepac/astrodrizzle.help
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,7 @@ or ``AstroDrizzle`` from command line (Python interpreter)
Examples
---------

The ``AstroDrizzle`` task can be run from either the ``TEAL`` GUI or from the
command-line using ``PyRAF`` or Python. These examples illustrate the various
The ``AstroDrizzle`` task can be run from either the ``TEAL`` GUI or from Python. These examples illustrate the various
syntax options available.

**Example 1:** Drizzle a set of calibrated (``_flt.fits``) images using
Expand All @@ -1009,39 +1008,26 @@ ignore pixel flags of 64 and 32 in the DQ array of the (``_flt.fits``)
images. Align the final product such that North is
up, and set the final pixel scale to 0.05 arcseconds/pixel.

1. Run the task from ``PyRAF`` using the ``TEAL`` GUI::

>>> import drizzlepac
>>> epar astrodrizzle

2. Run the task from ``PyRAF`` using the command line. ::
Run the task from Python using the command line. ::

>>> import drizzlepac
>>> from drizzlepac import astrodrizzle
>>> astrodrizzle.AstroDrizzle('*flt.fits', output='final',
... wcskey='A', driz_sep_bits='64,32', final_wcs=True,
... final_scale=0.05, final_rot=0)

Or, run the same task from the PyRAF command line, but specify all
Or, run the same task from the Python command line, but specify all
parameters in a config file named ``myparam.cfg``:

>>> astrodrizzle.AstroDrizzle('*flt.fits', configobj='myparam.cfg')

3. Run the task directly from Python:

>>> from drizzlepac import astrodrizzle
>>> astrodrizzle.AstroDrizzle('*flt.fits', output='final',
... wcskey='A', driz_sep_bits='64,32', final_wcs=True,
... final_scale=0.05, final_rot=0)

4. Help can be accessed via the "Help" pulldown menu in the ``TEAL`` GUI.
It can also be accessed from the ``PyRAF`` command-line and saved
Help can be accessed via the "Help" pulldown menu in the ``TEAL`` GUI.
It can also be accessed from the Python command-line and saved
to a text file:

>>> from drizzlepac import astrodrizzle
>>> astrodrizzle.help()

or

>>> astrodrizzle.help(file='help.txt')
>>> page help.txt
>>> astrodrizzle.help(file='help.txt')
2 changes: 1 addition & 1 deletion drizzlepac/createMedian.help
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Parameters
----------

input : str or list of str (Default = None)
A python list of drizzled image filenames, or just a single filename.
A Python list of drizzled image filenames, or just a single filename.

configObj : configObject (Default = None)
An instance of ``configObject`` which overrides default parameter settings.
Expand Down
4 changes: 2 additions & 2 deletions drizzlepac/drizCR.help
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Parameters
----------

input : str or list of str (Default = None)
A python list of blotted median image filenames, or just a single
A Python list of blotted median image filenames, or just a single
filename.

configObj : configObject (Default = None)
Expand Down Expand Up @@ -81,7 +81,7 @@ input file with be directly altered.

Examples
--------
Basic example of how to call ``drizCR`` yourself from a python command line
Basic example of how to call ``drizCR`` yourself from a Python command line
using the default parameters for the task.

>>> from drizzlepac import drizCR
Expand Down
14 changes: 4 additions & 10 deletions drizzlepac/pixtopix.help
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ recognized distortion keywords from the input image header.

:Authors: Warren Hack

:License: `<http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE>`_
:License: :doc:`/LICENSE`


Parameters
Expand Down Expand Up @@ -87,16 +87,10 @@ stwcs

Examples
--------
This task can be run from either the TEAL GUI or from the Python
command-line. These examples illustrate the syntax that can be used
These examples illustrate the syntax that can be used
to run the task in a couple of common modes.

1. Run the task using the TEAL GUI under PyRAF:

>>> import drizzlepac
>>> epar pixtopix

2. Convert the position 256,256 from 'input_flt.fits[sci,1]'
1. Convert the position 256,256 from 'input_flt.fits[sci,1]'
into a position on the output image 'output_drz.fits[sci,1]' using:

>>> from drizzlepac import pixtopix
Expand All @@ -109,7 +103,7 @@ to run the task in a couple of common modes.
>>> outx,outy = pixtopix.tran("input_file_flt.fits[sci,1]",
... "output_drz.fits[sci,1],x=256,y=256)

3. The set of X,Y positions from 'output_drz.fits[sci,1]' stored as
2. The set of X,Y positions from 'output_drz.fits[sci,1]' stored as
the 3rd and 4th columns from the ASCII file ``xy_sci1.dat``
will be transformed into pixel positions from 'input_flt.fits[sci,1]'
and written out to ``xy_flt1.dat`` using:
Expand Down
21 changes: 7 additions & 14 deletions drizzlepac/pixtosky.help
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ distortion keywords from the input image header.

:Authors: Warren Hack

:License: `<http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE>`_
:License: :doc:`/LICENSE`


Parameters
Expand Down Expand Up @@ -75,31 +75,24 @@ stwcs

Examples
--------
This task can be run from either the TEAL GUI or from the Python
command-line. These examples illustrate the syntax that can be used
These examples illustrate the syntax that can be used
to run the task in a couple of common modes.

1. Run the task using the TEAL GUI under PyRAF:

>>> import drizzlepac
>>> epar pixtosky

2. Convert a single X,Y position (100,100) from an calibrated ACS image
(``j8bt06nyq_flt.fits``) into an undistorted sky position (RA,Dec)
without using the TEAL GUI:
1. Convert a single X,Y position (100,100) from an calibrated ACS image
(``j8bt06nyq_flt.fits``) into an undistorted sky position (RA,Dec):

>>> from drizzlepac import pixtosky
>>> r,d = pixtosky.xy2rd("j8bt06nyq_flt.fits[sci,1]", 100, 100)

3. Convert a list of X,Y positions from the file ``'xyfile.dat'`` for a
2. Convert a list of X,Y positions from the file ``'xyfile.dat'`` for a
calibrated ACS image (``j8bt06nyq_flt.fits``) into undistorted sky
positions and write out the result to the file 'radec.dat'
without using the TEAL GUI:
positions and write out the result to the file 'radec.dat':

>>> r,d = pixtosky.xy2rd("j8bt06nyq_flt.fits[sci,1]", coordfile="xyfile.dat",
... output="radec.dat")

4. The set of X,Y positions from ``'input_flt.fits[sci,1]'`` stored as
3. The set of X,Y positions from ``'input_flt.fits[sci,1]'`` stored as
the 3rd and 4th columns from the ASCII file ``'xy_sci1.dat'``
will be transformed and written out to ``'radec_sci1.dat'`` using:

Expand Down
4 changes: 2 additions & 2 deletions drizzlepac/sky.help
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Parameters
----------

input : str or list of str (Default = None)
A python list of image filenames, or just a single filename.
A Python list of image filenames, or just a single filename.

outExt : str (Default = None)
The extension of the output image. If the output already exists
Expand Down Expand Up @@ -415,7 +415,7 @@ directly altered.

Examples
--------
Basic example of how to call sky yourself from a python command line,
Basic example of how to call sky yourself from a Python command line,
this example will use the default parameter settings and subtract a sky
value from each ``*flt.fits`` image in the current directory,
saving the output file with the extension of "mysky":
Expand Down
12 changes: 3 additions & 9 deletions drizzlepac/skytopix.help
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ distortion keywords contained in the input image header.

:Authors: Warren Hack

:License: `<http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE>`_
:License: :doc:`/LICENSE`

Parameters
----------
Expand Down Expand Up @@ -70,24 +70,18 @@ See Also

Examples
--------
This task can be run from either the TEAL GUI, or from the Python command-line.
These examples illustrate the syntax that can be used to run the task in a
couple of common modes.

1. Run the task using the TEAL GUI under PyRAF:

>>> import drizzlepac
>>> epar skytopix

2. Convert a single sky position (0:22:07.0088,-72:03:05.429)
1. Convert a single sky position (0:22:07.0088,-72:03:05.429)
from a calibrated ACS image (j94f05bgq\_flt.fits) into a
pixel position (X,Y) without using the TEAL GUI:

>>> from drizzlepac import skytopix
>>> x,y = skytopix.rd2xy("j8bt06nyq_flt.fits[sci,1]",
... '0:22:07.0088', '-72:03:05.429')

3. Convert a list of (undistorted) sky positions from the file,
2. Convert a list of (undistorted) sky positions from the file,
'radec.dat' for a calibrated ACS image (j8bt06nyq_flt.fits)
into distorted pixel positions, and write out the result to
the file 'xypos.dat' without using the TEAL GUI:
Expand Down
21 changes: 7 additions & 14 deletions drizzlepac/tweakreg.help
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ to find all the sources *inside* the following regions::
Examples
--------
The tweakreg task can be run from either the TEAL GUI or from the command-line
using PyRAF or Python.
using Python.
These examples illustrate the various syntax options available.

**Example 1:** Align a set of calibrated (``_flt.fits``) images
Expand All @@ -612,12 +612,7 @@ as: ``1.5*imstat(image,nclip=3,fields='stddev')``. )
Set the convolution kernel width to ``~2x`` the value of the PSF FWHM.
Save the residual offsets (``dx``, ``dy``, ``rot``, ``scale``, ``xfit_rms``, ``yfit_rms``) to a text file.

1. Run the task from PyRAF using the TEAL GUI:

>>> import drizzlepac
>>> epar tweakreg

2. Run the task from PyRAF using the command line while individually
1. Run the task from Python using the command line while individually
specifying source finding parameters for the reference image and
input images:

Expand All @@ -637,7 +632,7 @@ Save the residual offsets (``dx``, ``dy``, ``rot``, ``scale``, ``xfit_rms``, ``y
... refimagefindcfg=dict(threshold=400, conv_width=2.5),
... updatehdr=False, shiftfile=True, outshifts='shift.txt')

Or, run the same task from the PyRAF command line, but specify all parameters in
Or, run the same task from the Python command line, but specify all parameters in
a config file named "myparam.cfg":

>>> tweakreg.TweakReg('*flt.fits', configobj='myparam.cfg')
Expand All @@ -647,17 +642,15 @@ Save the residual offsets (``dx``, ``dy``, ``rot``, ``scale``, ``xfit_rms``, ``y

>>> tweakreg.edit_imagefindpars()

3. Help can be accessed via the "Help" pulldown menu in the TEAL GUI. It can also
be accessed from the PyRAF command-line and saved to a text file:
2. Help can be accessed via the "Help" pulldown menu in the TEAL GUI. It can also
be accessed from the Python command-line and saved to a text file:

>>> from drizzlepac import tweakreg
>>> tweakreg.help()

or

>>> tweakreg.help(file='help.txt')
>>> page help.txt

>>> tweakreg.help(file='help.txt')

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/updatenpol.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def update(input, refdir="jref$",local=None, interactive=False, wcsupdate=True):
--------
1. A set of associated images specified by an ASN file can be updated to use
the NPOLFILEs and D2IMFILE found in the local directory defined using
the ``myjref$`` environment variable under PyRAF using::
the ``myjref$`` environment variable in python using::
>>> import updatenpol
>>> updatenpol.update('j8bt06010_asn.fits', 'myref$')
Expand Down

0 comments on commit a7bdd08

Please sign in to comment.