Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation changes #61

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ WFC3TOOLS
.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org
:alt: Powered by Astropy Badge


For more information please see the `online documentation <http://wfc3tools.readthedocs.io/>`_

You can also display the docs locally after install, import wfc3tools and then issue the following command to display the help docs in your local browser:
For more information please see the `online documentation <http://wfc3tools.readthedocs.io/>`_.

You can also display the docs locally after install, import ``wfc3tools`` and then issue the following command to display the help docs in your local browser:

::

Expand All @@ -37,12 +37,12 @@ leave a comment and we will be happy to assist. New contributions and
contributors are very welcome!

New to github or open source projects? If you are unsure about where to start
or haven't used github before, please feel free to contact `@sosey`.
or haven't used github before, please feel free to contact `HST Help Desk <https://stsci.service-now.com/hst>`_.

Feedback and feature requests? Is there something missing you would like
to see? Please open an issue or send an email to `@sosey`.
to see? Please open an issue or contact `HST Help Desk <https://stsci.service-now.com/hst>`_.

wfc3tools follows the `Astropy Code of Conduct`_ and strives to provide a
``wfc3tools`` follows the `Astropy Code of Conduct`_ and strives to provide a
welcoming community to all of our users and contributors.

Want more information about how to make a contribution? Take a look at
Expand All @@ -52,7 +52,7 @@ the the astropy `contributing`_ and `developer`_ documentation.
License
-------

wfc3tools is licensed under a 3-clause BSD style license (see the ``LICENSE.txt`` file).
``wfc3tools`` is licensed under a 3-clause BSD style license (see the ``LICENSE.txt`` file).

.. _AstroPy: http://www.astropy.org/
.. _contributing: http://docs.astropy.org/en/stable/index.html#contributing
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
WFC3 Python User Tools
===============================================
See the team website http://www.stsci.edu/hst/wfc3/ and the
`WFC3 Data Handbook <http://www.stsci.edu/hst/wfc3/documents/handbooks/currentDHB/>`_ for more information.
`WFC3 Data Handbook <https://hst-docs.stsci.edu/wfc3dhb>`_ for more information.


============================
Expand Down
86 changes: 40 additions & 46 deletions docs/wfc3tools/calwf3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ calwf3

.. note::

During automatic pipeline processing by the STScI archive, `Astrodrizzle` follows `calwf3`. All calibrated images are corrected for geometric distortion and associated sets of dithered images are combined into a single product. See the WFC3 Data Handbook for more information, or `Astrodrizzle <http://www.stsci.edu/hst/HST_overview/drizzlepac/>`_ .
During automatic pipeline processing by the STScI archive, `Astrodrizzle` follows `calwf3`. All calibrated images are corrected for geometric distortion and associated sets of dithered images are combined into a single product. See the WFC3 Data Handbook for more information, or `Astrodrizzle <https://www.stsci.edu/scientific-community/software/drizzlepac.html>`_ .


Where to Find calwf3
Expand All @@ -17,10 +17,10 @@ Where to Find calwf3
`calwf3` is part of HSTCAL package, which can be downloaded separately from its GIT repository in the `Spacetelescope <https://github.com/spacetelescope/hstcal>`_ area. It's binaries are also installed along with the STScI distributed package `Astroconda <http://astroconda.readthedocs.io/en/latest/installation.html>`_ .


A detailed description of the improvements in `calwf3 v3.3`, which is more generally referred to as the UVIS2.0 update, can be found in the `February 22, 2016 issue of the STAN <http://www.stsci.edu/hst/wfc3/documents/newsletters/STAN_02_23_2016#STANIssue22-CALWF3Version3.3>`_.
A detailed description of the improvements in `calwf3 v3.3`, which is more generally referred to as the UVIS2.0 update, can be found in the `February 22, 2016 issue of the STAN <https://www.stsci.edu/contents/news/wfc3-stans/wfc3-stan-issue-22-february-2016.html#h3-CK-04ec3e61-697b-4ea2-9259-75ae75075f63>`_.

