<EOL>if sys.version_info[:<NUM_LIT:2>] > (<NUM_LIT:3>,<NUM_LIT:2>):<EOL><INDENT>if (isinstance(checkplotin, str) and os.path.exists(checkplotin)):<EOL><INDENT>cpd = _read_checkplot_picklefile(checkplotin)<EOL><DEDENT>elif isinstance(checkplotin, dict):<EOL><INDENT>cpd = checkplotin<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(checkplotin), type(checkplotin)))<EOL>return None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if ((isinstance(checkplotin, str) or<EOL>isinstance(checkplotin, unicode)) and<EOL>os.path.exists(checkplotin)):<EOL><INDENT>cpd = _read_checkplot_picklefile(checkplotin)<EOL><DEDENT>elif isinstance(checkplotin,dict):<EOL><INDENT>cpd = checkplotin<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(checkplotin), type(checkplotin)))<EOL>return None<EOL><DEDENT><DEDENT>if '<STR_LIT>' in cpd:<EOL><INDENT>cplspmethods = cpd['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>cplspmethods = []<EOL>for pfm in METHODSHORTLABELS:<EOL><INDENT>if pfm in cpd:<EOL><INDENT>cplspmethods.append(pfm)<EOL><DEDENT><DEDENT><DEDENT>cprows = len(cplspmethods)<EOL>if '<STR_LIT>' in cpd and cpd['<STR_LIT>'] and len(cpd['<STR_LIT>']) > <NUM_LIT:0>:<EOL><INDENT>nbrrows = len(cpd['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>nbrrows = <NUM_LIT:0><EOL><DEDENT>if extrarows and len(extrarows) > <NUM_LIT:0>:<EOL><INDENT>erows = len(extrarows)<EOL><DEDENT>else:<EOL><INDENT>erows = <NUM_LIT:0><EOL><DEDENT>if ('<STR_LIT>' in cpd and<EOL>cpd['<STR_LIT>'] and<EOL>len(cpd['<STR_LIT>']) > <NUM_LIT:0>):<EOL><INDENT>cpderows = len(cpd['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>cpderows = <NUM_LIT:0><EOL><DEDENT>totalwidth = <NUM_LIT><EOL>totalheight = <NUM_LIT> + (cprows + erows + nbrrows + cpderows)*<NUM_LIT><EOL>outimg = Image.new('<STR_LIT>',(totalwidth, totalheight),(<NUM_LIT:255>,<NUM_LIT:255>,<NUM_LIT:255>,<NUM_LIT:255>))<EOL>if cpd['<STR_LIT>']:<EOL><INDENT>finder = Image.open(<EOL>_base64_to_file(cpd['<STR_LIT>'], None, writetostrio=True)<EOL>)<EOL>bigfinder = finder.resize((<NUM_LIT>,<NUM_LIT>), Image.ANTIALIAS)<EOL>outimg.paste(bigfinder,(<NUM_LIT>,<NUM_LIT:20>))<EOL><DEDENT>fontpath = os.path.abspath(<EOL>os.path.join(os.path.dirname(__file__),<EOL>'<STR_LIT:..>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>')<EOL>)<EOL>if os.path.exists(fontpath):<EOL><INDENT>cpfontnormal = ImageFont.truetype(fontpath, <NUM_LIT:20>)<EOL>cpfontlarge = ImageFont.truetype(fontpath, <NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>cpfontnormal = ImageFont.load_default()<EOL>cpfontlarge = ImageFont.load_default()<EOL><DEDENT>objinfodraw = ImageDraw.Draw(outimg)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>cpd['<STR_LIT>'] if cpd['<STR_LIT>'] else '<STR_LIT>',<EOL>font=cpfontlarge,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL>if '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' % cpd['<STR_LIT>']['<STR_LIT>']<EOL>if cpd['<STR_LIT>']['<STR_LIT>']<EOL>else '<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' % cpd['<STR_LIT>']['<STR_LIT>']<EOL>if cpd['<STR_LIT>']['<STR_LIT>'] is not None<EOL>else '<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' % cpd['<STR_LIT>']['<STR_LIT>'].size),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>if '<STR_LIT>' in cpd['<STR_LIT>'] and '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>(('<STR_LIT>' %<EOL>(cpd['<STR_LIT>']['<STR_LIT>'], cpd['<STR_LIT>']['<STR_LIT>']))<EOL>if (cpd['<STR_LIT>']['<STR_LIT>'] is not None and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else '<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>'<STR_LIT>',<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>(('<STR_LIT>' % cpd['<STR_LIT>']['<STR_LIT>'])<EOL>if (cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else '<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>'<STR_LIT>',<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>(('<STR_LIT>' % cpd['<STR_LIT>']['<STR_LIT>'])<EOL>if (cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else '<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>'<STR_LIT>',<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if '<STR_LIT>' in cpd['<STR_LIT>']:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT:200>),<EOL>'<STR_LIT>',<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>if len(cpd['<STR_LIT>']['<STR_LIT>']) > <NUM_LIT:0>:<EOL><INDENT>for bandind, band, label in zip(<EOL>range(len(cpd['<STR_LIT>']['<STR_LIT>'])),<EOL>cpd['<STR_LIT>']['<STR_LIT>'],<EOL>cpd['<STR_LIT>']['<STR_LIT>']<EOL>):<EOL><INDENT>thisbandmag = cpd['<STR_LIT>'][band]<EOL>if bandind in (<NUM_LIT:0>,<NUM_LIT:1>,<NUM_LIT:2>,<NUM_LIT:3>,<NUM_LIT:4>):<EOL><INDENT>thispos = (<NUM_LIT>+<NUM_LIT>*bandind, <NUM_LIT:200>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (label, thisbandmag),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>elif bandind in (<NUM_LIT:5>,<NUM_LIT:6>,<NUM_LIT:7>,<NUM_LIT:8>,<NUM_LIT:9>):<EOL><INDENT>rowbandind = bandind - <NUM_LIT:5><EOL>thispos = (<NUM_LIT>+<NUM_LIT>*rowbandind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (label, thisbandmag),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>rowbandind = bandind - <NUM_LIT:10><EOL>thispos = (<NUM_LIT>+<NUM_LIT>*rowbandind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (label, thisbandmag),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT><DEDENT>if ('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is True):<EOL><INDENT>deredlabel = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>deredlabel = "<STR_LIT>"<EOL><DEDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>'<STR_LIT>' % deredlabel,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>if len(cpd['<STR_LIT>']['<STR_LIT>']) > <NUM_LIT:0>:<EOL><INDENT>for colorind, color, colorlabel in zip(<EOL>range(len(cpd['<STR_LIT>']['<STR_LIT>'])),<EOL>cpd['<STR_LIT>']['<STR_LIT>'],<EOL>cpd['<STR_LIT>']['<STR_LIT>']<EOL>):<EOL><INDENT>thiscolor = cpd['<STR_LIT>'][color]<EOL>if colorind in (<NUM_LIT:0>,<NUM_LIT:1>,<NUM_LIT:2>,<NUM_LIT:3>,<NUM_LIT:4>):<EOL><INDENT>thispos = (<NUM_LIT>+<NUM_LIT>*colorind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (colorlabel, thiscolor),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>elif colorind in (<NUM_LIT:5>,<NUM_LIT:6>,<NUM_LIT:7>,<NUM_LIT:8>,<NUM_LIT:9>):<EOL><INDENT>thisrowind = colorind - <NUM_LIT:5><EOL>thispos = (<NUM_LIT>+<NUM_LIT>*thisrowind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (colorlabel, thiscolor),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>elif colorind in (<NUM_LIT:10>,<NUM_LIT:11>,<NUM_LIT:12>,<NUM_LIT>,<NUM_LIT>):<EOL><INDENT>thisrowind = colorind - <NUM_LIT:10><EOL>thispos = (<NUM_LIT>+<NUM_LIT>*thisrowind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (colorlabel, thiscolor),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>thisrowind = colorind - <NUM_LIT:15><EOL>thispos = (<NUM_LIT>+<NUM_LIT>*thisrowind, <NUM_LIT>)<EOL>objinfodraw.text(<EOL>thispos,<EOL>'<STR_LIT>' % (colorlabel, thiscolor),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT:200>),<EOL>('<STR_LIT>'),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT:200>),<EOL>('<STR_LIT>' %<EOL>((cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan))),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>((cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan))),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>((cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan))),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>if ('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is True):<EOL><INDENT>deredlabel = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>deredlabel = "<STR_LIT>"<EOL><DEDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>'<STR_LIT>' % deredlabel,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>( (cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan) )),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>( (cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan) )),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>( (cpd['<STR_LIT>']['<STR_LIT>'] if<EOL>('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>'] is not None)<EOL>else npnan),) ),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if ('<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>']):<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>('<STR_LIT:U+002CU+0020>'.join(cpd['<STR_LIT>']['<STR_LIT>']))),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if ( ('<STR_LIT>' in cpd['<STR_LIT>']) and<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] is not None) and<EOL>(np.isfinite(cpd['<STR_LIT>']['<STR_LIT>'])) and<EOL>('<STR_LIT>' in cpd['<STR_LIT>']) and<EOL>(cpd['<STR_LIT>']['<STR_LIT>']) ):<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>(cpd['<STR_LIT>']['<STR_LIT>'],<EOL>cpd['<STR_LIT>']['<STR_LIT>'])),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if ( ('<STR_LIT>' in cpd['<STR_LIT>']) and<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] is not None) and<EOL>(np.isfinite(cpd['<STR_LIT>']['<STR_LIT>'])) and<EOL>('<STR_LIT>' in cpd['<STR_LIT>']) and<EOL>(cpd['<STR_LIT>']['<STR_LIT>'] is not None) and<EOL>(np.isfinite(cpd['<STR_LIT>']['<STR_LIT>'])) ):<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(cpd['<STR_LIT>']['<STR_LIT>'],<EOL>cpd['<STR_LIT>']['<STR_LIT>'])),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>if '<STR_LIT>' in cpd['<STR_LIT>'] and cpd['<STR_LIT>']['<STR_LIT>']:<EOL><INDENT>objtagsplit = cpd['<STR_LIT>']['<STR_LIT>'].split('<STR_LIT:U+002C>')<EOL>nobjtaglines = int(np.ceil(len(objtagsplit)/<NUM_LIT>))<EOL>for objtagline in range(nobjtaglines):<EOL><INDENT>objtagslice = '<STR_LIT:U+002C>'.join(objtagsplit[objtagline*<NUM_LIT:3>:objtagline*<NUM_LIT:3>+<NUM_LIT:3>])<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>+objtagline*<NUM_LIT>),<EOL>objtagslice,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT>, <NUM_LIT>, <NUM_LIT:0>, <NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT>objisvar = cpd['<STR_LIT>']['<STR_LIT>']<EOL>if objisvar == '<STR_LIT:0>':<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar == '<STR_LIT:1>':<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar == '<STR_LIT:2>':<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar == '<STR_LIT:3>':<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar is None:<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar is True:<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>elif objisvar is False:<EOL><INDENT>objvarflag = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>objvarflag = '<STR_LIT>' % objisvar<EOL><DEDENT>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>objvarflag,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>(cpd['<STR_LIT>']['<STR_LIT>']<EOL>if cpd['<STR_LIT>']['<STR_LIT>'] is not None<EOL>else np.nan)),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>),<EOL>('<STR_LIT>' %<EOL>(cpd['<STR_LIT>']['<STR_LIT>']<EOL>if cpd['<STR_LIT>']['<STR_LIT>'] is not None<EOL>else np.nan)),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL>if cpd['<STR_LIT>']['<STR_LIT>']:<EOL><INDENT>vartagsplit = cpd['<STR_LIT>']['<STR_LIT>'].split('<STR_LIT:U+002C>')<EOL>nvartaglines = int(np.ceil(len(vartagsplit)/<NUM_LIT>))<EOL>for vartagline in range(nvartaglines):<EOL><INDENT>vartagslice = '<STR_LIT:U+002C>'.join(vartagsplit[vartagline*<NUM_LIT:3>:vartagline*<NUM_LIT:3>+<NUM_LIT:3>])<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>+vartagline*<NUM_LIT>),<EOL>vartagslice,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT>, <NUM_LIT>, <NUM_LIT:0>, <NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT>if '<STR_LIT>' in cpd and cpd['<STR_LIT>']:<EOL><INDENT>commentsplit = cpd['<STR_LIT>'].split('<STR_LIT:U+0020>')<EOL>ncommentlines = int(np.ceil(len(commentsplit)/<NUM_LIT>))<EOL>for commentline in range(ncommentlines):<EOL><INDENT>commentslice = '<STR_LIT:U+0020>'.join(<EOL>commentsplit[commentline*<NUM_LIT:10>:commentline*<NUM_LIT:10>+<NUM_LIT:10>]<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>+commentline*<NUM_LIT>),<EOL>commentslice,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in cpd and cpd['<STR_LIT>']:<EOL><INDENT>commentsplit = cpd['<STR_LIT>'].split('<STR_LIT:U+0020>')<EOL>ncommentlines = int(np.ceil(len(commentsplit)/<NUM_LIT>))<EOL>for commentline in range(ncommentlines):<EOL><INDENT>commentslice = '<STR_LIT:U+0020>'.join(<EOL>commentsplit[commentline*<NUM_LIT:10>:commentline*<NUM_LIT:10>+<NUM_LIT:10>]<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>, <NUM_LIT>+commentline*<NUM_LIT>),<EOL>commentslice,<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT>if (cpd['<STR_LIT>'] and<EOL>'<STR_LIT>' in cpd['<STR_LIT>'] and<EOL>cpd['<STR_LIT>']['<STR_LIT>']):<EOL><INDENT>magseries = Image.open(<EOL>_base64_to_file(cpd['<STR_LIT>']['<STR_LIT>'], None, writetostrio=True)<EOL>)<EOL>outimg.paste(magseries,(<NUM_LIT>*<NUM_LIT:3>,<NUM_LIT:0>))<EOL><DEDENT>elif ('<STR_LIT>' in cpd and isinstance(cpd['<STR_LIT>'],str)):<EOL><INDENT>magseries = Image.open(<EOL>_base64_to_file(cpd['<STR_LIT>'], None, writetostrio=True)<EOL>)<EOL>outimg.paste(magseries,(<NUM_LIT>*<NUM_LIT:3>,<NUM_LIT:0>))<EOL><DEDENT>for lspmethodind, lspmethod in enumerate(cplspmethods):<EOL><INDENT>if (cpd[lspmethod] and cpd[lspmethod]['<STR_LIT>']):<EOL><INDENT>pgram = Image.open(<EOL>_base64_to_file(cpd[lspmethod]['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(pgram,(<NUM_LIT:0>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>if (cpd[lspmethod] and <NUM_LIT:0> in cpd[lspmethod] and cpd[lspmethod][<NUM_LIT:0>]):<EOL><INDENT>plc1 = Image.open(<EOL>_base64_to_file(cpd[lspmethod][<NUM_LIT:0>]['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc1,(<NUM_LIT>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>elif (cpd[lspmethod] and '<STR_LIT>' in cpd[lspmethod] and<EOL>isinstance(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], str)):<EOL><INDENT>plc1 = Image.open(<EOL>_base64_to_file(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc1,(<NUM_LIT>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>if (cpd[lspmethod] and <NUM_LIT:1> in cpd[lspmethod] and cpd[lspmethod][<NUM_LIT:1>]):<EOL><INDENT>plc2 = Image.open(<EOL>_base64_to_file(cpd[lspmethod][<NUM_LIT:1>]['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc2,(<NUM_LIT>*<NUM_LIT:2>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>elif (cpd[lspmethod] and '<STR_LIT>' in cpd[lspmethod] and<EOL>isinstance(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], str)):<EOL><INDENT>plc2 = Image.open(<EOL>_base64_to_file(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc2,(<NUM_LIT>*<NUM_LIT:2>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>if (cpd[lspmethod] and <NUM_LIT:2> in cpd[lspmethod] and cpd[lspmethod][<NUM_LIT:2>]):<EOL><INDENT>plc3 = Image.open(<EOL>_base64_to_file(cpd[lspmethod][<NUM_LIT:2>]['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc3,(<NUM_LIT>*<NUM_LIT:3>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT>elif (cpd[lspmethod] and '<STR_LIT>' in cpd[lspmethod] and<EOL>isinstance(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], str)):<EOL><INDENT>plc3 = Image.open(<EOL>_base64_to_file(cpd[lspmethod]['<STR_LIT>']['<STR_LIT>'], None,<EOL>writetostrio=True)<EOL>)<EOL>outimg.paste(plc3,(<NUM_LIT>*<NUM_LIT:3>,<NUM_LIT> + <NUM_LIT>*lspmethodind))<EOL><DEDENT><DEDENT>if erows > <NUM_LIT:0>:<EOL><INDENT>for erowind, erow in enumerate(extrarows):<EOL><INDENT>for ecolind, ecol in enumerate(erow[:<NUM_LIT:4>]):<EOL><INDENT>eplot = Image.open(ecol)<EOL>eplotresized = eplot.resize((<NUM_LIT>,<NUM_LIT>), Image.ANTIALIAS)<EOL>outimg.paste(eplotresized,<EOL>(<NUM_LIT>*ecolind,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + <NUM_LIT>*erowind))<EOL><DEDENT><DEDENT><DEDENT>if cpderows > <NUM_LIT:0>:<EOL><INDENT>for cpderowind, cpderow in enumerate(cpd['<STR_LIT>']):<EOL><INDENT>for cpdecolind, cpdecol in enumerate(cpderow[:<NUM_LIT:4>]):<EOL><INDENT>cpdeplot = Image.open(cpdecol)<EOL>cpdeplotresized = cpdeplot.resize((<NUM_LIT>,<NUM_LIT>), Image.ANTIALIAS)<EOL>outimg.paste(cpdeplotresized,<EOL>(<NUM_LIT>*cpdecolind,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + <NUM_LIT>*cpderowind))<EOL><DEDENT><DEDENT><DEDENT>if nbrrows > <NUM_LIT:0>:<EOL><INDENT>for nbrind, nbr in enumerate(cpd['<STR_LIT>']):<EOL><INDENT>nbrlspmethods = []<EOL>for lspmethod in cpd['<STR_LIT>']:<EOL><INDENT>if lspmethod in nbr:<EOL><INDENT>nbrlspmethods.append(lspmethod)<EOL><DEDENT><DEDENT>nbrlspmethods = nbrlspmethods[:<NUM_LIT:3>]<EOL>try:<EOL><INDENT>nbrlc = Image.open(<EOL>_base64_to_file(<EOL>nbr['<STR_LIT>']['<STR_LIT>'], None, writetostrio=True<EOL>)<EOL>)<EOL>outimg.paste(nbrlc,<EOL>(<NUM_LIT>*<NUM_LIT:0>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind))<EOL>objinfodraw.text(<EOL>(<NUM_LIT>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind + <NUM_LIT:15>),<EOL>('<STR_LIT>' % (nbrind + <NUM_LIT:1>, nbr['<STR_LIT>'])),<EOL>font=cpfontlarge,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL>objinfodraw.text(<EOL>(<NUM_LIT>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind + <NUM_LIT:50>),<EOL>('<STR_LIT>' %<EOL>(nbr['<STR_LIT>'], nbr['<STR_LIT>'], nbr['<STR_LIT>'])),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL>lsp1lc = Image.open(<EOL>_base64_to_file(<EOL>nbr[nbrlspmethods[<NUM_LIT:0>]][<NUM_LIT:0>]['<STR_LIT>'], None,<EOL>writetostrio=True<EOL>)<EOL>)<EOL>outimg.paste(lsp1lc,<EOL>(<NUM_LIT>*<NUM_LIT:1>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind))<EOL>lsp2lc = Image.open(<EOL>_base64_to_file(<EOL>nbr[nbrlspmethods[<NUM_LIT:1>]][<NUM_LIT:0>]['<STR_LIT>'], None,<EOL>writetostrio=True<EOL>)<EOL>)<EOL>outimg.paste(lsp2lc,<EOL>(<NUM_LIT>*<NUM_LIT:2>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind))<EOL>lsp3lc = Image.open(<EOL>_base64_to_file(<EOL>nbr[nbrlspmethods[<NUM_LIT:2>]][<NUM_LIT:0>]['<STR_LIT>'], None,<EOL>writetostrio=True<EOL>)<EOL>)<EOL>outimg.paste(lsp3lc,<EOL>(<NUM_LIT>*<NUM_LIT:3>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind))<EOL><DEDENT>except Exception as e:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' % nbr['<STR_LIT>'])<EOL>objinfodraw.text(<EOL>(<NUM_LIT>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind + <NUM_LIT:15>),<EOL>('<STR_LIT>' %<EOL>(nbrind + <NUM_LIT:1>, nbr['<STR_LIT>'])),<EOL>font=cpfontlarge,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL>if '<STR_LIT>' in nbr and '<STR_LIT>' in nbr and '<STR_LIT>' in nbr:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind + <NUM_LIT:50>),<EOL>('<STR_LIT>' %<EOL>(nbr['<STR_LIT>'], nbr['<STR_LIT>'], nbr['<STR_LIT>'])),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT>elif '<STR_LIT>' in nbr:<EOL><INDENT>objinfodraw.text(<EOL>(<NUM_LIT>,<EOL>(cprows+<NUM_LIT:1>)*<NUM_LIT> + (erows*<NUM_LIT>) + (cpderows*<NUM_LIT>) +<EOL><NUM_LIT>*nbrind + <NUM_LIT:50>),<EOL>('<STR_LIT>' %<EOL>(nbr['<STR_LIT>']['<STR_LIT>'],<EOL>nbr['<STR_LIT>']['<STR_LIT>'],<EOL>nbr['<STR_LIT>']['<STR_LIT>'])),<EOL>font=cpfontnormal,<EOL>fill=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:255>,<NUM_LIT:255>)<EOL>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if sys.version_info[:<NUM_LIT:2>] < (<NUM_LIT:3>,<NUM_LIT:0>):<EOL><INDENT>is_strio = isinstance(outfile, cStringIO.InputType)<EOL><DEDENT>else:<EOL><INDENT>is_strio = isinstance(outfile, StrIO)<EOL><DEDENT>if not is_strio:<EOL><INDENT>if outfile.endswith('<STR_LIT>'):<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>outfile = outfile.replace('<STR_LIT>','<STR_LIT>')<EOL><DEDENT><DEDENT>outimg.save(outfile, format='<STR_LIT>', optimize=True)<EOL>if not is_strio:<EOL><INDENT>if os.path.exists(outfile):<EOL><INDENT>LOGINFO('<STR_LIT>' % outfile)<EOL>return outfile<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>')<EOL>return None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>LOGINFO('<STR_LIT>')<EOL>return outfile<EOL><DEDENT>

This reads the checkplot pickle or dict provided, and writes out a PNG.

    The output PNG contains most of the information in the input checkplot
    pickle/dict, and can be used to quickly glance through the highlights
    instead of having to review the checkplot with the `checkplotserver`
    webapp. This is useful for exporting read-only views of finalized checkplots
    from the `checkplotserver` as well, to share them with other people.

    The PNG has 4 x N tiles::

        [    finder    ] [  objectinfo  ] [ varinfo/comments ] [ unphased LC  ]
        [ periodogram1 ] [ phased LC P1 ] [   phased LC P2   ] [ phased LC P3 ]
        [ periodogram2 ] [ phased LC P1 ] [   phased LC P2   ] [ phased LC P3 ]
                                         .
                                         .
        [ periodogramN ] [ phased LC P1 ] [ phased LC P2 ] [ phased LC P3 ]

    for N independent period-finding methods producing:

    - periodogram1,2,3...N: the periodograms from each method

    - phased LC P1,P2,P3: the phased lightcurves using the best 3 peaks in each
      periodogram

    Parameters
    ----------

    checkplotin : dict or str
        This is either a checkplotdict produced by
        :py:func:`astrobase.checkplot.pkl.checkplot_dict` or a checkplot pickle
        file produced by :py:func:`astrobase.checkplot.pkl.checkplot_pickle`.

    outfile : str
        The filename of the output PNG file to create.

    extrarows : list of tuples
        This is a list of 4-element tuples containing paths to PNG files that
        will be added to the end of the rows generated from the checkplotin
        pickle/dict. Each tuple represents a row in the final output PNG
        file. If there are less than 4 elements per tuple, the missing elements
        will be filled in with white-space. If there are more than 4 elements
        per tuple, only the first four will be used.

        The purpose of this kwarg is to incorporate periodograms and phased LC
        plots (in the form of PNGs) generated from an external period-finding
        function or program (like VARTOOLS) to allow for comparison with
        astrobase results.

        NOTE: the PNG files specified in `extrarows` here will be added to those
        already present in the input checkplotdict['externalplots'] if that is
        None because you passed in a similar list of external plots to the
        :py:func:`astrobase.checkplot.pkl.checkplot_pickle` function earlier. In
        this case, `extrarows` can be used to add even more external plots if
        desired.

        Each external plot PNG will be resized to 750 x 480 pixels to fit into
        an output image cell.

        By convention, each 4-element tuple should contain:

        - a periodiogram PNG
        - phased LC PNG with 1st best peak period from periodogram
        - phased LC PNG with 2nd best peak period from periodogram
        - phased LC PNG with 3rd best peak period from periodogram

        Example of extrarows::

            [('/path/to/external/bls-periodogram.png',
              '/path/to/external/bls-phasedlc-plot-bestpeak.png',
              '/path/to/external/bls-phasedlc-plot-peak2.png',
              '/path/to/external/bls-phasedlc-plot-peak3.png'),
             ('/path/to/external/pdm-periodogram.png',
              '/path/to/external/pdm-phasedlc-plot-bestpeak.png',
              '/path/to/external/pdm-phasedlc-plot-peak2.png',
              '/path/to/external/pdm-phasedlc-plot-peak3.png'),
            ...]

    Returns
    -------

    str
        The absolute path to the generated checkplot PNG.


if checkplotin.endswith('<STR_LIT>'):<EOL><INDENT>outfile = checkplotin.replace('<STR_LIT>','<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>outfile = checkplotin.replace('<STR_LIT>','<STR_LIT>')<EOL><DEDENT>return checkplot_pickle_to_png(checkplotin, outfile, extrarows=extrarows)<EOL>

This is just a shortened form of the function above for convenience.

    This only handles pickle files as input.

    Parameters
    ----------

    checkplotin : str
        File name of a checkplot pickle file to convert to a PNG.

    extrarows : list of tuples
        This is a list of 4-element tuples containing paths to PNG files that
        will be added to the end of the rows generated from the checkplotin
        pickle/dict. Each tuple represents a row in the final output PNG
        file. If there are less than 4 elements per tuple, the missing elements
        will be filled in with white-space. If there are more than 4 elements
        per tuple, only the first four will be used.

        The purpose of this kwarg is to incorporate periodograms and phased LC
        plots (in the form of PNGs) generated from an external period-finding
        function or program (like VARTOOLS) to allow for comparison with
        astrobase results.

        NOTE: the PNG files specified in `extrarows` here will be added to those
        already present in the input `checkplotdict['externalplots']` if that is
        None because you passed in a similar list of external plots to the
        :py:func:`astrobase.checkplot.pkl.checkplot_pickle` function earlier. In
        this case, `extrarows` can be used to add even more external plots if
        desired.

        Each external plot PNG will be resized to 750 x 480 pixels to fit into
        an output image cell.

        By convention, each 4-element tuple should contain:

        - a periodiogram PNG
        - phased LC PNG with 1st best peak period from periodogram
        - phased LC PNG with 2nd best peak period from periodogram
        - phased LC PNG with 3rd best peak period from periodogram

        Example of extrarows::

            [('/path/to/external/bls-periodogram.png',
              '/path/to/external/bls-phasedlc-plot-bestpeak.png',
              '/path/to/external/bls-phasedlc-plot-peak2.png',
              '/path/to/external/bls-phasedlc-plot-peak3.png'),
             ('/path/to/external/pdm-periodogram.png',
              '/path/to/external/pdm-phasedlc-plot-bestpeak.png',
              '/path/to/external/pdm-phasedlc-plot-peak2.png',
              '/path/to/external/pdm-phasedlc-plot-peak3.png'),
            ...]

    Returns
    -------

    str
        The absolute path to the generated checkplot PNG.


<EOL>try:<EOL><INDENT>objuuid = hashlib.sha512(times[<NUM_LIT:5>:<NUM_LIT:10>].tostring() +<EOL>mags[<NUM_LIT:5>:<NUM_LIT:10>].tostring()).hexdigest()[:<NUM_LIT:5>]<EOL><DEDENT>except Exception as e:<EOL><INDENT>if verbose:<EOL><INDENT>LOGWARNING('<STR_LIT>')<EOL>objuuid = hashlib.sha512(times.tostring() +<EOL>mags.tostring()).hexdigest()[:<NUM_LIT:5>]<EOL><DEDENT><DEDENT>if (objectinfo is None):<EOL><INDENT>if verbose:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>objectinfo = {'<STR_LIT>':objuuid}<EOL><DEDENT>elif (isinstance(objectinfo, dict) and '<STR_LIT>' in objectinfo):<EOL><INDENT>objectinfo['<STR_LIT>'] = objectinfo['<STR_LIT>']<EOL><DEDENT>elif ((isinstance(objectinfo, dict) and '<STR_LIT>' not in objectinfo) or<EOL>(isinstance(objectinfo, dict) and '<STR_LIT>' in objectinfo and<EOL>(objectinfo['<STR_LIT>'] is None or objectinfo['<STR_LIT>'] == '<STR_LIT>'))):<EOL><INDENT>if verbose:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>objectinfo['<STR_LIT>'] = objuuid<EOL><DEDENT>checkplotdict = _pkl_finder_objectinfo(<EOL>objectinfo,<EOL>varinfo,<EOL>findercmap,<EOL>finderconvolve,<EOL>sigclip,<EOL>normto,<EOL>normmingap,<EOL>deredden_object=deredden_object,<EOL>custom_bandpasses=custom_bandpasses,<EOL>lclistpkl=lclistpkl,<EOL>nbrradiusarcsec=nbrradiusarcsec,<EOL>maxnumneighbors=maxnumneighbors,<EOL>plotdpi=plotdpi,<EOL>verbose=verbose,<EOL>findercachedir=findercachedir,<EOL>gaia_submit_timeout=gaia_submit_timeout,<EOL>gaia_submit_tries=gaia_submit_tries,<EOL>gaia_max_timeout=gaia_max_timeout,<EOL>gaia_mirror=gaia_mirror,<EOL>complete_query_later=complete_query_later,<EOL>fast_mode=fast_mode<EOL>)<EOL>if (objectinfo and isinstance(objectinfo, dict) and<EOL>'<STR_LIT>' in objectinfo and objectinfo['<STR_LIT>']):<EOL><INDENT>checkplotdict['<STR_LIT>'] = objectinfo['<STR_LIT>']<EOL><DEDENT>stimes, smags, serrs = sigclip_magseries(times,<EOL>mags,<EOL>errs,<EOL>magsarefluxes=magsarefluxes,<EOL>sigclip=sigclip)<EOL>if ((stimes is None) or (smags is None) or (serrs is None) or<EOL>(stimes.size < <NUM_LIT>) or (smags.size < <NUM_LIT>) or (serrs.size < <NUM_LIT>)):<EOL><INDENT>LOGERROR("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>checkplotdict['<STR_LIT>'])<EOL>checkplotdict['<STR_LIT>'] = None<EOL>checkplotdict['<STR_LIT:status>'] = '<STR_LIT>'<EOL>return checkplotdict<EOL><DEDENT>if isinstance(stimes, AstColumn):<EOL><INDENT>stimes = stimes.data<EOL>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if isinstance(smags, AstColumn):<EOL><INDENT>smags = smags.data<EOL>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if isinstance(serrs, AstColumn):<EOL><INDENT>serrs = serrs.data<EOL>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(sigclip, len(times), len(stimes)))<EOL><DEDENT>if normto is not False:<EOL><INDENT>stimes, smags = normalize_magseries(stimes, smags,<EOL>normto=normto,<EOL>magsarefluxes=magsarefluxes,<EOL>mingap=normmingap)<EOL><DEDENT>if len(stimes) > mindet:<EOL><INDENT>magseriesdict = _pkl_magseries_plot(stimes, smags, serrs,<EOL>plotdpi=plotdpi,<EOL>magsarefluxes=magsarefluxes)<EOL>checkplotdict.update(magseriesdict)<EOL>checkplot_pfmethods = []<EOL>for lspind, lspinfo in enumerate(lspinfolist):<EOL><INDENT>if isinstance(lspinfo,str) and os.path.exists(lspinfo):<EOL><INDENT>LOGINFO('<STR_LIT>' % lspinfo)<EOL>if '<STR_LIT>' in lspinfo:<EOL><INDENT>with gzip.open(lspinfo,'<STR_LIT:rb>') as infd:<EOL><INDENT>lspinfo = pickle.load(infd)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>with open(lspinfo,'<STR_LIT:rb>') as infd:<EOL><INDENT>lspinfo = pickle.load(infd)<EOL><DEDENT><DEDENT><DEDENT>override_pfmethod = '<STR_LIT>' % (lspind, lspinfo['<STR_LIT>'])<EOL>periodogramdict = _pkl_periodogram(<EOL>lspinfo,<EOL>plotdpi=plotdpi,<EOL>override_pfmethod=override_pfmethod<EOL>)<EOL>checkplotdict.update(periodogramdict)<EOL>for nbpind, nbperiod in enumerate(<EOL>lspinfo['<STR_LIT>'][:nperiodstouse]<EOL>):<EOL><INDENT>if lcfitfunc:<EOL><INDENT>try:<EOL><INDENT>if lcfitparams is None:<EOL><INDENT>lcfitparams = {}<EOL><DEDENT>overplotfit = lcfitfunc(stimes,<EOL>smags,<EOL>serrs,<EOL>nbperiod,<EOL>**lcfitparams)<EOL><DEDENT>except Exception as e:<EOL><INDENT>LOGEXCEPTION('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>overplotfit = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>overplotfit = None<EOL><DEDENT>if (lspinfo is not None and<EOL>'<STR_LIT>' in lspinfo['<STR_LIT>'] and<EOL>'<STR_LIT>' in lspinfo):<EOL><INDENT>thisvarepoch = lspinfo['<STR_LIT>'][nbpind]<EOL>if verbose:<EOL><INDENT>LOGINFO(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% (thisvarepoch, nbperiod)<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>thisvarepoch = varepoch<EOL><DEDENT>checkplotdict = _pkl_phased_magseries_plot(<EOL>checkplotdict,<EOL>lspinfo['<STR_LIT>'],<EOL>nbpind,<EOL>stimes, smags, serrs,<EOL>nbperiod, thisvarepoch,<EOL>lspmethodind=lspind,<EOL>phasewrap=phasewrap,<EOL>phasesort=phasesort,<EOL>phasebin=phasebin,<EOL>minbinelems=minbinelems,<EOL>plotxlim=plotxlim,<EOL>overplotfit=overplotfit,<EOL>plotdpi=plotdpi,<EOL>bestperiodhighlight=bestperiodhighlight,<EOL>magsarefluxes=magsarefluxes,<EOL>xliminsetmode=xliminsetmode,<EOL>xgridlines=xgridlines,<EOL>verbose=verbose,<EOL>override_pfmethod=override_pfmethod,<EOL>)<EOL><DEDENT>if '<STR_LIT>' in lspinfo:<EOL><INDENT>if override_pfmethod in checkplotdict:<EOL><INDENT>checkplotdict[override_pfmethod]['<STR_LIT>'] = (<EOL>lspinfo['<STR_LIT>']<EOL>)<EOL><DEDENT><DEDENT>if '<STR_LIT>' in lspinfo:<EOL><INDENT>if override_pfmethod in checkplotdict:<EOL><INDENT>checkplotdict[override_pfmethod]['<STR_LIT>'] = (<EOL>lspinfo['<STR_LIT>']<EOL>)<EOL><DEDENT><DEDENT>if '<STR_LIT>' in lspinfo:<EOL><INDENT>if override_pfmethod in checkplotdict:<EOL><INDENT>checkplotdict[override_pfmethod]['<STR_LIT>'] = (<EOL>lspinfo['<STR_LIT>']<EOL>)<EOL><DEDENT><DEDENT>checkplot_pfmethods.append(override_pfmethod)<EOL><DEDENT>checkplotdict['<STR_LIT>'] = None<EOL>if getvarfeatures is True:<EOL><INDENT>checkplotdict['<STR_LIT>']['<STR_LIT>'] = all_nonperiodic_features(<EOL>stimes,<EOL>smags,<EOL>serrs,<EOL>magsarefluxes=magsarefluxes,<EOL>)<EOL><DEDENT>checkplotdict['<STR_LIT>'] = {}<EOL>checkplotdict['<STR_LIT>'] = []<EOL>if (externalplots and<EOL>isinstance(externalplots, list) and<EOL>len(externalplots) > <NUM_LIT:0>):<EOL><INDENT>for externalrow in externalplots:<EOL><INDENT>if all(os.path.exists(erowfile) for erowfile in externalrow):<EOL><INDENT>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>' %<EOL>repr(externalrow))<EOL><DEDENT>checkplotdict['<STR_LIT>'].append(externalrow)<EOL><DEDENT>else:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>% repr(externalrow))<EOL><DEDENT><DEDENT><DEDENT>if xmatchinfo is not None:<EOL><INDENT>checkplotdict = xmatch_external_catalogs(<EOL>checkplotdict,<EOL>xmatchinfo,<EOL>xmatchradiusarcsec=xmatchradiusarcsec<EOL>)<EOL><DEDENT>contents = sorted(list(checkplotdict.keys()))<EOL>checkplotdict['<STR_LIT:status>'] = '<STR_LIT>' % contents<EOL>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>' %<EOL>checkplotdict['<STR_LIT>'])<EOL>LOGINFO('<STR_LIT>' % contents)<EOL><DEDENT>checkplotdict['<STR_LIT>'] = checkplot_pfmethods<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>' %<EOL>(checkplotdict['<STR_LIT>'],len(stimes),mindet))<EOL>checkplotdict['<STR_LIT>'] = None<EOL>checkplotdict['<STR_LIT:status>'] = '<STR_LIT>'<EOL><DEDENT>return checkplotdict<EOL>

This writes a multiple lspinfo checkplot to a dict.

    This function can take input from multiple lspinfo dicts (e.g. a list of
    output dicts or gzipped pickles of dicts from independent runs of BLS, PDM,
    AoV, or GLS period-finders in periodbase).

    NOTE: if `lspinfolist` contains more than one lspinfo object with the same
    lspmethod ('pdm','gls','sls','aov','bls'), the latest one in the list will
    overwrite the earlier ones.

    The output dict contains all the plots (magseries and phased magseries),
    periodograms, object information, variability information, light curves, and
    phased light curves. This can be written to:

    - a pickle with `checkplot_pickle` below
    - a PNG with `checkplot.pkl_png.checkplot_pickle_to_png`

    Parameters
    ----------

    lspinfolist : list of dicts
        This is a list of dicts containing period-finder results ('lspinfo'
        dicts). These can be from any of the period-finder methods in
        astrobase.periodbase. To incorporate external period-finder results into
        checkplots, these dicts must be of the form below, including at least
        the keys indicated here::

            {'periods': np.array of all periods searched by the period-finder,
             'lspvals': np.array of periodogram power value for each period,
             'bestperiod': a float value that is the period with the highest
                           peak in the periodogram, i.e. the most-likely actual
                           period,
             'method': a three-letter code naming the period-finder used; must
                       be one of the keys in the
                       `astrobase.periodbase.METHODLABELS` dict,
             'nbestperiods': a list of the periods corresponding to periodogram
                             peaks (`nbestlspvals` below) to annotate on the
                             periodogram plot so they can be called out
                             visually,
             'nbestlspvals': a list of the power values associated with
                             periodogram peaks to annotate on the periodogram
                             plot so they can be called out visually; should be
                             the same length as `nbestperiods` above}

        `nbestperiods` and `nbestlspvals` in each lspinfo dict must have at
        least as many elements as the `nperiodstouse` kwarg to this function.

    times,mags,errs : np.arrays
        The magnitude/flux time-series to process for this checkplot along with
        their associated measurement errors.

    fast_mode : bool or float
        This runs the external catalog operations in a "fast" mode, with short
        timeouts and not trying to hit external catalogs that take a long time
        to respond.

        If this is set to True, the default settings for the external requests
        will then become::

                skyview_lookup = False
                skyview_timeout = 10.0
                skyview_retry_failed = False
                dust_timeout = 10.0
                gaia_submit_timeout = 7.0
                gaia_max_timeout = 10.0
                gaia_submit_tries = 2
                complete_query_later = False
                search_simbad = False

        If this is a float, will run in "fast" mode with the provided timeout
        value in seconds and the following settings::

                skyview_lookup = True
                skyview_timeout = fast_mode
                skyview_retry_failed = False
                dust_timeout = fast_mode
                gaia_submit_timeout = 0.66*fast_mode
                gaia_max_timeout = fast_mode
                gaia_submit_tries = 2
                complete_query_later = False
                search_simbad = False

    magsarefluxes : bool
        If True, indicates the input time-series is fluxes and not mags so the
        plot y-axis direction and range can be set appropriately.

    nperiodstouse : int
        This controls how many 'best' periods to make phased LC plots for. By
        default, this is the 3 best. If this is set to None, all 'best' periods
        present in each lspinfo dict's 'nbestperiods' key will be processed for
        this checkplot.

    objectinfo : dict or None
        This is a dict containing information on the object whose light
        curve is being processed. This function will then be able to
        look up and download a finder chart for this object and write
        that to the output checkplotdict. External services such as
        GAIA, SIMBAD, TIC, etc. will also be used to look up this object
        by its coordinates, and will add in information available from
        those services.

        This dict must be of the form and contain at least the keys described
        below::

            {'objectid': the name of the object,
             'ra': the right ascension of the object in decimal degrees,
             'decl': the declination of the object in decimal degrees,
             'ndet': the number of observations of this object}

        You can also provide magnitudes and proper motions of the object using
        the following keys and the appropriate values in the `objectinfo`
        dict. These will be used to calculate colors, total and reduced proper
        motion, etc. and display these in the output checkplot PNG::

            'pmra'   -> the proper motion in mas/yr in right ascension,
            'pmdecl' -> the proper motion in mas/yr in declination,
            'umag'  -> U mag		 -> colors: U-B, U-V, U-g
            'bmag'  -> B mag		 -> colors: U-B, B-V
            'vmag'  -> V mag		 -> colors: U-V, B-V, V-R, V-I, V-K
            'rmag'  -> R mag		 -> colors: V-R, R-I
            'imag'  -> I mag		 -> colors: g-I, V-I, R-I, B-I
            'jmag'  -> 2MASS J mag	 -> colors: J-H, J-K, g-J, i-J
            'hmag'  -> 2MASS H mag	 -> colors: J-H, H-K
            'kmag'  -> 2MASS Ks mag	 -> colors: g-Ks, H-Ks, J-Ks, V-Ks
            'sdssu' -> SDSS u mag	 -> colors: u-g, u-V
            'sdssg' -> SDSS g mag	 -> colors: g-r, g-i, g-K, u-g, U-g, g-J
            'sdssr' -> SDSS r mag	 -> colors: r-i, g-r
            'sdssi' -> SDSS i mag	 -> colors: r-i, i-z, g-i, i-J, i-W1
            'sdssz' -> SDSS z mag	 -> colors: i-z, z-W2, g-z
            'ujmag' -> UKIRT J mag	 -> colors: J-H, H-K, J-K, g-J, i-J
            'uhmag' -> UKIRT H mag	 -> colors: J-H, H-K
            'ukmag' -> UKIRT K mag	 -> colors: g-K, H-K, J-K, V-K
            'irac1' -> Spitzer IRAC1 mag -> colors: i-I1, I1-I2
            'irac2' -> Spitzer IRAC2 mag -> colors: I1-I2, I2-I3
            'irac3' -> Spitzer IRAC3 mag -> colors: I2-I3
            'irac4' -> Spitzer IRAC4 mag -> colors: I3-I4
            'wise1' -> WISE W1 mag	 -> colors: i-W1, W1-W2
            'wise2' -> WISE W2 mag	 -> colors: W1-W2, W2-W3
            'wise3' -> WISE W3 mag	 -> colors: W2-W3
            'wise4' -> WISE W4 mag	 -> colors: W3-W4

        If you have magnitude measurements in other bands, use the
        `custom_bandpasses` kwarg to pass these in.

        If this is None, no object information will be incorporated into the
        checkplot (kind of making it effectively useless for anything other than
        glancing at the phased light curves at various 'best' periods from the
        period-finder results).

    deredden_object : bool
        If this is True, will use the 2MASS DUST service to get extinction
        coefficients in various bands, and then try to deredden the magnitudes
        and colors of the object already present in the checkplot's objectinfo
        dict.

    custom_bandpasses : dict
        This is a dict used to provide custom bandpass definitions for any
        magnitude measurements in the objectinfo dict that are not automatically
        recognized by :py:func:`astrobase.varclass.starfeatures.color_features`.

    gaia_submit_timeout : float
        Sets the timeout in seconds to use when submitting a request to look up
        the object's information to the GAIA service. Note that if `fast_mode`
        is set, this is ignored.

    gaia_submit_tries : int
        Sets the maximum number of times the GAIA services will be contacted to
        obtain this object's information. If `fast_mode` is set, this is
        ignored, and the services will be contacted only once (meaning that a
        failure to respond will be silently ignored and no GAIA data will be
        added to the checkplot's objectinfo dict).

    gaia_max_timeout : float
        Sets the timeout in seconds to use when waiting for the GAIA service to
        respond to our request for the object's information. Note that if
        `fast_mode` is set, this is ignored.

    gaia_mirror : str or None
        This sets the GAIA mirror to use. This is a key in the
        `services.gaia.GAIA_URLS` dict which defines the URLs to hit for each
        mirror.

    complete_query_later : bool
        If this is True, saves the state of GAIA queries that are not yet
        complete when `gaia_max_timeout` is reached while waiting for the GAIA
        service to respond to our request. A later call for GAIA info on the
        same object will attempt to pick up the results from the existing query
        if it's completed. If `fast_mode` is True, this is ignored.

    varinfo : dict
        If this is None, a blank dict of the form below will be added to the
        checkplotdict::

            {'objectisvar': None -> variability flag (None indicates unset),
             'vartags': CSV str containing variability type tags from review,
             'varisperiodic': None -> periodic variability flag (None -> unset),
             'varperiod': the period associated with the periodic variability,
             'varepoch': the epoch associated with the periodic variability}

        If you provide a dict matching this format in this kwarg, this will be
        passed unchanged to the output checkplotdict produced.

    getvarfeatures : bool
        If this is True, several light curve variability features for this
        object will be calculated and added to the output checkpotdict as
        checkplotdict['varinfo']['features']. This uses the function
        `varclass.varfeatures.all_nonperiodic_features` so see its docstring for
        the measures that are calculated (e.g. Stetson J indices, dispersion
        measures, etc.)

    lclistpkl : dict or str
        If this is provided, must be a dict resulting from reading a catalog
        produced by the `lcproc.catalogs.make_lclist` function or a str path
        pointing to the pickle file produced by that function. This catalog is
        used to find neighbors of the current object in the current light curve
        collection. Looking at neighbors of the object within the radius
        specified by `nbrradiusarcsec` is useful for light curves produced by
        instruments that have a large pixel scale, so are susceptible to
        blending of variability and potential confusion of neighbor variability
        with that of the actual object being looked at. If this is None, no
        neighbor lookups will be performed.

    nbrradiusarcsec : flaot
        The radius in arcseconds to use for a search conducted around the
        coordinates of this object to look for any potential confusion and
        blending of variability amplitude caused by their proximity.

    maxnumneighbors : int
        The maximum number of neighbors that will have their light curves and
        magnitudes noted in this checkplot as potential blends with the target
        object.

    xmatchinfo : str or dict
        This is either the xmatch dict produced by the function
        `load_xmatch_external_catalogs` above, or the path to the xmatch info
        pickle file produced by that function.

    xmatchradiusarcsec : float
        This is the cross-matching radius to use in arcseconds.

    lcfitfunc : Python function or None
        If provided, this should be a Python function that is used to fit a
        model to the light curve. This fit is then overplotted for each phased
        light curve in the checkplot. This function should have the following
        signature:

        `def lcfitfunc(times, mags, errs, period, **lcfitparams)`

        where `lcfitparams` encapsulates all external parameters (i.e. number of
        knots for a spline function, the degree of a Legendre polynomial fit,
        etc., planet transit parameters) This function should return a Python
        dict with the following structure (similar to the functions in
        `astrobase.lcfit`) and at least the keys below::

            {'fittype':<str: name of fit method>,
             'fitchisq':<float: the chi-squared value of the fit>,
             'fitredchisq':<float: the reduced chi-squared value of the fit>,
             'fitinfo':{'fitmags':<ndarray: model mags/fluxes from fit func>},
             'magseries':{'times':<ndarray: times where fitmags are evaluated>}}

        Additional keys in the dict returned from this function can include
        `fitdict['fitinfo']['finalparams']` for the final model fit parameters
        (this will be used by the checkplotserver if present),
        `fitdict['fitinfo']['fitepoch']` for the minimum light epoch returned by
        the model fit, among others.

        In any case, the output dict of `lcfitfunc` will be copied to the output
        checkplotdict as::

            checkplotdict[lspmethod][periodind]['lcfit'][<fittype>]

        for each phased light curve.

    lcfitparams : dict
        A dict containing the LC fit parameters to use when calling the function
        provided in `lcfitfunc`. This contains key-val pairs corresponding to
        parameter names and their respective initial values to be used by the
        fit function.

    externalplots : list of tuples of str
        If provided, this is a list of 4-element tuples containing:

        1. path to PNG of periodogram from an external period-finding method
        2. path to PNG of best period phased LC from the external period-finder
        3. path to PNG of 2nd-best phased LC from the external period-finder
        4. path to PNG of 3rd-best phased LC from the external period-finder

        This can be used to incorporate external period-finding method results
        into the output checkplot pickle or exported PNG to allow for comparison
        with astrobase results.

        Example of externalplots::

                [('/path/to/external/bls-periodogram.png',
                 '/path/to/external/bls-phasedlc-plot-bestpeak.png',
                 '/path/to/external/bls-phasedlc-plot-peak2.png',
                 '/path/to/external/bls-phasedlc-plot-peak3.png'),
                 ('/path/to/external/pdm-periodogram.png',
                 '/path/to/external/pdm-phasedlc-plot-bestpeak.png',
                 '/path/to/external/pdm-phasedlc-plot-peak2.png',
                 '/path/to/external/pdm-phasedlc-plot-peak3.png'),
                 ...]

        If `externalplots` is provided here, these paths will be stored in the
        output checkplotdict. The `checkplot.pkl_png.checkplot_pickle_to_png`
        function can then automatically retrieve these plot PNGs and put
        them into the exported checkplot PNG.

    findercmap : str or matplotlib.cm.ColorMap object
        The Colormap object to use for the finder chart image.

    finderconvolve : astropy.convolution.Kernel object or None
        If not None, the Kernel object to use for convolving the finder image.

    findercachedir : str
        The path to the astrobase cache directory for finder chart downloads
        from the NASA SkyView service.

    normto : {'globalmedian', 'zero'} or a float
        These are specified as below:
        - 'globalmedian' -> norms each mag to the global median of the LC column
        - 'zero'         -> norms each mag to zero
        - a float        -> norms each mag to this specified float value.

    normmingap : float
        This defines how much the difference between consecutive measurements is
        allowed to be to consider them as parts of different timegroups. By
        default it is set to 4.0 days.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    varepoch : 'min' or float or list of lists or None
        The epoch to use for this phased light curve plot tile. If this is a
        float, will use the provided value directly. If this is 'min', will
        automatically figure out the time-of-minimum of the phased light
        curve. If this is None, will use the mimimum value of `stimes` as the
        epoch of the phased light curve plot. If this is a list of lists, will
        use the provided value of `lspmethodind` to look up the current
        period-finder method and the provided value of `periodind` to look up
        the epoch associated with that method and the current period. This is
        mostly only useful when `twolspmode` is True.

    phasewrap : bool
        If this is True, the phased time-series will be wrapped around
        phase 0.0.

    phasesort : bool
        If True, will sort the phased light curve in order of increasing phase.

    phasebin: float
        The bin size to use to group together measurements closer than this
        amount in phase. This is in units of phase. If this is a float, a
        phase-binned version of the phased light curve will be overplotted on
        top of the regular phased light curve.

    minbinelems : int
        The minimum number of elements required per phase bin to include it in
        the phased LC plot.

    plotxlim : sequence of two floats or None
        The x-range (min, max) of the phased light curve plot. If None, will be
        determined automatically.

    xliminsetmode : bool
        If this is True, the generated phased light curve plot will use the
        values of `plotxlim` as the main plot x-axis limits (i.e. zoomed-in if
        `plotxlim` is a range smaller than the full phase range), and will show
        the full phased light curve plot as an smaller inset. Useful for
        planetary transit light curves.

    plotdpi : int
        The resolution of the output plot PNGs in dots per inch.

    bestperiodhighlight : str or None
        If not None, this is a str with a matplotlib color specification to use
        as the background color to highlight the phased light curve plot of the
        'best' period and epoch combination. If None, no highlight will be
        applied.

    xgridlines : list of floats or None
        If this is provided, must be a list of floats corresponding to the phase
        values where to draw vertical dashed lines as a means of highlighting
        these.

    mindet : int
        The minimum of observations the input object's mag/flux time-series must
        have for this function to plot its light curve and phased light
        curve. If the object has less than this number, no light curves will be
        plotted, but the checkplotdict will still contain all of the other
        information.

    verbose : bool
        If True, will indicate progress and warn about problems.

    Returns
    -------

    dict
        Returns a checkplotdict.


<EOL>checkplotdict = checkplot_dict(<EOL>lspinfolist,<EOL>times,<EOL>mags,<EOL>errs,<EOL>magsarefluxes=magsarefluxes,<EOL>nperiodstouse=nperiodstouse,<EOL>objectinfo=objectinfo,<EOL>deredden_object=deredden_object,<EOL>custom_bandpasses=custom_bandpasses,<EOL>gaia_submit_timeout=gaia_submit_timeout,<EOL>gaia_submit_tries=gaia_submit_tries,<EOL>gaia_max_timeout=gaia_max_timeout,<EOL>gaia_mirror=gaia_mirror,<EOL>complete_query_later=complete_query_later,<EOL>varinfo=varinfo,<EOL>getvarfeatures=getvarfeatures,<EOL>lclistpkl=lclistpkl,<EOL>nbrradiusarcsec=nbrradiusarcsec,<EOL>maxnumneighbors=maxnumneighbors,<EOL>xmatchinfo=xmatchinfo,<EOL>xmatchradiusarcsec=xmatchradiusarcsec,<EOL>lcfitfunc=lcfitfunc,<EOL>lcfitparams=lcfitparams,<EOL>externalplots=externalplots,<EOL>findercmap=findercmap,<EOL>finderconvolve=finderconvolve,<EOL>findercachedir=findercachedir,<EOL>normto=normto,<EOL>normmingap=normmingap,<EOL>sigclip=sigclip,<EOL>varepoch=varepoch,<EOL>phasewrap=phasewrap,<EOL>phasesort=phasesort,<EOL>phasebin=phasebin,<EOL>minbinelems=minbinelems,<EOL>plotxlim=plotxlim,<EOL>xliminsetmode=xliminsetmode,<EOL>plotdpi=plotdpi,<EOL>bestperiodhighlight=bestperiodhighlight,<EOL>xgridlines=xgridlines,<EOL>mindet=mindet,<EOL>verbose=verbose,<EOL>fast_mode=fast_mode<EOL>)<EOL>if ((sys.version_info[<NUM_LIT:0>:<NUM_LIT:2>] >= (<NUM_LIT:3>,<NUM_LIT:4>) and not pickleprotocol) or<EOL>(pickleprotocol > <NUM_LIT:2>)):<EOL><INDENT>pickleprotocol = <NUM_LIT:4><EOL><DEDENT>elif ((sys.version_info[<NUM_LIT:0>:<NUM_LIT:2>] >= (<NUM_LIT:3>,<NUM_LIT:0>) and not pickleprotocol) or<EOL>(pickleprotocol > <NUM_LIT:2>)):<EOL><INDENT>pickleprotocol = <NUM_LIT:3><EOL><DEDENT>elif sys.version_info[<NUM_LIT:0>:<NUM_LIT:2>] == (<NUM_LIT:2>,<NUM_LIT:7>) and not pickleprotocol:<EOL><INDENT>pickleprotocol = <NUM_LIT:2><EOL><DEDENT>elif not pickleprotocol:<EOL><INDENT>pickleprotocol = <NUM_LIT:0><EOL><DEDENT>if outgzip:<EOL><INDENT>if (not outfile and<EOL>len(lspinfolist) > <NUM_LIT:0> and<EOL>isinstance(lspinfolist[<NUM_LIT:0>], str)):<EOL><INDENT>plotfpath = os.path.join(os.path.dirname(lspinfolist[<NUM_LIT:0>]),<EOL>'<STR_LIT>' %<EOL>checkplotdict['<STR_LIT>'])<EOL><DEDENT>elif outfile:<EOL><INDENT>plotfpath = outfile<EOL><DEDENT>else:<EOL><INDENT>plotfpath = '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if (not outfile and<EOL>len(lspinfolist) > <NUM_LIT:0> and<EOL>isinstance(lspinfolist[<NUM_LIT:0>], str)):<EOL><INDENT>plotfpath = os.path.join(os.path.dirname(lspinfolist[<NUM_LIT:0>]),<EOL>'<STR_LIT>' %<EOL>checkplotdict['<STR_LIT>'])<EOL><DEDENT>elif outfile:<EOL><INDENT>plotfpath = outfile<EOL><DEDENT>else:<EOL><INDENT>plotfpath = '<STR_LIT>'<EOL><DEDENT><DEDENT>picklefname = _write_checkplot_picklefile(checkplotdict,<EOL>outfile=plotfpath,<EOL>protocol=pickleprotocol,<EOL>outgzip=outgzip)<EOL>if returndict:<EOL><INDENT>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>' % picklefname)<EOL><DEDENT>return checkplotdict, picklefname<EOL><DEDENT>else:<EOL><INDENT>del checkplotdict<EOL>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>' % picklefname)<EOL><DEDENT>return picklefname<EOL><DEDENT>

This writes a multiple lspinfo checkplot to a (gzipped) pickle file.

    This function can take input from multiple lspinfo dicts (e.g. a list of
    output dicts or gzipped pickles of dicts from independent runs of BLS, PDM,
    AoV, or GLS period-finders in periodbase).

    NOTE: if `lspinfolist` contains more than one lspinfo object with the same
    lspmethod ('pdm','gls','sls','aov','bls'), the latest one in the list will
    overwrite the earlier ones.

    The output dict contains all the plots (magseries and phased magseries),
    periodograms, object information, variability information, light curves, and
    phased light curves. This can be written to:

    - a pickle with `checkplot_pickle` below
    - a PNG with `checkplot.pkl_png.checkplot_pickle_to_png`

    Parameters
    ----------

    lspinfolist : list of dicts
        This is a list of dicts containing period-finder results ('lspinfo'
        dicts). These can be from any of the period-finder methods in
        astrobase.periodbase. To incorporate external period-finder results into
        checkplots, these dicts must be of the form below, including at least
        the keys indicated here::

            {'periods': np.array of all periods searched by the period-finder,
             'lspvals': np.array of periodogram power value for each period,
             'bestperiod': a float value that is the period with the highest
                           peak in the periodogram, i.e. the most-likely actual
                           period,
             'method': a three-letter code naming the period-finder used; must
                       be one of the keys in the
                       `astrobase.periodbase.METHODLABELS` dict,
             'nbestperiods': a list of the periods corresponding to periodogram
                             peaks (`nbestlspvals` below) to annotate on the
                             periodogram plot so they can be called out
                             visually,
             'nbestlspvals': a list of the power values associated with
                             periodogram peaks to annotate on the periodogram
                             plot so they can be called out visually; should be
                             the same length as `nbestperiods` above}

        `nbestperiods` and `nbestlspvals` in each lspinfo dict must have at
        least as many elements as the `nperiodstouse` kwarg to this function.

    times,mags,errs : np.arrays
        The magnitude/flux time-series to process for this checkplot along with
        their associated measurement errors.

    fast_mode : bool or float
        This runs the external catalog operations in a "fast" mode, with short
        timeouts and not trying to hit external catalogs that take a long time
        to respond.

        If this is set to True, the default settings for the external requests
        will then become::

            skyview_lookup = False
            skyview_timeout = 10.0
            skyview_retry_failed = False
            dust_timeout = 10.0
            gaia_submit_timeout = 7.0
            gaia_max_timeout = 10.0
            gaia_submit_tries = 2
            complete_query_later = False
            search_simbad = False

        If this is a float, will run in "fast" mode with the provided timeout
        value in seconds and the following settings::

            skyview_lookup = True
            skyview_timeout = fast_mode
            skyview_retry_failed = False
            dust_timeout = fast_mode
            gaia_submit_timeout = 0.66*fast_mode
            gaia_max_timeout = fast_mode
            gaia_submit_tries = 2
            complete_query_later = False
            search_simbad = False

    magsarefluxes : bool
        If True, indicates the input time-series is fluxes and not mags so the
        plot y-axis direction and range can be set appropriately.

    nperiodstouse : int
        This controls how many 'best' periods to make phased LC plots for. By
        default, this is the 3 best. If this is set to None, all 'best' periods
        present in each lspinfo dict's 'nbestperiods' key will be processed for
        this checkplot.

    objectinfo : dict or None
        If provided, this is a dict containing information on the object whose
        light curve is being processed. This function will then be able to look
        up and download a finder chart for this object and write that to the
        output checkplotdict. External services such as GAIA, SIMBAD, TIC@MAST,
        etc. will also be used to look up this object by its coordinates, and
        will add in information available from those services.

        The `objectinfo` dict must be of the form and contain at least the keys
        described below::

            {'objectid': the name of the object,
             'ra': the right ascension of the object in decimal degrees,
             'decl': the declination of the object in decimal degrees,
             'ndet': the number of observations of this object}

        You can also provide magnitudes and proper motions of the object using
        the following keys and the appropriate values in the `objectinfo`
        dict. These will be used to calculate colors, total and reduced proper
        motion, etc. and display these in the output checkplot PNG::

            'pmra' -> the proper motion in mas/yr in right ascension,
            'pmdecl' -> the proper motion in mas/yr in the declination,
            'umag'  -> U mag		 -> colors: U-B, U-V, U-g
            'bmag'  -> B mag		 -> colors: U-B, B-V
            'vmag'  -> V mag		 -> colors: U-V, B-V, V-R, V-I, V-K
            'rmag'  -> R mag		 -> colors: V-R, R-I
            'imag'  -> I mag		 -> colors: g-I, V-I, R-I, B-I
            'jmag'  -> 2MASS J mag	 -> colors: J-H, J-K, g-J, i-J
            'hmag'  -> 2MASS H mag	 -> colors: J-H, H-K
            'kmag'  -> 2MASS Ks mag	 -> colors: g-Ks, H-Ks, J-Ks, V-Ks
            'sdssu' -> SDSS u mag	 -> colors: u-g, u-V
            'sdssg' -> SDSS g mag	 -> colors: g-r, g-i, g-K, u-g, U-g, g-J
            'sdssr' -> SDSS r mag	 -> colors: r-i, g-r
            'sdssi' -> SDSS i mag	 -> colors: r-i, i-z, g-i, i-J, i-W1
            'sdssz' -> SDSS z mag	 -> colors: i-z, z-W2, g-z
            'ujmag' -> UKIRT J mag	 -> colors: J-H, H-K, J-K, g-J, i-J
            'uhmag' -> UKIRT H mag	 -> colors: J-H, H-K
            'ukmag' -> UKIRT K mag	 -> colors: g-K, H-K, J-K, V-K
            'irac1' -> Spitzer IRAC1 mag -> colors: i-I1, I1-I2
            'irac2' -> Spitzer IRAC2 mag -> colors: I1-I2, I2-I3
            'irac3' -> Spitzer IRAC3 mag -> colors: I2-I3
            'irac4' -> Spitzer IRAC4 mag -> colors: I3-I4
            'wise1' -> WISE W1 mag	 -> colors: i-W1, W1-W2
            'wise2' -> WISE W2 mag	 -> colors: W1-W2, W2-W3
            'wise3' -> WISE W3 mag	 -> colors: W2-W3
            'wise4' -> WISE W4 mag	 -> colors: W3-W4

        If you have magnitude measurements in other bands, use the
        `custom_bandpasses` kwarg to pass these in.

        If this is None, no object information will be incorporated into the
        checkplot (kind of making it effectively useless for anything other than
        glancing at the phased light curves at various 'best' periods from the
        period-finder results).

    deredden_object : bool
        If this is True, will use the 2MASS DUST service to get extinction
        coefficients in various bands, and then try to deredden the magnitudes
        and colors of the object already present in the checkplot's objectinfo
        dict.

    custom_bandpasses : dict
        This is a dict used to provide custom bandpass definitions for any
        magnitude measurements in the objectinfo dict that are not automatically
        recognized by :py:func:`astrobase.varclass.starfeatures.color_features`.

    gaia_submit_timeout : float
        Sets the timeout in seconds to use when submitting a request to look up
        the object's information to the GAIA service. Note that if `fast_mode`
        is set, this is ignored.

    gaia_submit_tries : int
        Sets the maximum number of times the GAIA services will be contacted to
        obtain this object's information. If `fast_mode` is set, this is
        ignored, and the services will be contacted only once (meaning that a
        failure to respond will be silently ignored and no GAIA data will be
        added to the checkplot's objectinfo dict).

    gaia_max_timeout : float
        Sets the timeout in seconds to use when waiting for the GAIA service to
        respond to our request for the object's information. Note that if
        `fast_mode` is set, this is ignored.

    gaia_mirror : str or None
        This sets the GAIA mirror to use. This is a key in the
        `services.gaia.GAIA_URLS` dict which defines the URLs to hit for each
        mirror.

    complete_query_later : bool
        If this is True, saves the state of GAIA queries that are not yet
        complete when `gaia_max_timeout` is reached while waiting for the GAIA
        service to respond to our request. A later call for GAIA info on the
        same object will attempt to pick up the results from the existing query
        if it's completed. If `fast_mode` is True, this is ignored.

    varinfo : dict
        If this is None, a blank dict of the form below will be added to the
        checkplotdict::

            {'objectisvar': None -> variability flag (None indicates unset),
             'vartags': CSV str containing variability type tags from review,
             'varisperiodic': None -> periodic variability flag (None -> unset),
             'varperiod': the period associated with the periodic variability,
             'varepoch': the epoch associated with the periodic variability}

        If you provide a dict matching this format in this kwarg, this will be
        passed unchanged to the output checkplotdict produced.

    getvarfeatures : bool
        If this is True, several light curve variability features for this
        object will be calculated and added to the output checkpotdict as
        checkplotdict['varinfo']['features']. This uses the function
        `varclass.varfeatures.all_nonperiodic_features` so see its docstring for
        the measures that are calculated (e.g. Stetson J indices, dispersion
        measures, etc.)

    lclistpkl : dict or str
        If this is provided, must be a dict resulting from reading a catalog
        produced by the `lcproc.catalogs.make_lclist` function or a str path
        pointing to the pickle file produced by that function. This catalog is
        used to find neighbors of the current object in the current light curve
        collection. Looking at neighbors of the object within the radius
        specified by `nbrradiusarcsec` is useful for light curves produced by
        instruments that have a large pixel scale, so are susceptible to
        blending of variability and potential confusion of neighbor variability
        with that of the actual object being looked at. If this is None, no
        neighbor lookups will be performed.

    nbrradiusarcsec : flaot
        The radius in arcseconds to use for a search conducted around the
        coordinates of this object to look for any potential confusion and
        blending of variability amplitude caused by their proximity.

    maxnumneighbors : int
        The maximum number of neighbors that will have their light curves and
        magnitudes noted in this checkplot as potential blends with the target
        object.

    xmatchinfo : str or dict
        This is either the xmatch dict produced by the function
        `load_xmatch_external_catalogs` above, or the path to the xmatch info
        pickle file produced by that function.

    xmatchradiusarcsec : float
        This is the cross-matching radius to use in arcseconds.

    lcfitfunc : Python function or None
        If provided, this should be a Python function that is used to fit a
        model to the light curve. This fit is then overplotted for each phased
        light curve in the checkplot. This function should have the following
        signature:

        `def lcfitfunc(times, mags, errs, period, **lcfitparams)`

        where `lcfitparams` encapsulates all external parameters (i.e. number of
        knots for a spline function, the degree of a Legendre polynomial fit,
        etc., planet transit parameters) This function should return a Python
        dict with the following structure (similar to the functions in
        `astrobase.lcfit`) and at least the keys below::

            {'fittype':<str: name of fit method>,
             'fitchisq':<float: the chi-squared value of the fit>,
             'fitredchisq':<float: the reduced chi-squared value of the fit>,
             'fitinfo':{'fitmags':<ndarray: model mags/fluxes from fit func>},
             'magseries':{'times':<ndarray: times where fitmags are evaluated>}}

        Additional keys in the dict returned from this function can include
        `fitdict['fitinfo']['finalparams']` for the final model fit parameters
        (this will be used by the checkplotserver if present),
        `fitdict['fitinfo']['fitepoch']` for the minimum light epoch returned by
        the model fit, among others.

        In any case, the output dict of `lcfitfunc` will be copied to the output
        checkplotdict as
        `checkplotdict[lspmethod][periodind]['lcfit'][<fittype>]` for each
        phased light curve.

    lcfitparams : dict
        A dict containing the LC fit parameters to use when calling the function
        provided in `lcfitfunc`. This contains key-val pairs corresponding to
        parameter names and their respective initial values to be used by the
        fit function.

    externalplots : list of tuples of str
        If provided, this is a list of 4-element tuples containing:

        1. path to PNG of periodogram from an external period-finding method
        2. path to PNG of best period phased LC from the external period-finder
        3. path to PNG of 2nd-best phased LC from the external period-finder
        4. path to PNG of 3rd-best phased LC from the external period-finder

        This can be used to incorporate external period-finding method results
        into the output checkplot pickle or exported PNG to allow for comparison
        with astrobase results. Example of `externalplots`::

            [('/path/to/external/bls-periodogram.png',
              '/path/to/external/bls-phasedlc-plot-bestpeak.png',
              '/path/to/external/bls-phasedlc-plot-peak2.png',
              '/path/to/external/bls-phasedlc-plot-peak3.png'),
             ('/path/to/external/pdm-periodogram.png',
              '/path/to/external/pdm-phasedlc-plot-bestpeak.png',
              '/path/to/external/pdm-phasedlc-plot-peak2.png',
              '/path/to/external/pdm-phasedlc-plot-peak3.png'),
             ...]

        If `externalplots` is provided here, these paths will be stored in the
        output checkplotdict. The `checkplot.pkl_png.checkplot_pickle_to_png`
        function can then automatically retrieve these plot PNGs and put
        them into the exported checkplot PNG.

    findercmap : str or matplotlib.cm.ColorMap object
        The Colormap object to use for the finder chart image.

    finderconvolve : astropy.convolution.Kernel object or None
        If not None, the Kernel object to use for convolving the finder image.

    findercachedir : str
        The path to the astrobase cache directory for finder chart downloads
        from the NASA SkyView service.

    normto : {'globalmedian', 'zero'} or a float
        This specifies the normalization target::

            'globalmedian' -> norms each mag to global median of the LC column
            'zero'         -> norms each mag to zero
            a float        -> norms each mag to this specified float value.

    normmingap : float
        This defines how much the difference between consecutive measurements is
        allowed to be to consider them as parts of different timegroups. By
        default it is set to 4.0 days.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    varepoch : 'min' or float or list of lists or None
        The epoch to use for this phased light curve plot tile. If this is a
        float, will use the provided value directly. If this is 'min', will
        automatically figure out the time-of-minimum of the phased light
        curve. If this is None, will use the mimimum value of `stimes` as the
        epoch of the phased light curve plot. If this is a list of lists, will
        use the provided value of `lspmethodind` to look up the current
        period-finder method and the provided value of `periodind` to look up
        the epoch associated with that method and the current period. This is
        mostly only useful when `twolspmode` is True.

    phasewrap : bool
        If this is True, the phased time-series will be wrapped around
        phase 0.0.

    phasesort : bool
        If True, will sort the phased light curve in order of increasing phase.

    phasebin: float
        The bin size to use to group together measurements closer than this
        amount in phase. This is in units of phase. If this is a float, a
        phase-binned version of the phased light curve will be overplotted on
        top of the regular phased light curve.

    minbinelems : int
        The minimum number of elements required per phase bin to include it in
        the phased LC plot.

    plotxlim : sequence of two floats or None
        The x-range (min, max) of the phased light curve plot. If None, will be
        determined automatically.

    xliminsetmode : bool
        If this is True, the generated phased light curve plot will use the
        values of `plotxlim` as the main plot x-axis limits (i.e. zoomed-in if
        `plotxlim` is a range smaller than the full phase range), and will show
        the full phased light curve plot as an smaller inset. Useful for
        planetary transit light curves.

    plotdpi : int
        The resolution of the output plot PNGs in dots per inch.

    bestperiodhighlight : str or None
        If not None, this is a str with a matplotlib color specification to use
        as the background color to highlight the phased light curve plot of the
        'best' period and epoch combination. If None, no highlight will be
        applied.

    xgridlines : list of floats or None
        If this is provided, must be a list of floats corresponding to the phase
        values where to draw vertical dashed lines as a means of highlighting
        these.

    mindet : int
        The minimum of observations the input object's mag/flux time-series must
        have for this function to plot its light curve and phased light
        curve. If the object has less than this number, no light curves will be
        plotted, but the checkplotdict will still contain all of the other
        information.

    verbose : bool
        If True, will indicate progress and warn about problems.

    outfile : str or None
        The name of the output checkplot pickle file. If this is None, will
        write the checkplot pickle to file called 'checkplot.pkl' in the current
        working directory.

    outgzip : bool
        This controls whether to gzip the output pickle. It turns out that this
        is the slowest bit in the output process, so if you're after speed, best
        not to use this. This is False by default since it turns out that gzip
        actually doesn't save that much space (29 MB vs. 35 MB for the average
        checkplot pickle).

    pickleprotocol : int or None
        This sets the pickle file protocol to use when writing the pickle:

        If None, will choose a protocol using the following rules:

        - 4 -> default in Python >= 3.4 - fast but incompatible with Python 2
        - 3 -> default in Python 3.0-3.3 - mildly fast
        - 2 -> default in Python 2 - very slow, but compatible with Python 2/3

        The default protocol kwarg is None, this will make an automatic choice
        for pickle protocol that's best suited for the version of Python in
        use. Note that this will make pickles generated by Py3 incompatible with
        Py2.

    returndict : bool
        If this is True, will return the checkplotdict instead of returning the
        filename of the output checkplot pickle.

    Returns
    -------

    dict or str
        If returndict is False, will return the path to the generated checkplot
        pickle file. If returndict is True, will return the checkplotdict
        instead.


<EOL>if sys.version_info[:<NUM_LIT:2>] > (<NUM_LIT:3>,<NUM_LIT:2>):<EOL><INDENT>if not outfile and isinstance(currentcp,str):<EOL><INDENT>plotfpath = currentcp<EOL><DEDENT>elif outfile:<EOL><INDENT>plotfpath = outfile<EOL><DEDENT>elif isinstance(currentcp, dict) and currentcp['<STR_LIT>']:<EOL><INDENT>if outgzip:<EOL><INDENT>plotfpath = '<STR_LIT>' % currentcp['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>plotfpath = '<STR_LIT>' % currentcp['<STR_LIT>']<EOL><DEDENT><DEDENT>else:<EOL><INDENT>plotfpath = None<EOL><DEDENT>if (isinstance(currentcp, str) and os.path.exists(currentcp)):<EOL><INDENT>cp_current = _read_checkplot_picklefile(currentcp)<EOL><DEDENT>elif isinstance(currentcp, dict):<EOL><INDENT>cp_current = currentcp<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(currentcp), type(currentcp)))<EOL>return None<EOL><DEDENT>if (isinstance(updatedcp, str) and os.path.exists(updatedcp)):<EOL><INDENT>cp_updated = _read_checkplot_picklefile(updatedcp)<EOL><DEDENT>elif isinstance(updatedcp, dict):<EOL><INDENT>cp_updated = updatedcp<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(updatedcp), type(updatedcp)))<EOL>return None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if (not outfile and<EOL>(isinstance(currentcp, str) or isinstance(currentcp, unicode))):<EOL><INDENT>plotfpath = currentcp<EOL><DEDENT>elif outfile:<EOL><INDENT>plotfpath = outfile<EOL><DEDENT>elif isinstance(currentcp, dict) and currentcp['<STR_LIT>']:<EOL><INDENT>if outgzip:<EOL><INDENT>plotfpath = '<STR_LIT>' % currentcp['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>plotfpath = '<STR_LIT>' % currentcp['<STR_LIT>']<EOL><DEDENT><DEDENT>else:<EOL><INDENT>plotfpath = None<EOL><DEDENT>if ((isinstance(currentcp, str) or isinstance(currentcp, unicode)) and<EOL>os.path.exists(currentcp)):<EOL><INDENT>cp_current = _read_checkplot_picklefile(currentcp)<EOL><DEDENT>elif isinstance(currentcp,dict):<EOL><INDENT>cp_current = currentcp<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(currentcp), type(currentcp)))<EOL>return None<EOL><DEDENT>if ((isinstance(updatedcp, str) or isinstance(updatedcp, unicode)) and<EOL>os.path.exists(updatedcp)):<EOL><INDENT>cp_updated = _read_checkplot_picklefile(updatedcp)<EOL><DEDENT>elif isinstance(updatedcp, dict):<EOL><INDENT>cp_updated = updatedcp<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(os.path.abspath(updatedcp), type(updatedcp)))<EOL>return None<EOL><DEDENT><DEDENT>cp_current.update(cp_updated)<EOL>if not plotfpath and outgzip:<EOL><INDENT>plotfpath = '<STR_LIT>' % cp_current['<STR_LIT>']<EOL><DEDENT>elif (not plotfpath) and (not outgzip):<EOL><INDENT>plotfpath = '<STR_LIT>' % cp_current['<STR_LIT>']<EOL><DEDENT>if plotfpath.endswith('<STR_LIT>'):<EOL><INDENT>outgzip = True<EOL><DEDENT>return _write_checkplot_picklefile(cp_current,<EOL>outfile=plotfpath,<EOL>outgzip=outgzip,<EOL>protocol=pickleprotocol)<EOL>

This updates the current checkplotdict with updated values provided.

    Parameters
    ----------

    currentcp : dict or str
        This is either a checkplotdict produced by `checkplot_pickle` above or a
        checkplot pickle file produced by the same function. This checkplot will
        be updated from the `updatedcp` checkplot.

    updatedcp : dict or str
        This is either a checkplotdict produced by `checkplot_pickle` above or a
        checkplot pickle file produced by the same function. This checkplot will
        be the source of the update to the  `currentcp` checkplot.

    outfile : str or None
        The name of the output checkplot pickle file. The function will output
        the new checkplot gzipped pickle file to `outfile` if outfile is a
        filename. If `currentcp` is a file and `outfile`, this will be set to
        that filename, so the function updates it in place.

    outgzip : bool
        This controls whether to gzip the output pickle. It turns out that this
        is the slowest bit in the output process, so if you're after speed, best
        not to use this. This is False by default since it turns out that gzip
        actually doesn't save that much space (29 MB vs. 35 MB for the average
        checkplot pickle).

    pickleprotocol : int or None
        This sets the pickle file protocol to use when writing the pickle:

        If None, will choose a protocol using the following rules:

        - 4 -> default in Python >= 3.4 - fast but incompatible with Python 2
        - 3 -> default in Python 3.0-3.3 - mildly fast
        - 2 -> default in Python 2 - very slow, but compatible with Python 2/3

        The default protocol kwarg is None, this will make an automatic choice
        for pickle protocol that's best suited for the version of Python in
        use. Note that this will make pickles generated by Py3 incompatible with
        Py2.

    verbose : bool
        If True, will indicate progress and warn about problems.

    Returns
    -------

    str
        The path to the updated checkplot pickle file. If `outfile` was None and
        `currentcp` was a filename, this will return `currentcp` to indicate
        that the checkplot pickle file was updated in place.


return np.degrees(<NUM_LIT>*np.arcsin(xyzdist/<NUM_LIT>))*<NUM_LIT><EOL>

This inverts the xyz unit vector distance -> angular distance relation.

    Parameters
    ----------

    xyzdist : float or array-like
        This is the distance in xyz vector space generated from a transform of
        (RA,Dec) - > (x,y,z)

    Returns
    -------

    dist_arcseconds : float or array-like
        The distance in arcseconds.