sorcha.modules.PPMiniDifi
Functions
|
Calculate the great circle distance between two points |
|
Given a set of observations in one night, calculate it has |
|
Calculate, for a given set of observations sorted by observation time, |
|
Find all nights where a trailing window of <window> nights (including the |
|
For a set of observations of a single object, calculate if there are any tracklets, |
|
Ingesting a set of observations for one or more objects, determine if each object |
Module Contents
- haversine_np(lon1, lat1, lon2, lat2)[source]
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
- Parameters:
lon1 (float or array of floats) -- longitude of point 1
lat1 (float or array of floats) -- latitude of point 1
lon2 (float or array of floats) -- longitude of point 2
lat2 (float or array of floats) -- latitude of point 2
- Returns:
float or array of floats
Great distance between the two points [Units (Decimal degrees])
Notes
All args must be of equal length.
Because SkyCoord is slow AF.
- hasTracklet(mjd, ra, dec, maxdt_minutes, minlen_arcsec, min_observations)[source]
Given a set of observations in one night, calculate it has at least onedetectable tracklet.
- Parameters:
mjd (float or array of floats) -- Modified Julian date time
ra (float or array of floats) -- Object's RA at given mjd [Units: degrees]
dec (float or array of floats) -- Object's dec at given mjd [Units: degrees]
maxdt_minutes (float) -- Maximum allowable time between observations [Units: minutes]
minlen_arcsec (float) -- Minimum allowable distance separation between observations [Units: arcsec]
(int) (min_observations) -- the minimum number of observations in a night required to form a tracklet.
- Returns:
boolean
True if tracklet can be made else False
- trackletsInNights(night, mjd, ra, dec, maxdt_minutes, minlen_arcsec, min_observations)[source]
Calculate, for a given set of observations sorted by observation time, whether or not it has at least one discoverable tracklet in each night.
- Parameters:
night (float or array of floats) -- Array of the integer night corresponding to each observation
mjd (float or array of floats) -- Modified Julian date time
ra (float or array of floats) -- Object's RA at given mjd [Units: degrees]
dec (float or array of floats) -- Object's dec at given mjd [Units: degrees]
maxdt_minutes (float) -- Maximum allowable time between observations [Units: minutes]
minlen_arcsec (float) -- Minimum allowable distance separation between observations [Units: arcsec]
(int) (min_observations) -- the minimum number of observations in a night required to form a tracklet.
- Returns:
nights (float or array of floats) -- Numpy array of the unique nights in the set of observations
hasTrk (boolean or array of booleans) -- Array denoting if each night has a discoverable tracklet
- discoveryOpportunities(nights, nightHasTracklets, window, nlink, p, rng)[source]
Find all nights where a trailing window of <window> nights (including the current night) has at least <nlink> tracklets to constitute a discovery.
- Parameters:
nights (float or array of floats) -- Array of the integer night corresponding to each observation
nightHasTracklets (list of booleans) -- List of nights that have tracklets within them
window (float) -- Number of tracklets required with <= this window to complete a detection
nlink (float) -- Number of tracklets required to form detection
p (float) -- SSP detection efficiency, or what fraction of objects are successfuly linked
rng (numpy RNG generator object) -- PGC64 generator object to determine which objects to drop
- Returns:
discIdx (float) -- The index of where in the observation array the object is reported as discovered
disc (list of floats) -- List of MJD dates where the object is discoverable
- linkObject(obsv, seed, maxdt_minutes, minlen_arcsec, min_observations, window, nlink, p, night_start_utc_days)[source]
For a set of observations of a single object, calculate if there are any tracklets, if there are enough tracklets to form a discovery window, and then report back all of those successful discoveries.
- Parameters:
obsv (numpy array) --
Array of observations for one object, of the format: ssObjectId : str
Unique ID for the Solar System object
- diaSourceIdfloat
Unique ID for the observation
- midPointTaifloat
Time for the observation midpoint (MJD)
- rafloat
RA of the object (J2000)
- declfloat
Declination of the object (J2000)
seed (float) -- Initial seed per object to keep observations deterministic for multithreading
maxdt_minutes (float) -- Maximum allowable time between observations [Units: minutes]
minlen_arcsec (float) -- Minimum allowable distance separation between observations [Units: arcsec]
(int) (min_observations) -- the minimum number of observations in a night required to form a tracklet.
window (float) -- Number of tracklets required with <= this window to complete a detection
nlink (float) -- Number of tracklets required to form detection
p (float) -- SSP detection efficiency, or what fraction of objects are successfuly linked
night_start_utc_days (float) -- The UTC time of local noon at the observatory
- Returns:
discoveryObservationId (float) -- The ID of the observation that triggered the successful linking
discoverySubmissionDate (float) -- The night at which the discovery is first submitted
discoveryChances (float) -- The number of chances for discovery of the object
- linkObservations(obsv, seed, objectId='ssObjectId', sourceId='diaSourceId', mjdTime='midPointTai', ra='ra', dec='decl', **config)[source]
Ingesting a set of observations for one or more objects, determine if each object would be discovered by the SSP pipeline based on tracklet forming and linking.
- Parameters:
obsv (numpy array) --
Array of observations for each object, of the format: ssObjectId : str
Unique ID for the Solar System object
- diaSourceIdfloat
Unique ID for the observation
- midPointTaifloat
Time for the observation midpoint (MJD)
- rafloat
RA of the object (J2000)
- declfloat
Declination of the object (J2000)
seed (float) -- Initial seed per object to keep observations deterministic for multithreading
objectId (string, default="ssObjectId") -- Column name for object ID's in observations dataframe
sourceId (string, default="diaSourceId") -- Column name for observation ID's in observations dataframe
mjdTime (string, default="midPointTai") -- Column name for MJD's in observations dataframe
ra (string, default=ra") -- Column name for object RA's in observations dataframe
dec (string, default="decl") -- Column name for object Dec's in observations dataframe
**config -- Dictionary containing configuration file variables
- Returns:
obj --
- Array with one row per detected object, of the format:
- ssObjectIdstr
Unique ID for the Solar System object
- discoveryObservationIdfloat
Unique ID for the observation
- discoverySubmissionDatefloat
The night at which the discovery is first submitted
- discoveryChancesfloat
The number of chances for discovery of the object
- Return type:
numpy array