Ejemplo n.º 1
0
def month_tropic_width(f):

    dset = da.read_nc(["cal333+cal05+cal20+cal80+csat", "cal333+cal05+cal20+cal80+csat_cprof"])
    vcm = dset["cal333+cal05+cal20+cal80+csat"]
    nprof = dset["nprof"]

    cf_lat = np.ma.masked_invalid(1.0 * vcm.values.T / nprof.values)
    cf_lat = cf_lat.T

    tropic_range = dict()
    for vcm_min in vcm_mins:
        tropic_range[vcm_min] = tropic_width.tropic_width3(vcm.lat, vcm.altitude, cf_lat, vcm_min)

    return tropic_range
Ejemplo n.º 2
0
def pcolor_zonal(x, y, vcmarray, title=None):

    plt.contourf(x, y, vcmarray.T, np.r_[0:0.8:0.05])
    plt.colorbar()
    if title is not None:
        plt.title(title)
    plt.clim(0,0.8)
    plt.xlim(-82,82)
    plt.xticks(np.r_[-90:90+30:30])
    latup, latdown, ceiling, height = tropic_width.tropic_width3(x, y, vcmarray)
    plt.axvline(x=latup, ls='--', color='w')
    plt.axvline(x=latdown, ls='--', color='w')
    plt.axhline(y=ceiling, ls='--')
    plt.axhline(y=height, ls='--')
Ejemplo n.º 3
0
def pcolor_zonal(x, y, vcmarray, title=None):

    plt.contourf(x, y, vcmarray.T, np.r_[0:0.8:0.05])
    plt.colorbar()
    if title is not None:
        plt.title(title)
    plt.clim(0, 0.8)
    plt.xlim(-82, 82)
    plt.xticks(np.r_[-90:90 + 30:30])
    latup, latdown, ceiling, height = tropic_width.tropic_width3(
        x, y, vcmarray)
    plt.axvline(x=latup, ls='--', color='w')
    plt.axvline(x=latdown, ls='--', color='w')
    plt.axhline(y=ceiling, ls='--')
    plt.axhline(y=height, ls='--')
Ejemplo n.º 4
0
def month_tropic_width(f):

    dset = da.read_nc([
        'cal333+cal05+cal20+cal80+csat', 'cal333+cal05+cal20+cal80+csat_cprof'
    ])
    vcm = dset['cal333+cal05+cal20+cal80+csat']
    nprof = dset['nprof']

    cf_lat = np.ma.masked_invalid(1. * vcm.values.T / nprof.values)
    cf_lat = cf_lat.T

    tropic_range = dict()
    for vcm_min in vcm_mins:
        tropic_range[vcm_min] = tropic_width.tropic_width3(
            vcm.lat, vcm.altitude, cf_lat, vcm_min)

    return tropic_range
Ejemplo n.º 5
0
def month_tropic_width(monthfile):

    try:
        data = da.read_nc(monthfile)
    except:
        return None
    try:
        vcm = 1. * data['cal333+cal05+cal20+cal80+csat']
        nprof = 1. * data['cal333+cal05+cal20+cal80+csat_cprof']
    except KeyError:
        return None
        
    cf_lat = vcm.values.T / nprof.values
    cf_lat = cf_lat.T
    cf_lat = np.ma.masked_invalid(cf_lat)

    tropic_range = dict()
    for vcm_min in vcm_mins:
        tropic_range[vcm_min] = tropic_width3(vcm.labels[0], vcm.labels[1], cf_lat, vcm_min=vcm_min)
    
    return tropic_range
Ejemplo n.º 6
0
def pcolor_zonal(x, y, vcmarray, title=None):

    z = vcmarray.copy()
    z = np.ma.masked_where(z==0, z)
    plt.contourf(x, y, z.T, np.r_[0:0.8:0.05])
    plt.colorbar()
    if title is not None:
        plt.title(title[10:-4])
    plt.clim(0,0.8)
    plt.xticks(np.r_[-90:90+30:30])
    ctop = tropic_width.cloud_cover_top(y, vcmarray, 0.05)
    latup, latdown, ceiling, height = tropic_width.tropic_width3(x, y, vcmarray)
    plt.axvline(x=latup, ls='--', color='grey')
    plt.axvline(x=latdown, ls='--', color='grey')
    plt.axhline(y=ceiling, ls='--', color='grey')
    plt.axhline(y=height, ls='--', color='grey')
    plt.plot(x, ctop, ls='--', color='w', alpha=0.5)
    plt.xlim(-82,82)
    plt.ylim(0, 20) 
    plt.ylabel('Altitude [km]')   
    plt.xlabel('Latitude')
Ejemplo n.º 7
0
def pcolor_zonal(x, y, vcmarray, title=None):

    z = vcmarray.copy()
    z = np.ma.masked_where(z == 0, z)
    plt.contourf(x, y, z.T, np.r_[0:0.8:0.05])
    plt.colorbar()
    if title is not None:
        plt.title(title[10:-4])
    plt.clim(0, 0.8)
    plt.xticks(np.r_[-90:90 + 30:30])
    ctop = tropic_width.cloud_cover_top(y, vcmarray, 0.05)
    latup, latdown, ceiling, height = tropic_width.tropic_width3(
        x, y, vcmarray)
    plt.axvline(x=latup, ls='--', color='grey')
    plt.axvline(x=latdown, ls='--', color='grey')
    plt.axhline(y=ceiling, ls='--', color='grey')
    plt.axhline(y=height, ls='--', color='grey')
    plt.plot(x, ctop, ls='--', color='w', alpha=0.5)
    plt.xlim(-82, 82)
    plt.ylim(0, 20)
    plt.ylabel('Altitude [km]')
    plt.xlabel('Latitude')
Ejemplo n.º 8
0
def pcolor_zonal(x, y, vcmarray, title=None):

    plt.figure(figsize=[15,5])
    plt.contourf(x, y, vcmarray.T, np.r_[0:0.8:0.05])
    plt.colorbar()
    if title is not None:
        plt.title(title)
    plt.clim(0,0.8)
    plt.xlim(-82,82)
    plt.xticks(np.r_[-90:90+30:30])
    
    cover_top = tropic_width.cloud_cover_top(y, vcmarray)
    plt.plot(x, cover_top, lw=2, color='w', alpha=0.5)
    
    latup, latdown, ceiling, height = tropic_width.tropic_width3(x, y, vcmarray)
    plt.figure(figsize=[15,5])
    plt.plot(x, cover_top)
    plt.axvline(x=latup)
    plt.axvline(x=latdown)
    plt.axhline(y=ceiling)
    plt.axhline(y=height)
        
    print 'lat range, second method : ', latup, latdown
Ejemplo n.º 9
0
def month_tropic_width(monthfile):

    try:
        data = da.read_nc(monthfile)
    except:
        return None
    try:
        vcm = 1. * data['cal333+cal05+cal20+cal80+csat']
        nprof = 1. * data['cal333+cal05+cal20+cal80+csat_cprof']
    except KeyError:
        return None

    cf_lat = vcm.values.T / nprof.values
    cf_lat = cf_lat.T
    cf_lat = np.ma.masked_invalid(cf_lat)

    tropic_range = dict()
    for vcm_min in vcm_mins:
        tropic_range[vcm_min] = tropic_width3(vcm.labels[0],
                                              vcm.labels[1],
                                              cf_lat,
                                              vcm_min=vcm_min)

    return tropic_range