The current WFC3 Data Handbook can be found at http://www.stsci.edu/hst/wfc3/documents/handbooks/currentDHB/ .
In the meantime, if you have questions not answered in this documentation, please contact STScI Help Desk (help[at]stsci.edu).
The current WFC3 Data Handbook can be found at https://www.stsci.edu/files/live/sites/www/files/home/hst/instrumentation/wfc3/_documents/wfc3_dhb.pdf .
In the meantime, if you have questions not answered in this documentation, please contact STScI Help Desk (help@stsci.edu).
You may also submit a github issue for either the HSTCAL or WFC3TOOLs repositories.

.. note::
Expand Down Expand Up @@ -53,51 +53,45 @@ The :ref:`wf3ccd`, :ref:`wf32d`, :ref:`wf3cte` and :ref:`wf3ir` tasks on the oth
Running `calwf3` from a python terminal using `wfc3tools`
---------------------------------------------------------

In Python without TEAL:

.. code-block:: python

from wfc3tools import calwf3
calwf3(filename)

In Python with TEAL:
Parameter Options
~~~~~~~~~~~~~~~~~
* input : str or list, default=None
Name of input files, such as
- a single filename (iaa012wdq_raw.fits)
- a Python list of filenames
- a partial filename with wildcards (\*raw.fits)
- filename of an ASN table (\*asn.fits)

.. code-block:: python
* output : WHAT IS TYPE, default=None
WHAT IS OUTPUT

from stsci.tools import teal
from wfc3tools import calwf3
teal.teal('calwf3')
* printtime : bool, default=False
If True, print a detailed time stamp.

Parameter Options
~~~~~~~~~~~~~~~~~
* input: str
Name of input files
* a single filename (iaa012wdq_raw.fits)
* a Python list of filenames
* a partial filename with wildcards (\*raw.fits)
* filename of an ASN table (\*asn.fits)
* printtime: bool
print a detailed time stamp
* save_tmp: bool
save temporary files
* debug: bool
print optionsl debugging statements
* parallel: bool
run the code with OpemMP parallel processing turned on for the UVIS CTE correction
* log_func: func()
if not specified, the print function is used for logging to facilitate use in the Jupyter notebook
* verbose: bool, optional
Print verbose time stamps?
* quiet: bool, optional
Print messages only to trailer file?


In Pyraf:
* save_tmp : bool, default=False
If True, save temporary files.

.. code-block:: python
* verbose : bool, optional, default=False
If True, print verbose time stamps.

* debug : bool, default=False
If True, print optional debugging statements.

* parallel : bool, default=True
If True, run the code with OpemMP parallel processing turned on for the
UVIS CTE correction.

* version : bool, default=False
If True, WHAT IS VERSION???

import wfc3tools
epar calwf3
* log_func : func(), default=print()
If not specified, the print function is used for logging to facilitate
use in the Jupyter notebook.


Running many files at the same time
Expand Down Expand Up @@ -140,17 +134,17 @@ with an input file and a list of options. This is the same executable that the w
calwf3.e -vts iaa012wdq_raw.fits


input: str
input : str
Name of input files
a single filename (``iaa012wdq_raw.fits``)
the filename of an ASN table (``*_asn.fits``)

-r : WHATEVER VERSION DOES
-t : print a detailed time stamp
-s : save temporary files
-v : print verbose time stamps and information
-d : print optional debugging statements
-1 : suppress the OpemMP parallel processing for the UVIS CTE correction
-v : Print verbose time stamps and information
-q : Print messages only to trailer file


Running many files at the same time
Expand All @@ -170,7 +164,7 @@ Types of files used as input to calwf3
* _raw file: name of an individual, uncalibrated exposure
* _crj file: name of any sub-product from an association table

While both CR-SPLIT and REPEAT-OBS exposures from an association get combined using `calwf3`, dithered observations from an association will be combined using `Astrodrizzle <http://www.stsci.edu/hst/HST_overview/drizzlepac/>`_. Images taken at a given dither position can be additionally CR-SPLIT (UVIS only) into multiple exposures.
While both CR-SPLIT and REPEAT-OBS exposures from an association get combined using `calwf3`, dithered observations from an association will be combined using `Astrodrizzle <https://www.stsci.edu/scientific-community/software/drizzlepac.html>`_. Images taken at a given dither position can be additionally CR-SPLIT (UVIS only) into multiple exposures.


