if threed==0: fldc = cnc.getNCvar(fnamec,field.upper(),timesel=timesel, **ncparams)*conv fldp = cnc.getNCvar(fnamep,field.upper(),timesel=timesel, **ncparams)*conv else: ncparams['levsel'] = level fldc = np.append(cnc.getNCvar(fnamec,ncfield,timesel='0002-01-01,061-12-31',**ncparams)*conv, cnc.getNCvar(fnamec2,ncfield,**ncparams)*conv, axis=0) fldp = np.append(cnc.getNCvar(fnamep,ncfield,timesel='0002-01-01,061-12-31',**ncparams)*conv, cnc.getNCvar(fnamep2,ncfield,**ncparams)*conv, axis=0) if sia==1: fldc = cutl.calc_seaicearea(fldc,lat,lon) fldp = cutl.calc_seaicearea(fldp,lat,lon) # Prepare the data here: @@ # @@ from hists script: areas = cutl.calc_cellareas(lat,lon,repeat=fldc.shape) areas = areas[:,lat>latlim,:] fldcorig=copy.copy(fldc) fldporig=copy.copy(fldp) fldc = fldc[:,lat>latlim,:] fldp = fldp[:,lat>latlim,:] if maskland: lmask = con.get_t63landmask(repeat=fldc.shape) areas = ma.masked_where(lmask[:,lat>latlim,:]==-1,areas) fldc = ma.masked_where(lmask[:,lat>latlim,:]==-1,fldc)
fld = cnc.getNCvar(fname,field,timesel=timesel,seas=sea) # select a given time period and keep maps fldsel = cnc.getNCvar(fname,field,timesel=timesel2,seas=sea) nt = fldsel.shape[0] nlon=fldsel.shape[2] nlat=fldsel.shape[1] fldre = fldsel.reshape((nt,nlon*nlat)) xx=np.arange(0,nt) #ensseldt[eii] = fldsel if field=='sic': ensnhdt[eii],ensshdt[eii] = cutl.calc_totseaicearea(fld/100.,lat,lon,isarea=False) fldsel=cutl.calc_seaicearea(fldsel,lat,lon) fldre=fldsel.reshape((nt,nlon*nlat)) else: ensgmdt[eii] = cutl.global_mean_areawgted3d(fld,lat,lon) ensrmdt[eii] = cutl.calc_regmean(fld,lat,lon,region) #slope[eii], intercept, r_value, p_value, std_err = sp.stats.linregress(xx,dat) # not good for 3d data? # this is just the second timesel (ie 2002-2012) slope,intercept = np.polyfit(xx,fldre,1) # supposedly can do w/ higher dims? enstrnddt[eii] = slope #.reshape((nlat,nlon)) # reshape later @@ # also save all trends into one dictionary (don't differentiate by seed/base run) alltrnddt[superii] = slope