esmvaltool/diag_scripts/ocean/diagnostic_transects.py
def make_transects_plots(
        cfg,
        metadata,
        filename,
):
    """
    Make a simple plot of the transect for an indivudual model.

    The cfg is the opened global config,
    metadata is the metadata dictionairy
    filename is the preprocessing model file.
    """
    # Load cube and set up units
    cube = iris.load_cube(filename)
    cube = diagtools.bgc_units(cube, metadata['short_name'])

    # Is this data is a multi-model dataset?
    multi_model = metadata['dataset'].find('MultiModel') > -1

    # Make a dict of cubes for each layer.

    qplt.contourf(cube, 25, linewidth=0, rasterized=True)
    plt.axes().set_yscale('log')

    # Add title to plot
    title = ' '.join(
        [metadata['dataset'], metadata['long_name'],
         determine_transect_str(cube)])
    plt.title(title)

    # Load image format extention
    image_extention = diagtools.get_image_format(cfg)

    # Determine image filename:
    if multi_model:
        path = diagtools.folder(
            cfg['plot_dir']) + os.path.basename(filename).replace(
                '.nc', '_transect' + image_extention)
    else:
        path = diagtools.get_image_path(
            cfg,
            metadata,
            suffix='transect' + image_extention,
        )

    # Saving files:
    if cfg['write_plots']:
        logger.info('Saving plots to %s', path)
        plt.savefig(path)

    plt.close()

    Make a simple plot of the transect for an indivudual model.

    The cfg is the opened global config,
    metadata is the metadata dictionairy
    filename is the preprocessing model file.
    
Make a simple plot of the transect for an indivudual model.
The cfg is the opened global config,
metadata is the metadata dictionairy
filename is the preprocessing model file.
Make a simple plot of the transect for an indivudual model . The cfg is the opened global config metadata is the metadata dictionairy filename is the preprocessing model file .
def make_transects_plots(
        cfg,
        metadata,
        filename,
):
    cube = iris.load_cube(filename)
    cube = diagtools.bgc_units(cube, metadata['short_name'])
    multi_model = metadata['dataset'].find('MultiModel') > -1
    qplt.contourf(cube, 25, linewidth=0, rasterized=True)
    plt.axes().set_yscale('log')
    title = ' '.join(
        [metadata['dataset'], metadata['long_name'],
         determine_transect_str(cube)])
    plt.title(title)
    image_extention = diagtools.get_image_format(cfg)
    if multi_model:
        path = diagtools.folder(
            cfg['plot_dir']) + os.path.basename(filename).replace(
                '.nc', '_transect' + image_extention)
    else:
        path = diagtools.get_image_path(
            cfg,
            metadata,
            suffix='transect' + image_extention,
        )
    if cfg['write_plots']:
        logger.info('Saving plots to %s', path)
        plt.savefig(path)
    plt.close()
def make_transects_plots ( cfg , metadata , filename , ) : cube = iris . load_cube ( filename ) cube = diagtools . bgc_units ( cube , metadata [ 'short_name' ] ) multi_model = metadata [ 'dataset' ] . find ( 'MultiModel' ) > - 1 qplt . contourf ( cube , 25 , linewidth = 0 , rasterized = True ) plt . axes ( ) . set_yscale ( 'log' ) title = ' ' . join ( [ metadata [ 'dataset' ] , metadata [ 'long_name' ] , determine_transect_str ( cube ) ] ) plt . title ( title ) image_extention = diagtools . get_image_format ( cfg ) if multi_model : path = diagtools . folder ( cfg [ 'plot_dir' ] ) + os . path . basename ( filename ) . replace ( '.nc' , '_transect' + image_extention ) else : path = diagtools . get_image_path ( cfg , metadata , suffix = 'transect' + image_extention , ) if cfg [ 'write_plots' ] : logger . info ( 'Saving plots to %s' , path ) plt . savefig ( path ) plt . close ( )
Make a simple plot of the transect for an indivudual model.
Make a simple plot of the transect for an indivudual model .
"""
    Make a simple plot of the transect for an indivudual model.

    The cfg is the opened global config,
    metadata is the metadata dictionairy
    filename is the preprocessing model file.
    """ # Load cube and set up units # Is this data is a multi-model dataset? # Make a dict of cubes for each layer. # Add title to plot # Load image format extention # Determine image filename: # Saving files:
cfg
metadata
filename