When `calwf3` is given an input file, it first discovers which of the above types of files it has provided; a single image, an association table, or a product from an association table. It will then make sure the specified input exists. It then checks to see which DETECTOR the data was observed with and calls the appropriate processing pipeline, either UVIS or IR.
Expand Down Expand Up @@ -202,7 +196,7 @@ exposures are combined only with Astrodrizzle, which executes after `calwf3` has
finished processing all members.

PROD-RPT and PROD-CRJ products are combined useing :ref:`wf3rej` and all output files
have the cr? extension.
have the cr extension.

Here's an example of what an association table might contain:

Expand Down Expand Up @@ -309,13 +303,13 @@ _crc UVIS calibrated, CR rejected, CTE cleaned image :math:`e^{-}`
======== ================================================= ====================


** DRZ and DRC products are produced with Astrodrizzle, see `Astrodrizzle <http://www.stsci.edu/hst/HST_overview/drizzlepac/>`_ **
** DRZ and DRC products are produced with Astrodrizzle, see `Astrodrizzle <https://www.stsci.edu/scientific-community/software/drizzlepac.html>`_ **


Keyword Usage
-------------

`calwf3` processing is controlled by the values of keywords in the input image headers. Certain keywords, referred to as calibration switches, are used to control which calibration steps are performed. Reference file keywords indicate which reference files to use in the various calibration steps. Users who wish to perform custom reprocessing of their data may change the values of these keywords in the `_raw` FITS file primary headers and then rerun the modified file through `calwf3`. See the `WFC3 Data Handbook <http://www.stsci.edu/hst/wfc3/documents/handbooks/currentDHB/wfc3_Ch25.html>`_ for a more complete description of these keywords and their values.
`calwf3` processing is controlled by the values of keywords in the input image headers. Certain keywords, referred to as calibration switches, are used to control which calibration steps are performed. Reference file keywords indicate which reference files to use in the various calibration steps. Users who wish to perform custom reprocessing of their data may change the values of these keywords in the `_raw` FITS file primary headers and then rerun the modified file through `calwf3`. See the `WFC3 Data Handbook <https://www.stsci.edu/files/live/sites/www/files/home/hst/instrumentation/wfc3/_documents/wfc3_dhb.pdf>`_ for a more complete description of these keywords and their values.


Using CRDS to update your reference files
Expand Down
34 changes: 17 additions & 17 deletions docs/wfc3tools/embedsub.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ embedsub

Given an image specified by the user which contains a subarray readout, return a full-frame image with the subarray implanted at the appropriate location.

Usage
=====

.. code-block:: python

python
from wfc3tools import embedsub
embedsub(files)


Parameters
==========

files [file]
Input image name or list of image names. The rootname will be used to create the output name.

* files : str or list
The name of the image file containing the subarray. This can be a
single filename or a list of files. The ippsoot will be used to
construct the output filename. You should input an FLT image.


Returns
=======
Return the full-frame location of the subarray coordinates using a file specified by the user.

* None


Usage
=====

.. code-block:: python

from wfc3tools import embedsub
embedsub(files)


Example Output
==============

This method calls wfc3tools.sub2full to calculation the subarray position on the full frame image.

This is the default output:

::
.. code-block:: python

wfc3tools.embedsub.embedsub('ic5p02eeq_flt.fits')
embedsub('ic5p02eeq_flt.fits')
Subarray image section [x1,x2,y1,y2] = [2828:3339,215:726]
Image saved to: ic5p02eef_flt.fits
86 changes: 49 additions & 37 deletions docs/wfc3tools/pstack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,6 @@ but you can plot either counts or rate using the optional keyword ``units``.
.. figure:: ../_static/pstack_example.png
:align: center

::

