The Imviz data analysis plugins are meant to aid quick-look analysis of 2D image data. All plugins are accessed via the plugin
icon in the upper right corner of the Imviz application.
This plugin allows viewing of any metadata associated with the selected data.
If the data is loaded from multi-extension FITS that contains a primary header, you will also see a Show primary header
toggle, when enabled, would display just the primary header metadata.
This plugin gives access to per-viewer and per-layer plotting options.
Display Settings <imviz-display-settings>
Documentation on various display settings in the Jdaviz viewers.
This plugin allows you to select an existing subset to modify, or to select Create new
to create a new subset by selecting and using the region selector in the spectrum viewer toolbar. You can also choose the operation that will be applied by the selector tool. Note that these are synched with the subset tools in the app-level toolbar. It might not show some static regions loaded via the API unless an interactive region is drawn after.
If an existing subset is selected, the parameters of the subset will also be shown. Note that while parameters for compound regions (e.g., a subset with multiple disjoint regions) are displayed, the logical operations joining them (OR
, AND
, etc.) are not shown.
For a simple subset in Imviz only, you can choose to recenter it based on the selected Data. The centroid is calculated by photutils.aperture.ApertureStats.centroid
, which is the center-of-mass of the data within the aperture. No background subtraction is performed. Click Recenter
to change its parameters and move it to the calculated centroid.
Note
If you want accurate centroid calculations, it is recommended that you use a background-subtracted image. Alternately, you could calculate the centroid outside of Jdaviz (e.g., using photutils
) and then manually edit the subset (see below) or load your own aperture object (imviz-import-regions-api
).
For a simple subset, you can edit its parameters by changing the values in the corresponding editable text fields. Once you have entered the new value(s), click Update
to apply. You should see the subset parameters, shape, and orientation (if applicable) all update concurrently.
Angle is counter-clockwise rotation around the center in degrees.
This plugin allows for interactively creating markers in any viewer and logging information about the location of that marker along with the applicable data and viewer labels into a table.
With the plugin open in the tray, mouse over any viewer and press the "m" key to log the information displayed in the app toolbar into the table. The markers remain at that fixed pixel-position in the viewer they were created (regardless of changes to the underlying data or linking) and are only visible when the plugin is opened.
In Imviz, the table also exposed columns labeled "pixel:unreliable", "world:unreliable", and "value:unreliable". These will be logged as True
in cases where the information is outside the bounds of the reference image's WCS (noted in the mouseover display by the information showing as grayed).
To export the table into the notebook via the API, call ~jdaviz.core.template_mixin.TableMixin.export_table
(see plugin-apis
).
This plugin is used to re-link images by pixels or WCS using ~jdaviz.configs.imviz.helper.link_image_data
. All images are automatically linked by pixels on load but you can use it to re-link by pixels or WCS as needed.
For WCS linking, the "fast approximation" option uses an affine transform to represent the offset between images, if possible. It is much more performant at the cost of accuracy but should be accurate to within a pixel for most cases. If approximation fails, WCS linking still automatically falls back to full transformation.
For the best experience, it is recommended that you decide what kind of link you want and set it at the beginning of your Imviz session, rather than later.
For more details on linking, see dev_glue_linking
.
From the API within the Jupyter notebook (if linking by WCS):
imviz.link_data(link_type='wcs')
For an image with a valid WCS, the compass will show directions to North (N) and East (E) for ICRS sky coordinates. It also shows the currently displayed data label, the X and Y directions, and the zoom box.
When you have multiple viewers created in Imviz, use the Viewer dropdown menu to change the active viewer that it tracks.
This plugin plots line profiles across X and Y for the pixel under cursor when l
key is pressed on the image viewer. You can also manually type in the values of X and Y, and then press the PLOT
button. The top visible image, the same one displayed under imviz-compass
, will be used for these plots.
This plugin only considers pixel locations, not sky coordinates.
This plugin performs simple aperture photometry and plots a radial profile for one object within an interactively selected region. A typical workflow is as follows:
- Load image(s) in Imviz (see
imviz-import-data
). - Draw a region over the object of interest (see
imviz_defining_spatial_regions
). - Select the desired image using the
Data
dropdown menu. - Select the desired region using the
Subset
dropdown menu. You can use theimviz-subset-plugin
plugin to center it first on the object of interest using its center of mass, if you wish. Depending on the object, it may take several iterations for re-centering to converge, or it may never converge at all. - If you want to subtract background before performing photometry, you have the following 3 options. Otherwise if your image is already background subtracted, choose "Manual" and leave the background set at 0:
- Manual: Enter the background value in the
Background value
field. This value must be in the same unit as display data, if applicable.- Annulus: Enter its inner radius and width in the
Annulus inner radius
andAnnulus width
, respectively. Median of the pixels within the annulus region will be used but the annulus shape will not be shown on display.- Subset: Define a region for background calculation (median) using Subset draw tool and select that region using the
Background
dropdown menu. Only regions created with thereplace
option are acceptable as background regions (seeimviz_defining_spatial_regions
).
- For some JWST and HST images, pixel area in arcsec squared is automatically populated in the
Pixel area
field from image metadata. If it does not auto-populate for you, you can manually enter a value but it must be in the unit of arcsec squared. This field is only used if per steradian is detected in display data unit. Otherwise, it is only informational. If this field is not applicable for you, leave it at 0. This field resets every time Data selection changes if auto-population not possible. - If you also want photometry result in the unit of counts, you can enter a conversion factor in the
Counts conversion factor
field. The value must be in the unit of display data unit per counts. This is used to convert linear flux unit (e.g., MJy/sr) to counts. This field is only used if data has a valid unit. If this field is not applicable for you, leave it at 0. This field resets every time Data selection changes. - If you also want photometry result in magnitude unit, you can enter a flux scaling factor in the
Flux scaling
field.Flux scaling
is populated for JWST images if MJy/sr data unit is detected and pixel area is given to factor out the per-steradian unit. The value used, if this is the case, is the scaling to convert MJy to AB magnitude. Otherwise, the value must be in the same unit as display data unit. A magnitude is then calculated using-2.5 * log(flux / flux_scaling)
. This calculation only makes sense if your display data unit is already in linear flux unit. Setting this to 1 is equivalent to not applying any scaling. This field is only used if data has a valid unit. If this field is not applicable for you, leave it at 0. This field resets every time Data selection changes. - Select the desired radial profile plot type using the
Plot Type
dropdown menu:
- Curve of Growth:
~photutils.aperture.ApertureStats.sum
(sum of flux in the aperture) across radii from center out to the edge of the aperture. This is calculated in the same way as the final aperture sum in the output table, which is explained farther down on this page.- Radial Profile: Binned average as a function of radius from the center of the region.
- Radial Profile (Raw): Raw image data points as a function of radius from the center of the region. Caution: having too many data points may cause performance issues with this feature. The exact limitations depend on your hardware.
- Toggle
Fit Gaussian
on to fit a ~astropy.modeling.functional_models.Gaussian1D model to the radial profile data. This is disabled for curve-of-growth. - Once all inputs are populated correctly, click on the
CALCULATE
button to perform simple aperture photometry.
Note
Masking and weights by uncertainty are currently not supported. However, if NaN exists in data, it will be treated as 0.
When calculation is complete, a plot would show the radial profile of the background subtracted data and the photometry and model fitting (if requested) results are displayed under the CALCULATE
button.
Export Photometry <imviz_export_photometry>
Documentation on exporting photometry results.
This plugin queries a catalog around the zoom window of the active image, marks the sources from the results of the query, and provides the number of sources found. After zooming into a specific region of the image, the query uses the center point of the region with a radius determined by the farthest edge point of the region. Clicking on CLEAR
will remove all markers on the active viewer.
To select which catalog you would like to use for the search, please pick one of the available options from the catalog dropdown menu.
Note
This plugin is still under active development. As a result, the search only uses the SDSS DR17 catalog and works best when you only have a single image loaded in a viewer.
To load a catalog from a supported JWST ECSV catalog file, choose "From File...". The file must be able to be parsed by astropy.table.Table.read and contain a column labeled 'sky_centroid'. Clicking SEARCH
will show markers for any entry within the filtered zoom window.
If you have multiple viewers open, you will see another dropdown menu to select the active viewer.
Additionally, the query starts anew every time SEARCH
is clicked, so previous results and marks are not stored. To save the current result before submitting a new query, you can save the table to a variable:
results = imviz.get_catalog_source_results()
Note
The table returned from the API above may cover more sources than shown in the currently zoomed-in portion of the image. Additional steps will be needed to filter out these points, if necessary.
This plugin allows exporting the plot in a given viewer to a PNG or SVG file.