Exemplo n.º 1
0
        if sicn==0:
            print 'No SST or SIC dataset for NSIDC!'
            exit()

        plotflds=nsidcsicd
        dset = 'NSIDCbootstrap'
        title = ' (' + timeperp2 + ')-(' + timeper + ')'
        savstr=timeperp2 + 'min' + timeper


    cmlen = float(15)

    if diffobs: # difference CanESM and HadISST

        plotfld = cansicd - hadsicd
        cplt.map_allmonths(plotfld,lat,lon,cmin=cmind,cmax=cmaxd,title='CanESM-HadISST ' + field,type='nh',cmap=cmap)
        if printtofile==1:
            plt.savefig('CanESM-HadISST_' + field + 'diffs_abt' + savstr + '_allmos_nh.pdf')

        cplt.map_allmonths(plotfld,lat,lon,cmin=cmind,cmax=cmaxd,title='CanESM-HadISST ' + field,cmap=cmap)
        if printtofile==1:
            plt.savefig('CanESM-HadISST_' + field + 'diffs_abt' + savstr + '_allmos_sq.pdf')


    if plotseacycmag: # only for CanESM2 SST
        maxfld = np.max(plotflds,axis=0)
        maxidx = np.argmax(plotflds,axis=0)
        minfld = np.min(plotflds,axis=0)
        minfld2 = np.min(ma.masked_where(gctsoneyr==1,plotflds),axis=0)
        minidx = np.argmin(plotflds,axis=0)
    ##     midx=midx+1

    ## fig1 = cplt.map_allmonths(fldtest,lat,lon,title='CDO selmon',cmin=clims[0],cmax=clims[1],type='nh',climo=1)

    if field == "sic" or field == "sit":
        plotfldp = ma.masked_where(fldp <= 0, fldp)
        plotfldc = ma.masked_where(fldc <= 0, fldc)
    else:
        plotfldc = fldc
        plotfldp = fldp
    pparams = dict(type="nh", cmin=clims[0], cmax=clims[1], cmap=cmapclimo)

    if field == "ts":
        pparams["conts"] = 271.2

    figp = cplt.map_allmonths(plotfldp, bclat, bclon, title="pert " + field, **pparams)
    figc = cplt.map_allmonths(plotfldc, bclat, bclon, title="ctrl " + field, **pparams)
    figd = cplt.map_allmonths(
        fldp - fldc, bclat, bclon, title="diff", type="nh", cmin=climsdiff[0], cmax=climsdiff[1], cmap=cmap
    )
    if field == "ts":
        figd2 = cplt.map_allmonths(
            fldp - fldsave,
            bclat,
            bclon,
            title="pert - originalpert",
            type="nh",
            cmin=climsdiff[0],
            cmax=climsdiff[1],
            cmap=cmap,
        )
Exemplo n.º 3
0
    landmask = np.tile(landmask,(12,1,1))

    #pert1n[pert1n<271.2] = -1000 # @@ just for testing
    pert1n = ma.masked_where(landmask==-1,pert1n)
    pert1n = ma.masked_where(pert1sic>.15,pert1n)

    #pert1[pert1<271.2] = -1000 # @@ just for testing
    pert1 = ma.masked_where(landmask==-1,pert1)
    pert1 = ma.masked_where(pert1sic>.15,pert1)


    #cplt.map_allmonths(pert1n,lat,lon,cmin=271.2-35,cmax=271.2+35,cmap='blue2red_20',type='nh',conts=[271.2],climo=1,lmask=1)

    #cplt.map_allmonths(pert1,lat,lon,cmin=271.2-35,cmax=271.2+35,cmap='blue2red_20',type='nh',conts=[271.2],climo=1,lmask=1)

    cplt.map_allmonths(pert1n-pert1,lat,lon,cmin=-.1,cmax=.1,cmap='blue2red_20',type='nh',climo=1)
    #cplt.map_allmonths(landmask,lat,lon,cmap='blue2red_20',type='nh',climo=1)