In [1]: xdata,ydata=pstack.pstack('ibh719grq_ima.fits',column=100,row=25,extname='sci')


The plotting data is returned as two arrays, to save them into variables issue the command as above:

::


In [1]: xdata
Out[2]:
array([ 100.651947, 93.470573, 86.2892 , 79.107826, 71.926453,
64.745079, 57.563702, 50.382328, 43.200954, 36.019581,
28.838205, 21.65683 , 14.475455, 7.29408 , 0.112705,
0. ])

In [3]: ydata
Out[4]:
array([ 221.36606389, 219.5396653 , 182.63100095, 169.178308 ,
186.44084352, 158.3105126 , 129.46997895, 129.92935701,
106.14521852, 72.71721539, 69.68652119, 55.98828663,
42.30755279, 13.12659422, 27.71404187, 0. ])



.. Warning::
Note that the arrays are structured in SCI order, so the final exposure is the first element in the array
Expand All @@ -57,36 +32,73 @@ The plotting data is returned as two arrays, to save them into variables issue t
Parameters
==========

* input [file]
* filename : str
Input MultiAccum image name. This should be either a _ima or _raw file, containing all the data from multiple readouts. You must specify just the file name, with no extension designation.

* col [integer]
* column : int, default=0
The column index of the pixel to be plotted.

* row [integer]
* row : int, default=0
The row index of the pixel to be plotted.

* extname = "sci" [string, allowed values: sci | err | dq | samp | time]
Extension name (EXTNAME keyword value) of data to plot.
* extname : str, default="sci"
Extension name (EXTNAME keyword value) of data to plot. Allowed values are "sci", "err", "dq", "samp", and "time".

* units = "counts" [string, allowed values: counts | rate]
Plot "sci" or "err" data in units of counts or countrate ("rate"). Input data can be in either unit; conversion will be performed automatically. Ignored when plotting "dq", "samp", or "time" data.
* units : str, default="counts"
Plot "sci" or "err" data in units of counts or countrate ("rate"). Input data can be in either unit; conversion will be performed automatically. Ignored when plotting "dq", "samp", or "time" data. Allowed values are "counts" and "rate".

* title = "" [string]
* title : str, default=None
Title for the plot. If left blank, the name of the input image, appended with the extname and column and row being plotted, is used.

* xlabel = "" [string]
* xlabel : str, default=None
Label for the X-axis of the plot. If left blank, a suitable default is generated.

* ylabel = "" [string]
* ylabel : str, default=None
Label for the Y-axis of the plot. If left blank, a suitable default based on the plot units and the extname of the data is generated.

* plot = True [bool] set plot to false if you only want the data returned
* plot : bool, default=True
If False, return data and do not plot.

Returns
=======

* xaxis : numpy.ndarray
Array of x-axis values that will be plotted.

* yaxis : numpuy.ndarray
Array of y-axis values that will be plotted as specified by 'units'.

Usage
=====

.. code-block:: python

from wfc3tools import pstack
xdata,ydata=pstack(inputFilename,column=x,row=y,extname="sci",units="counts|rate",title="",ylabel="",xlabel="")
xdata,ydata=pstack(inputFilename,column=x,row=y,extname="sci",units="counts",title="",ylabel="",xlabel="")

Example Output
==============

::

In [1]: xdata,ydata=pstack.pstack('ibh719grq_ima.fits',column=100,row=25,extname='sci')


The plotting data is returned as two arrays, to save them into variables issue the command as above:

::


In [1]: xdata
Out[2]:
array([ 100.651947, 93.470573, 86.2892 , 79.107826, 71.926453,
64.745079, 57.563702, 50.382328, 43.200954, 36.019581,
28.838205, 21.65683 , 14.475455, 7.29408 , 0.112705,
0. ])

In [3]: ydata
Out[4]:
array([ 221.36606389, 219.5396653 , 182.63100095, 169.178308 ,
186.44084352, 158.3105126 , 129.46997895, 129.92935701,
106.14521852, 72.71721539, 69.68652119, 55.98828663,
42.30755279, 13.12659422, 27.71404187, 0. ])
Loading