Full API Specification

besl

BGPS Peak Flux Extract

Extract peak values from BGPS maps

class besl.bgps_peak_flux_extract.Dirs[source]

Object to hold directories for interactive path editing

besl.bgps_peak_flux_extract.extract_peak_bgps_props(out_filen='bgps_pk_extract')[source]

Extract peak flux and noise values from the BGPS maps in Jy/beam. Citation: Ginsburg et al. (2013).

out_filen : string
output catalog file in CSV format
molcat_pk : pandas.DataFrame
Output catalog in a pandas DataFrame object

Coordinates

Routines for manipulating coordinates.

besl.coord.dec2sexstr(deci, sfigs=1, hd='h', lead_psign=False)[source]

Convert decimal degree to a sexagesimal string of the form ‘HH:MM:SS.S’ by default.

sfigs : number
Number of significant figures after decimal in seconds
hd : string, (‘h’, ‘d’)
Hour or degree convention
lead_sign : Boolean
Whether to include the leading sign +/- in string
besl.coord.eq2gal(ra, dec, epoch='2000')[source]

Convert equatorial coordinates in decimal degrees to Galactic.

ra : number dec : number epoch : string, default ‘2000’

glon : number glat : number

besl.coord.gal2eq(glon, glat, epoch='2000')[source]

Convert Galactic coordinates in decimal degrees to equatorial.

glon : number glat : number epoch : string, default ‘2000’

ra : number dec : number

besl.coord.nearest_match_coords(needle, haystack, min_sep, nearest=True)[source]

Search within a radius for sources between a “needle” single (lon, lat) coordinate and a “haystack” list of coordinates in decimal degrees. Use sorted lists for best performance.

needle : array like
List or tuple of (lon, lat) in decimal degrees
haystack : numpy array
2 x N list of coordinates in decimal degrees
min_sep : number
Minimum seperation in arcseconds.
nearest : bool, default True
Return only the nearest match
min_index : number or np.array
Array index (or indices) of nearest object
min_dist : number or np.array
Distance (or distances) to nearest matched object
matchn : number
Number of matches within the minimum seperation
besl.coord.pd_eq2gal(df, labels, new_labels=['glon', 'glat'], epoch='2000')[source]

Convert two coordinate columns of a pandas DataFrame from equatorial to Galactic coordinates, both in decimal degrees.

df : pd.DataFrame labels : list

Column names of df

new_labels : list, default ‘glon’ and ‘glat’ epoch : string, default ‘2000’

df : pd.DataFrame
With added columns
besl.coord.pd_gal2eq(df, labels, new_labels=['ra', 'dec'], epoch='2000')[source]

Convert two coordinate columns of a pandas DataFrame from Galactic to equatorial coordinates, both in decimal degrees.

df : pd.DataFrame labels : list

Column names of df

new_labels : list, default names ‘ra’ and ‘dec’ epoch : string, default ‘2000’

df : pd.DataFrame
With added columns
besl.coord.sep(lat1, lon1, lat2, lon2, hd='d')[source]

Calculate seperation between two coordinates in decimal degrees. If using longitude in hours set parameter hd to “h”.

hd : string, (‘h’, ‘d’)
Hour or degree convention
besl.coord.sep_coords(needle, haystack)[source]

Match a “needle” single (lon, lat) coordinate to a “haystack” list of coordinates in decimal degrees. Use sorted lists for best performance.

needle : array like
List or tuple of (lon, lat) in decimal degrees
haystack : numpy array
2 x N list of coordinates in decimal degrees
sep : numpy array
Array of seperations compared to original list in radians
besl.coord.sexstr2dec(sexstr, sep=':', hd='h')[source]

Convert a sexagesimal string of delimited by a seperator character, eg “+HH:MM:SS.S” with ”:”, into a decimal float. Can also be a tuple of numbers.

sexstr : str, tuple
Sexagesimal coordinate in seperated string or tuple of numbers
sep : string
Seperator character between hours, minutes, and seconds
hd : string, (‘h’, ‘d’)
Hour or degree convention

Miscellaneous Functions

besl.misc.logit()[source]

Log IPython session to log file tagged by date and time: ipython_log_YY-MM-DD_HH:MM.py.