Exporting Data from Imviz#

Spatial Regions#

You can extract supported spatial regions as follows:

regions = imviz.get_interactive_regions()
regions

Aperture Photometry#

If you opted to fit a Gaussian1D to the radial profile, the last fitted model parameters will be displayed under the radial profile plot. The model itself can be obtained as follows. See Models and Fitting (astropy.modeling) on how to manipulate the model:

my_gaussian1d = imviz.app.fitted_models['phot_radial_profile']

The bottom of the plugin shows a table of past results, along with the subset and data used to compute them. These results can be exported as an QTable as follows, assuming imviz is the instance of your Imviz application:

results = imviz.get_aperture_photometry_results()

When multiple calculations are done in the same session (e.g., calculating aperture photometry for the same region across different images or for different regions on the same image), imviz.get_aperture_photometry_results() will return all the calculations in the same table, if possible. However, if the newest result is incompatible with the existing ones (e.g., two images have very different units), only the newest is kept in the table. When you are unsure, save the results after each calculation as different variables in your Python session.

The output table contains the results you see in the plugin and then some. The columns are as follow:

  • id: ID number assigned to the row, starting from 1.

  • xcenter, ycenter: Center of the aperture (0-indexed).

  • sky_center: SkyCoord associated with the center. If WCS is not available, this field is None.

  • background: The value from Background value, with unit attached.

  • sum: Sum of flux in the aperture. If per steradian is in input data unit, total pixel area covered in steradian is already multiplied here, if applicable, so there will be no per steradian in its unit. Otherwise, it has the same unit as input data. For more details on how the photometry is done, see Aperture Photometry (photutils.aperture).

  • sum_aper_area: The pixel area covered by the region. Partial coverage is reported as fraction.

  • pixarea_tot: If per steradian is in input data unit and pixel area is provided, this contains the conversion factor for the sum to take out the steradian unit. Otherwise, it is None.

  • aperture_sum_counts: This is the aperture sum converted to counts, if Counts conversion factor was set. Otherwise, it is None. This calculation is done without taking account of pixarea_tot, even when it is available.

  • aperture_sum_counts_err: This is the Poisson uncertainty (square root) for aperture_sum_counts. Other uncertainty factors like readnoise are not included. In the plugin, it is displayed within parenthesis next to the value for aperture_sum_counts, if applicable.

  • counts_fac: The value from Counts conversion factor, with unit attached, if applicable. Otherwise, it is None.

  • aperture_sum_mag: This is the aperture sum converted to magnitude, if Flux scaling was set. Otherwise, it is None. This calculation is done without taking account of pixarea_tot, even when it is available.

  • flux_scaling: The value from Flux scaling, with unit attached, if applicable. Otherwise, it is None.

  • min, max, mean, median, mode, std, mad_std, var, biweight_location, biweight_midvariance: Basic statistics from the aperture.

  • fwhm, semimajor_sigma, semiminor_sigma, orientation, eccentricity: Properties of a 2D Gaussian function that has the same second-order central moments as the source.

  • data_label: Data label of the image used.

  • subset_label: Subset label of the region used.

  • timestamp: Timestamp of when the photometry was performed as Time.

Note

Aperture sum and statistics are done on the originally drawn aperture only. You can use the Subset Tools plugin to center it first on the object of interest, if you wish.

Once you have the results in a table, you can further manipulated them as documented in Data Tables (astropy.table).

Markers Table#

All mouseover information in the markers plugin can be exported to an astropy table by calling export_table() (see Accessing Plugin APIs):

markers_plugin = imviz.plugins["Markers"]
markers_table = markers_plugin.export_table()