def cp2png(checkplotpickle):
    """
    This runs cp2png from checkplot.py.

    """
    from astrobase.checkplot import checkplot_pickle_to_png
    if checkplotpickle.endswith('.gz'):
        outfile = checkplotpickle.replace('.pkl.gz', '.png')
    else:
        outfile = checkplotpickle.replace('.pkl', '.png')
    return checkplot_pickle_to_png(checkplotpickle, outfile)
