def preview(image, **kwargs):
try:<EOL><INDENT>from IPython.display import Javascript, HTML, display<EOL>from gbdxtools.rda.interface import RDA<EOL>from gbdxtools import Interface<EOL>gbdx = Interface()<EOL><DEDENT>except:<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT>zoom = kwargs.get("<STR_LIT>", <NUM_LIT:16>)<EOL>bands = kwargs.get("<STR_LIT>")<EOL>if bands is None:<EOL><INDENT>bands = image._rgb_bands<EOL><DEDENT>wgs84_bounds = kwargs.get("<STR_LIT>", list(loads(image.metadata["<STR_LIT:image>"]["<STR_LIT>"]).bounds))<EOL>center = kwargs.get("<STR_LIT>", list(shape(image).centroid.bounds[<NUM_LIT:0>:<NUM_LIT:2>]))<EOL>if image.proj != '<STR_LIT>':<EOL><INDENT>code = image.proj.split('<STR_LIT::>')[<NUM_LIT:1>]<EOL>conn = gbdx.gbdx_connection<EOL>proj_info = conn.get('<STR_LIT>'.format(code)).json()<EOL>tfm = partial(pyproj.transform, pyproj.Proj(init='<STR_LIT>'), pyproj.Proj(init=image.proj))<EOL>bounds = list(ops.transform(tfm, box(*wgs84_bounds)).bounds)<EOL><DEDENT>else:<EOL><INDENT>proj_info = {}<EOL>bounds = wgs84_bounds<EOL><DEDENT>if not image.options.get('<STR_LIT>'):<EOL><INDENT>rda = RDA()<EOL>dra = rda.HistogramDRA(image)<EOL>image = dra.aoi(bbox=image.bounds)<EOL><DEDENT>graph_id = image.rda_id<EOL>node_id = image.rda.graph()['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT:id>']<EOL>map_id = "<STR_LIT>".format(str(int(time.time())))<EOL>scales = '<STR_LIT:U+002C>'.join(['<STR_LIT:1>'] * len(bands))<EOL>offsets = '<STR_LIT:U+002C>'.join(['<STR_LIT:0>'] * len(bands))<EOL>display(HTML(Template('''<STR_LIT>''').substitute({"<STR_LIT>": map_id})))<EOL>js = Template("""<STR_LIT>""").substitute({<EOL>"<STR_LIT>": map_id,<EOL>"<STR_LIT>": image.proj,<EOL>"<STR_LIT>": json.dumps(proj_info),<EOL>"<STR_LIT>": graph_id,<EOL>"<STR_LIT>": bounds,<EOL>"<STR_LIT>": "<STR_LIT:U+002C>".join(map(str, bands)),<EOL>"<STR_LIT>": node_id,<EOL>"<STR_LIT>": json.dumps(image.metadata["<STR_LIT:image>"]),<EOL>"<STR_LIT>": json.dumps(image.metadata["<STR_LIT>"]),<EOL>"<STR_LIT>": center,<EOL>"<STR_LIT>": zoom,<EOL>"<STR_LIT>": gbdx.gbdx_connection.access_token,<EOL>"<STR_LIT>": scales,<EOL>"<STR_LIT>": offsets,<EOL>"<STR_LIT:url>": VIRTUAL_RDA_URL<EOL>})<EOL>display(Javascript(js))<EOL>
Show a slippy map preview of the image. Requires iPython.

    Args:
        image (image): image object to display
        zoom (int): zoom level to intialize the map, default is 16
        center (list): center coordinates to initialize the map, defaults to center of image
        bands (list): bands of image to display, defaults to the image's default RGB bands