obiwan.common

Commonly used functions

Functions

dobash(cmd)
fits2pandas(tab[, attrs]) converts a fits_table into a pandas DataFrame
get_brickdir(outdir, obj, brick)
get_brickinfo_hack(survey, brickname) when in ipython and reading single row survey-bricks table,
get_outdir_runbrick(outdir, brick, rowstart) diretory obiwan/runbrick will write results to
get_rsdir(rowstart[, do_skipids, do_more]) Returns string like rs0 or skip_rs0
inJupyter()
save_png(outdir, fig_id[, tight])
stack_tables(fn_list[, textfile, shuffle]) concatenates fits tables
writelist(lis, fn)
obiwan.common.fits2pandas(tab, attrs=None)[source]

converts a fits_table into a pandas DataFrame

Parameters:
  • tab – fits_table()
  • attrs – attributes or column names want in the DF
obiwan.common.get_brickinfo_hack(survey, brickname)[source]
when in ipython and reading single row survey-bricks table,
astroometry.net’s fits_table() can break, handle this case
Returns:the single row fits_table
Return type:brickinfo
obiwan.common.get_outdir_runbrick(outdir, brick, rowstart, do_skipids='no', do_more='no')[source]

diretory obiwan/runbrick will write results to

Returns path to like outdir/obj/bri/brick/rs0

obiwan.common.get_rsdir(rowstart, do_skipids='no', do_more='no')[source]

Returns string like rs0 or skip_rs0

Parameters:
  • rowstart – 0, 300, etc
  • do_skipids,do_more – yes or no
obiwan.common.stack_tables(fn_list, textfile=True, shuffle=None)[source]

concatenates fits tables

Parameters:shuffle – set to an integer to randomly reads up to the first “shuffle” cats only