示例#1
0
os.chdir(HOME+path)
for file in glob.glob("*.nc"):
    print(file)
    
    RADAR = pyart.io.read(HOME + path + file)
    
    zdr = RADAR.fields['ZDR']['data']
    dbz= RADAR.fields['mask_ref']['data']
    rho = RADAR.fields['RhoHV']['data']
    uphi = RADAR.fields['mask_uphi']['data']
    raw_dbz = RADAR.fields['dBZ']['data']
    
    nb=RADAR.ngates
    nr=RADAR.nrays
    
    end_gate, start_ray, end_ray = ran.det_process_range(RADAR,0,2000) 
    
    raw_dbz[:,end_gate+1:nb]=np.nan
    rho[:,end_gate+1:nb]=np.nan
    
    raw_dbz=np.ma.filled(raw_dbz,fill_value=np.nan)
    rho=np.ma.filled(rho,fill_value=np.nan)
    
    raw_dbz=np.ma.masked_invalid(raw_dbz)
    rho=np.ma.masked_invalid(rho)
    
    anio = file[0:4]
    mes = file[4:6]
    dia = file[6:8]
    hora = file[8:12]
    fecha=anio+mes+dia+hora
示例#2
0
        x = int(ray_ab[i])
        y = int(ray_ar[i])
        uphi_ab_haz = uphi_ab_filter[x, :]
        mask_ar_haz = mask_ar[y, :]
        for j in range(0, nb):
            uphi_filter[x, j] = mask_ar_haz[j] * uphi_ab_haz[j]
            if uphi_filter[x, j] == 0:
                uphi_filter[x, j] = np.nan

    #Corrijo los valores que dieron 0 porque se repite el azimuth en los datos
    for i in range(0, nr):
        for j in range(0, nb):
            if uphi_filter[i, j] == 0:
                uphi_filter[i, :] = uphi_ab_filter[i, :]

    end_gate, start_ray, end_ray = ran.det_process_range(ref, 0, 2000)

    dbz_filter[:, end_gate + 1:nb] = np.nan
    uphi_filter[:, end_gate + 1:nb] = np.nan

    ########### MASCARA A LOS NAN #######

    aa_ref = np.ma.filled(dbz_filter, fill_value=np.nan)
    bb_ref = np.ma.masked_invalid(aa_ref)

    aa_uphi = np.ma.filled(uphi_filter, fill_value=np.nan)
    bb_uphi = np.ma.masked_invalid(aa_uphi)

    ###### ACA AGREGO LO DEL DESVIO DEL PHIDP ######

    phidp_haz = np.zeros(nb)