Plates

class daschlab.plates.Plates(data=None, masked=False, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, units=None, descriptions=None, **kwargs)[source]

Bases: Table

A table of DASCH plate information.

A Plates is a subclass of astropy.table.Table containing DASCH plate data and associated plate-specific methods. You can use all of the usual methods and properties made available by the astropy.table.Table class. Items provided by the Table class are not documented here.

You should not construct Plates instances directly. Instead, obtain the full table using the daschlab.Session.plates() method.

Columns are not documented here! They are (FIXME: will be) documented more thoroughly in the DASCH data description pages.

See the module-level documentation of the daschlab.lightcurves for a summary of the filtering and subsetting functionality provided by this class.

Attributes Summary

count

An action returning the number of selected rows

drop

An action returning a Plates copy dropping the selected rows; all non-selected rows are retained.

keep_only

An action returning a Plates copy containing only the selected rows.

match

An action returning a boolean array identifying selected rows.

reject

An action modifying the plate-list in-place, rejecting the selected rows.

reject_unless

An action modifying the plate-list in-place, rejecting rows not matching the selection.

Methods Summary

candidate_nice_cutouts([source_of_interest, ...])

Return a table with information about plates that might contain "nice" imagery of the target, in some vague sense.

export(path[, format, drop_rejects])

Save a copy of this plate list to a file.

export_cutouts_to_pdf(pdfpath, **kwargs)

Export cutouts of the plates in this list to a PDF file.

series_info()

Obtain a table summarizing information about the different plate series in the non-rejected rows of the current table.

show(plate_ref)

Display the cutout of the specified plate in the WWT view.

time_coverage()

Plot the observing time coverage of the non-rejected plates in this list.

Attributes Documentation

count

An action returning the number of selected rows

Unlike many actions, this returns an int, not a new Plates.

drop

An action returning a Plates copy dropping the selected rows; all non-selected rows are retained.

keep_only

An action returning a Plates copy containing only the selected rows.

match

An action returning a boolean array identifying selected rows.

Unlike many actions, this does not return a new Plates. It can be used to implement arbitrary boolean logic within the action/selection framework:

pl = sess.plates()
subset = pl.keep_only.where(
    pl.match.series("a") & pl.match.wcs_solved()
)
reject

An action modifying the plate-list in-place, rejecting the selected rows.

Usage is as follows:

pl = sess.plates()

# Mark all points from meteor telescopes as rejected:
pl.reject.meteor(tag="meteor")

The tag keyword argument to the selector is mandatory. It specifies a short, arbitrary “tag” documenting the reason for rejection. Each unique tag is associated with a binary bit of the "reject" column, and these bits are logically OR’ed together as rejections are established. The maximum number of distinct rejection tags is 64, since the "reject" column is stored as a 64-bit integer.

reject_unless

An action modifying the plate-list in-place, rejecting rows not matching the selection.

Usage is as follows:

pl = sess.plates()

# Mark all plates *not* from narrow-field telescopes as rejected:
pl.reject_unless.narrow(tag="lowrez")

# This is equivalent to:
pl.reject.not_.narrow(tag="lowrez")

The tag keyword argument to the selector is mandatory. It specifies a short, arbitrary “tag” documenting the reason for rejection. Each unique tag is associated with a binary bit of the "reject" column, and these bits are logically OR’ed together as rejections are established. The maximum number of distinct rejection tags is 64, since the "reject" column is stored as a 64-bit integer.

Methods Documentation

candidate_nice_cutouts(source_of_interest=0, limit_cols: bool = True, limit_rows: int | None = 8) daschlab.lightcurves.Lightcurve[source]

Return a table with information about plates that might contain “nice” imagery of the target, in some vague sense.

Parameters:
source_of_interestoptional source reference, default 0

A source of interest that will be used to evaluate imaging quality. The lightcurve for this source will be downloaded, with the reference resolved as per the function daschlab.Session.lightcurve().

limit_colsoptional bool, default True

If true, drop various columns from the returned table. The preserved columns will be only the ones relevant to inferring the plate image quality.

limit_rowsoptional int or None, default 10

If a positive integer, limit the returned table to only this many rows.

Returns:
daschlab.lightcurves.Lightcurve

The returned table is actually a Lightcurve table, re-sorted and potentially subsetted. The sort order will be in decreasing predicted image quality based on the lightcurve data.

Notes

The primary sort key is based on the limiting magnitude, which is a quantity available even in rows of the lightcurve that do not detect the source of interest. So, this method should be useful even if the source is not easily detected. Other image-quality metadata, however, may be missing, so this method will restrict itself to lightcurve rows with detections if there are a sufficient number of them.

export(path: str, format: str = 'csv', drop_rejects: bool = True)[source]

Save a copy of this plate list to a file.

Parameters:
pathstr

The path at which the exported plate list data will be saved.

formatstr, default "csv"

The file format in which to save the data. Currently, the only allowed value is "csv".

drop_rejectsbool, default True

If True, rejected plates will not appear in the output file at all. Otherwise, they will be included, and there will be a "reject" column reproducing their rejection status.

Notes

The default "csv" output format only exports a subset of the table columns known as the “medium” subset. It is defined in the plate-list table documentation.

export_cutouts_to_pdf(pdfpath: str, **kwargs)[source]

Export cutouts of the plates in this list to a PDF file.

Parameters:
pdf_pathstr

The path at which the output file will be written. This path is not relative to the daschlab.Session root.

refcat_stdmag_limitoptional float

If specified, only sources from the reference catalog brigher than the specified stdmag limit will be overlaid on the cutouts. Otherwise, all refcat sources are overlaid, including very faint ones and ones without stdmag records.

Notes

This operation will attempt to download a cutout for every WCS-solved plate in the list. This can be extremely slow, as well as creating a lot of work for the API server. Only use it for short plate lists.

The format of the created file needs to be documented.

series_info() Table[source]

Obtain a table summarizing information about the different plate series in the non-rejected rows of the current table.

Returns:
astropy.table.Table

A table of summary information

Notes

Columns in the returned table include:

  • "series": the plate series in question

  • "count": the number of plates from the series in self

  • "kind": the daschlab.series.SeriesKind of this series

  • "plate_scale": the typical plate scale of this series (in arcsec/mm)

  • "aperture": the telescope aperture of this series (in meters)

  • "description": a textual description of this series

The table is sorted by decreasing "count".

show(plate_ref: PlateRow | int) ImageLayer[source]

Display the cutout of the specified plate in the WWT view.

Parameters:
plate_refPlateRow or int

If this argument is an integer, it is interpreted as the “local ID” of a plate. Local IDs are assigned in chronological order of observing time, so a value of 0 shows the first plate. This will only work if the selected plate is scanned and WCS-solved.

If this argument is an instance of PlateRow, the specified plate is shown.

Returns:
pywwt.layers.ImageLayer

This is the WWT image layer object corresponding to the displayed FITS file. You can use it to programmatically control aspects of how the file is displayed, such as the colormap.

Notes

In order to use this method, you must first have called daschlab.Session.connect_to_wwt(). If needed, this method will execute an API call and download the cutout to be displayed, which may be slow.

time_coverage() figure[source]

Plot the observing time coverage of the non-rejected plates in this list.

Returns:
bokeh.plotting.figure

A plot.

Notes

The plot is generated by using a Gaussian kernel density estimator to smooth out the plate observation times.

The function bokeh.io.show (imported as bokeh.plotting.show) is called on the figure before it is returned, so you don’t need to do that yourself.