ExposureRow

class daschlab.exposures.ExposureRow(table, index)[source]

Bases: Row

A single row from an Exposures table.

You do not need to construct these objects manually. Indexing an Exposures table with a single integer will yield an instance of this class, which is a subclass of astropy.table.Row.

Methods Summary

exp_id()

Get a textual identifier for this exposure.

has_imaging()

Test whether this exposure has associated imaging data or not.

has_phot()

Test whether this exposure has associated photometric data for the session's reference catalog, or not.

photcal_asdf_url([refcat])

Obtain a temporary URL that can be used to download photometric calibration metadata associated with this exposure.

plate_id()

Get the name of the plate that this exposure is associated with.

show()

Display the cutout of this exposure in the WWT view.

Methods Documentation

exp_id() str[source]

Get a textual identifier for this exposure.

Returns:
str

The returned string has the form {series}{platenum}{tail}, where the plate number is zero-padded to be five digits wide. If the exposure corresponds to a WCS solution on a mosaic, the tail has the form m{mosnum}s{solnum}. If it corresponds to a logged exposure that is not assignable to a mosaic WCS solution, it has the form e{expnum}.

See also

plate_id

Get the plate ID

has_imaging() bool[source]

Test whether this exposure has associated imaging data or not.

Returns:
bool

True if the exposure has imaging.

Notes

Exposures do not have imaging when they are obtained from logbook data but the associated plate has not been scanned. Or, the associated plate may have been scanned, but the WCS analysis of the imagery was unable to determine a solution matching the information associated with this exposure.

has_phot() bool[source]

Test whether this exposure has associated photometric data for the session’s reference catalog, or not.

Returns:
bool

True if the exposure has photometry.

Notes

The test checks whether this exposure has data in the lim_mag_{refcat} field, where {refcat} is the reference catalog being used by this session: either apass or atlas. If present, this implies that exposure has imaging and that the DASCH photometric calibration pipeline successfully processed this exposure. Exposures that have photometry for one refcat may not have photometry for the other.

photcal_asdf_url(refcat: str | None = None) str[source]

Obtain a temporary URL that can be used to download photometric calibration metadata associated with this exposure.

Parameters:
refcatoptional str, default None

There are separate calibration data files for the two DASCH DR7 reference catalogs: "apass" or "atlas". This field indicates which file you’re interested in. If unspecified, will default to the reference catalog being used by the currently active session. This is almost surely what you want.

Returns:
urlstr

A URL that can be used to download the metadata file.

Notes

The returned URL is a presigned AWS S3 download link with a lifetime of around 15 minutes. You can fetch this URL using a browser or any standard HTTP library to obtain the data.

The resulting data file is stored in the ASDF format. Its contents are documented on the DASCH DR7 Photometric Calibration ASDF File Contents page. Typical file sizes are a few megabytes, ranging up to tens of megabytes.

Each ASDF file is uniquely identified by a hexadecimal “result ID”. The value to use is taken from one table columns result_id_apass or result_id_atlas. This value may be empty if the exposure in question was not able to be calibrated against the specified refcat. In that case, this method will raise an exception.

Examples

Assuming that the first row in the exposures table has a valid photometric calibration, download its ASDF file and save it to disk:

import shutil
import requests

# Assume `sess` is a standard daschlab session object

asdf_url = sess.exposures()[0].photcal_asdf_url()

with requests.get(asdf_url, stream=True) as resp:
    with open("exposure0.asdf", "wb") as f_out:
        shutil.copyfileobj(resp.raw, f_out)
plate_id() str[source]

Get the name of the plate that this exposure is associated with.

Returns:
str

The returned string has the form {series}{platenum}, where the plate number is zero-padded to be five digits wide.

See also

exp_id

Get the unique ID of this particular exposure

Notes

In most cases, you should work with exposure IDs, obtainable with the exp_id method. This is because some plates were exposured multiple times, and each exposure has its own duration, WCS solution, and source catalog. Multiple exposures in one exposure list may be associated with the same plate.

show() ImageLayer[source]

Display the cutout of this exposure in the WWT view.

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.