if checknewbcs:


    deni = 913 # density of ice

    if timeperp=='2022-2032':
        cming = -5; cmaxg = 5 # GT
        cminc = -.4; cmaxc = .4 # SI concentration
        cmint = -.7*deni; cmaxt = .7*deni # SI thickness
    else:
        cming = -6; cmaxg = 6
        cminc = -.6; cmaxc = .6 # SI concentration
        cmint = -.8*deni; cmaxt = .8*deni # SI thickness
Exemplo n.º 4
0
sstfnamep = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_gt_' + timeper + 'climo.nc'
sstfnamec = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_gt_' + timeperc + 'climo.nc'
sitfnamep = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_sic_' + timeper + 'climo.nc'
sitfnamec = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_sic_' + timeperc + 'climo.nc'

hsicfnamep = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_sicn_' + timeper + 'climo.nc'
hsicfnamec = basepath2 + dset + '/hadisst1.1_bc_128_64_1870_2013m03_sicn_' + timeperc + 'climo.nc'

hsicp = cnc.getNCvar(hsicfnamep,'SICN')
hsicc = cnc.getNCvar(hsicfnamec,'SICN')

cmap='red2blue_w20'
if testsicplots:
    # compare sic
    #   looks like NSIDC has more ice in the control time period and ~less in the pert. so, greater trend
    cplt.map_allmonths(nsicp-hsicp,lat,lon,cmin=-.1,cmax=.1,cmap=cmap,type='nh',lmask=1,title='pert sic nsidc-hadisst',latlim=45)
    cplt.map_allmonths(nsicc-hsicc,lat,lon,cmin=-.1,cmax=.1,cmap=cmap,type='nh',lmask=1,title='ctl sic nsidc-hadisst',latlim=45)

    cplt.map_allmonths((nsicp-nsicc),lat,lon,cmin=-.1,cmax=.1,cmap=cmap,type='nh',lmask=1,title='pert-ctl sic nsidc',latlim=45)
    cplt.map_allmonths((hsicp-hsicc),lat,lon,cmin=-.1,cmax=.1,cmap=cmap,type='nh',lmask=1,title='pert-ctl sic hadisst',latlim=45)

    cplt.map_allmonths((nsicp-nsicc) - (hsicp-hsicc),lat,lon,cmin=-.1,cmax=.1,cmap=cmap,type='nh',lmask=1,title='pert-ctl sic nsidc-hadisst',latlim=45)


if dossts:
    # ########### do SST  ####################################
    hsstp = cnc.getNCvar(sstfnamep,'GT')
    hsstc = cnc.getNCvar(sstfnamec,'GT')
    lat = cnc.getNCvar(sstfnamec,'lat')
    lon = cnc.getNCvar(sstfnamec,'lon')
    timefld = cnc.getNCvar(sstfnamec,'time')
Exemplo n.º 5
0
    flddt[skey] = cnc.getNCvar(fname, ncfield, timesel=timeseldt[skey]) * conv

# <headingcell level=3>

# SICN: Below are sea ice concentration comparisons for various combinations
# (figure titles are below figures)

# <codecell>

if showmaps:
    fldc = flddt["iga"]

    # control (iga) climo
    fig1 = cplt.map_allmonths(
        fldc, lat, lon, type="nh", cmap="blue2blue_bw10", cmin=cminc, cmax=cmaxc, lmask=1, title="preI"
    )
    if printtofile:
        fig1.savefig(field + "_iga_allmos_nh.pdf")

    for skey in sims[2:10]:  # just the Group I sims, climo and diff
        fig2 = cplt.map_allmonths(
            flddt[skey],
            lat,
            lon,
            type="nh",
            cmap="blue2blue_bw10",
            cmin=cminc,
            cmax=cmaxc,
            lmask=1,
            title="2xco2 nudge (" + skey + ")",