ExposureSelector¶
- class daschlab.exposures.ExposureSelector(exposures: Exposures, apply)[source]¶
Bases:
object
A helper object that supports
Exposures
filtering functionality.Exposure selector objects are returned by exposure selection “action verbs” such as
Exposures.keep_only
. Calling one of the methods on a selector instance will apply the associated action to the specified portion of the lightcurve data.See the introduction to the
daschlab.lightcurves
module for an overview of the filtering framework used here.Attributes Summary
Get a selector that will act on an inverted row selection.
Methods Summary
has_imaging
(**kwargs)Act on exposures that can be associated to imaging data.
has_phot
(**kwargs)Act on exposures that were able to be photometrically calibrated.
jyear_range
(jyear_min, jyear_max, **kwargs)Act on exposures observed within the specified Julian-year time range.
local_id
(local_id, **kwargs)Act on the row with the specified local ID.
meteor
(**kwargs)Act on rows associated with ultra-low-resolution "meteor" telescopes.
narrow
(**kwargs)Act on rows associated with narrow-field telescopes.
patrol
(**kwargs)Act on rows associated with low-resolution "patrol" telescopes.
plate_names
(names, **kwargs)Act on rows associated with the specified plate names.
rejected
(**kwargs)Act on rows with a non-zero
"reject"
value.rejected_with
(tag[, strict])Act on rows that have been rejected with the specified tag.
scanned
(**kwargs)Act on exposures corresponding to plates that have been scanned.
series
(series, **kwargs)Act on rows associated with the specified plate series.
where
(row_mask, **kwargs)Act on exactly the specified list of rows.
Attributes Documentation
- not_¶
Get a selector that will act on an inverted row selection.
Examples
Create an exposure-list subset containing only those exposures that do not have associated imaging data:
from astropy import units as u exp = sess.exposures() unsolved = exposures.keep_only.not_.has_imaging()
In general, the function of this modifier is such that:
exp.ACTION.not_.CONDITION() # should be equivalent to: exp.ACTION.where(~exp.match.CONDITION())
Methods Documentation
- has_imaging(**kwargs) Exposures [source]¶
Act on exposures that can be associated to imaging data.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Notes
Unfortunately, some of the DASCH WCS solutions are erroneous.
Examples
Create an exposure-list subset containing only exposures with imaging:
exp = sess.exposures() solved = exp.keep_only.has_imaging()
- has_phot(**kwargs) Exposures [source]¶
Act on exposures that were able to be photometrically calibrated.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Notes
The selector acts on exposures that have data in the
lim_mag_{refcat}
field, where{refcat}
is the reference catalog being used by this session: eitherapass
oratlas
. This field is only present for exposures that have imaging and were successfully processed by the DASCH photometric pipeline for that refcat.Examples
Count the number of exposures with photometry:
exp = sess.exposures() n_phot = exp.count.has_phot()
- jyear_range(jyear_min: float, jyear_max: float, **kwargs) Exposures [source]¶
Act on exposures observed within the specified Julian-year time range.
- Parameters:
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Notes
The comparison is performed against the
jyear
attribute of the contents of the"obs_date"
column.Examples
Create an exposure-list subset containing exposures observed in the 1920’s:
exp = sess.exposures() subset = exp.keep_only.jyear_range(1920, 1930)
- local_id(local_id: int, **kwargs) Exposures [source]¶
Act on the row with the specified local ID.
- Parameters:
- local_id
int
The local ID to select.
- **kwargs
Parameters forwarded to the action.
- local_id
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Notes
Exposure local IDs are unique, and so this filter should only ever match at most one row.
Examples
Create an exposure-list subset containing only the chronologically first row:
exp = sess.exposures() first = exp.keep_only.local_id(0)
- meteor(**kwargs) Exposures [source]¶
Act on rows associated with ultra-low-resolution “meteor” telescopes.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only exposures from meteor telescopes:
exp = sess.exposures() meteor = exp.keep_only.meteor()
- narrow(**kwargs) Exposures [source]¶
Act on rows associated with narrow-field telescopes.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only exposures from narrow-field telescopes:
exp = sess.exposures() narrow = exp.keep_only.narrow()
- patrol(**kwargs) Exposures [source]¶
Act on rows associated with low-resolution “patrol” telescopes.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only exposures from patrol telescopes:
exp = sess.exposures() patrol = exp.keep_only.patrol()
- plate_names(names: Iterable[str], **kwargs) Exposures [source]¶
Act on rows associated with the specified plate names.
- Parameters:
- namesiterable of
str
Each name should be of the form
{series}{platenum}
. Capitalization and zero-padding of the plate number are not important.- **kwargs
Parameters forwarded to the action.
- namesiterable of
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing exposures on the specified plates:
exp = sess.exposures() subset = exp.keep_only.plate_names([“A10000”, “mc1235”])
- rejected(**kwargs) Exposures [source]¶
Act on rows with a non-zero
"reject"
value.- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only rejected rows:
exp = sess.exposures() rejects = exp.keep_only.rejected()
- rejected_with(tag: str, strict: bool = False, **kwargs) Exposures [source]¶
Act on rows that have been rejected with the specified tag.
- Parameters:
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only rows rejected with the “astrom” tag:
exp = sess.exposures() astrom_rejects = exp.keep_only.rejected_with(“astrom”)
- scanned(**kwargs) Exposures [source]¶
Act on exposures corresponding to plates that have been scanned.
- Parameters:
- **kwargs
Parameters forwarded to the action.
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Notes
Some exposures are known to have occurred, and are associated with plates that have been scanned, but the pipeline was unable to find an associated WCS solution in the plate imagery. Use
has_imaging()
to act only on exposures with WCS solutions.Examples
Create an exposure-list subset containing only exposures from unscanned plates:
exp = sess.exposures() unscanned = exp.drop.scanned() # or equivalently: unscanned = exp.keep_only.not_.scanned()
- series(series: str, **kwargs) Exposures [source]¶
Act on rows associated with the specified plate series.
- Parameters:
- series
str
The plate series to select.
- **kwargs
Parameters forwarded to the action.
- series
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only exposures from the MC series:
exp = sess.exposures() mcs = exp.keep_only.series("mc")
- where(row_mask, **kwargs) Exposures [source]¶
Act on exactly the specified list of rows.
- Parameters:
- row_maskboolean
numpy.ndarray
A boolean array of exactly the size of the input exposure list, with true values indicating rows that should be acted upon.
- **kwargs
Parameters forwarded to the action.
- row_maskboolean
- Returns:
- Usually, another
Exposures
However, different actions may return different types. For instance, the
Exposures.count
action will return an integer.
- Usually, another
Examples
Create an exposure-list subset containing only exposures that are from A-series exposures and do not have associated imaging data:
exp = sess.exposures() subset = exp.keep_only.where( exp.match.series("a") & exp.match.not_.has_imaging() )