cptfile = 'BlueWhiteOrangeRed.cpt'
    #cptfile = 'BlueYellowRed.cpt'
    
    if clim == 2.:
        ncolours = 17
        nticks = 9
    elif clim == 3.:
        ncolours = 17
        nticks = 9
    
    # get colour lims in log10
    vmin = log10(1./clim)
    vmax = log10(clim)
        
    try:
        cmap, zvals = cpt2colormap(cptfile, ncolours, rev=False)
    except:
        try:
            nascptfile = '/nas/active/ops/community_safety/ehp/georisk_earthquake/modelling/sandpits/tallen/NSHA2018/postprocessing/maps/'+ cptfile
            capfile = '/nas/active/ops/community_safety/ehp/georisk_earthquake/modelling/sandpits/tallen/NSHA2018/shared/capitals_names.csv'
            cmap, zvals = cpt2colormap(nascptfile, ncolours, rev=False)
            #cmap, zvals = cpt2colormap(nascptfile, ncolours, rev=True)
            cmap = remove_last_cmap_colour(cmap)
        except:
            ncicptfile = '/short/w84/NSHA18/sandpit/tia547/NSHA2018/postprocessing/maps/'+ cptfile
            cmap, zvals = cpt2colormap(ncicptfile, ncolours, rev=False)
            cmap = remove_last_cmap_colour(cmap)

    
    print('Making map...')
    cmap.set_bad('w', 1.0)
Exemple #2
0
                    labels=[0, 0, 0, 0],
                    fontsize=10,
                    dashes=[2, 2],
                    color='0.5',
                    linewidth=0.5)
    m.drawmeridians(arange(0., 360., 6),
                    labels=[0, 0, 0, 0],
                    fontsize=10,
                    dashes=[2, 2],
                    color='0.5',
                    linewidth=0.5)

    # get colormap from cpt file
    cptfile = '/Users/trev/Documents/Geoscience_Australia/NSHA2018/postprocessing/maps/cw1-013_mod.cpt'
    ncolours = 12
    cmap, zvals = cpt2colormap(cptfile, ncolours, rev=True)

    print('Making map...')
    cmap.set_under('w', 1.0)

    bounds = array([
        1E-3, 0.005, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.12,
        0.16, 0.24
    ])
    norm = colors.BoundaryNorm(boundaries=bounds, ncolors=ncolours)

    ##############################################################################
    # read netcdf
    ##############################################################################

    print('Reading netCDF file...')