From a7bdd0819004296521e04ec1bd0e555d3401bfa1 Mon Sep 17 00:00:00 2001 From: Steve Goldman <32876747+s-goldman@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:47:06 -0500 Subject: [PATCH] HLA-837: Invalid Reference to Pyraf (#1726) Co-authored-by: codesee-maps[bot] <86324825+codesee-maps[bot]@users.noreply.github.com> --- .github/workflows/codesee-arch-diagram.yml | 23 ++++++++++++++++ .gitignore | 5 ++++ doc/source/mast_data_products/astrometry.rst | 2 +- .../mast_data_products/catalog_generation.rst | 2 +- .../reproducing_mast_data_products.rst | 6 ----- drizzlepac/adrizzle.help | 2 +- drizzlepac/astrodrizzle.help | 26 +++++-------------- drizzlepac/createMedian.help | 2 +- drizzlepac/drizCR.help | 4 +-- drizzlepac/pixtopix.help | 14 +++------- drizzlepac/pixtosky.help | 21 +++++---------- drizzlepac/sky.help | 4 +-- drizzlepac/skytopix.help | 12 +++------ drizzlepac/tweakreg.help | 21 +++++---------- drizzlepac/updatenpol.py | 2 +- 15 files changed, 64 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/codesee-arch-diagram.yml diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml new file mode 100644 index 000000000..806d41d12 --- /dev/null +++ b/.github/workflows/codesee-arch-diagram.yml @@ -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 diff --git a/.gitignore b/.gitignore index 4b450b19f..c2feed954 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,8 @@ coverage.xml *.egg-info *.swp *~ +astrodrizzle.log +hapcut_utility.log +headerlet.log +svm_poller_file.txt +.vscode/settings.json diff --git a/doc/source/mast_data_products/astrometry.rst b/doc/source/mast_data_products/astrometry.rst index d4aa31cfa..3d3d790bd 100644 --- a/doc/source/mast_data_products/astrometry.rst +++ b/doc/source/mast_data_products/astrometry.rst @@ -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 `_. 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 `_. 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. diff --git a/doc/source/mast_data_products/catalog_generation.rst b/doc/source/mast_data_products/catalog_generation.rst index e02f8ccac..5b5a614da 100644 --- a/doc/source/mast_data_products/catalog_generation.rst +++ b/doc/source/mast_data_products/catalog_generation.rst @@ -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 diff --git a/doc/source/mast_data_products/reproducing_mast_data_products.rst b/doc/source/mast_data_products/reproducing_mast_data_products.rst index b7613161c..2afc7021c 100644 --- a/doc/source/mast_data_products/reproducing_mast_data_products.rst +++ b/doc/source/mast_data_products/reproducing_mast_data_products.rst @@ -29,12 +29,6 @@ GUI Usage under Python (Legacy only) >>> import wfc3tools >>> cfg = teal.teal('runastrodriz') -PyRAF Usage (Legacy only) -========================= - - >>> epar runastrodriz - - Options ======= diff --git a/drizzlepac/adrizzle.help b/drizzlepac/adrizzle.help index 8657dea6e..07085d809 100644 --- a/drizzlepac/adrizzle.help +++ b/drizzlepac/adrizzle.help @@ -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 diff --git a/drizzlepac/astrodrizzle.help b/drizzlepac/astrodrizzle.help index 7a5226c39..a751637bf 100644 --- a/drizzlepac/astrodrizzle.help +++ b/drizzlepac/astrodrizzle.help @@ -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 @@ -1009,12 +1008,7 @@ 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 @@ -1022,20 +1016,13 @@ up, and set the final pixel scale to 0.05 arcseconds/pixel. ... 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 @@ -1043,5 +1030,4 @@ up, and set the final pixel scale to 0.05 arcseconds/pixel. or - >>> astrodrizzle.help(file='help.txt') - >>> page help.txt + >>> astrodrizzle.help(file='help.txt') \ No newline at end of file diff --git a/drizzlepac/createMedian.help b/drizzlepac/createMedian.help index 89a50b194..edcbcfa94 100644 --- a/drizzlepac/createMedian.help +++ b/drizzlepac/createMedian.help @@ -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. diff --git a/drizzlepac/drizCR.help b/drizzlepac/drizCR.help index 29f969a3e..729357b4c 100644 --- a/drizzlepac/drizCR.help +++ b/drizzlepac/drizCR.help @@ -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) @@ -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 diff --git a/drizzlepac/pixtopix.help b/drizzlepac/pixtopix.help index e013a73a0..3b18b2361 100644 --- a/drizzlepac/pixtopix.help +++ b/drizzlepac/pixtopix.help @@ -4,7 +4,7 @@ recognized distortion keywords from the input image header. :Authors: Warren Hack -:License: ``_ +:License: :doc:`/LICENSE` Parameters @@ -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 @@ -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: diff --git a/drizzlepac/pixtosky.help b/drizzlepac/pixtosky.help index ed798bdc0..d36c5bf67 100644 --- a/drizzlepac/pixtosky.help +++ b/drizzlepac/pixtosky.help @@ -4,7 +4,7 @@ distortion keywords from the input image header. :Authors: Warren Hack -:License: ``_ +:License: :doc:`/LICENSE` Parameters @@ -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: diff --git a/drizzlepac/sky.help b/drizzlepac/sky.help index 98d1d90a5..a898571a6 100644 --- a/drizzlepac/sky.help +++ b/drizzlepac/sky.help @@ -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 @@ -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": diff --git a/drizzlepac/skytopix.help b/drizzlepac/skytopix.help index 69eb142c9..8dc11e366 100644 --- a/drizzlepac/skytopix.help +++ b/drizzlepac/skytopix.help @@ -4,7 +4,7 @@ distortion keywords contained in the input image header. :Authors: Warren Hack -:License: ``_ +:License: :doc:`/LICENSE` Parameters ---------- @@ -70,16 +70,10 @@ 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: @@ -87,7 +81,7 @@ couple of common modes. >>> 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: diff --git a/drizzlepac/tweakreg.help b/drizzlepac/tweakreg.help index 38a76ac06..ffdb382c8 100644 --- a/drizzlepac/tweakreg.help +++ b/drizzlepac/tweakreg.help @@ -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 @@ -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: @@ -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') @@ -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 -------- diff --git a/drizzlepac/updatenpol.py b/drizzlepac/updatenpol.py index 68825f402..0fdc4ec1e 100755 --- a/drizzlepac/updatenpol.py +++ b/drizzlepac/updatenpol.py @@ -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$')