高空探测数据处理--中心级质控(二)

接上

4.2温度质控

温度质控包括:温度极值检查、双权重离群值检查、超绝热递减率检查、温度露点差检查等。

vector<qcFlag> temperatureQC(vector<float> td,vector<float> tem,vector<float> pre,vector<float> lat,int length,int outside,int inside,Point sta,string season){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m1,m2,m3,m4;

    qcm.N = length;
    code = qcm.tem_Double_weighted_outlier_check(tem);
    for (int i=0;i<length-1;i++){
        m1 = qcm.Tem_extreme_check(tem[i],sta.lat,pre[i]);
        m2 = code[i];
        m3 = qcm.Super_adiabatic_decreasing_rate(tem[i],tem[i+1],lat[i],pre[i],pre[i+1],season);
        m4 = qcm.Temperature_Dewpoint_difference(tem[i],td[i]);
        if (m1+m2+m3+m4 > 1)
            temp.code = "2";
        else if (m1+m2 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m1<<" ";
        if (m1==0){
            temp.label = "";
            }
        
        if (m1==1){
            if (i<outside)
                temp.label = "A3_T_1,";
            if (i>=outside && i< inside)
                temp.label = "B3_T_1,";
            if (i>inside)
                temp.label = "C3_T_1,";
            }
        if(m1==2){
            if (i<outside)
                temp.label = "A3_T_2,";
            if (i>=outside && i< inside)
                temp.label = "B3_T_2,";
            if (i>inside)
                temp.label = "C3_T_2,";
            
            }
        switch (m2)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A18_T_1,";
            if (i>=outside && i< inside)
                temp.label += "B18_T_1,";
            if (i>inside)
                temp.label += "C18_T_1,";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A18_T_2,";
            if (i>=outside && i< inside)
                temp.label += "B18_T_2,";
            if (i>inside)
                temp.label += "C18_T_2,";
            break;
            }
        }
        switch (m3)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A11_T_1,";
            if (i>=outside && i< inside)
                temp.label += "B11_T_1,";
            if (i>inside)
                temp.label += "C11_T_1,";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A11_T_2,";
            if (i>=outside && i< inside)
                temp.label += "B11_T_2,";
            if (i>inside)
                temp.label += "C11_T_2,";
            break;
            }
        }
        switch (m4)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A9_T_1,";
            if (i>=outside && i< inside)
                temp.label += "B9_T_1,";
            if (i>inside)
                temp.label += "C9_T_1,";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A9_T_2,";
            if (i>=outside && i< inside)
                temp.label += "B9_T_2,";
            if (i>inside)
                temp.label += "C9_T_2,";
            break;
            }
        }
        result.push_back(temp);  
    }
    temp.label = "";
    temp.code = "0";
    result.push_back(temp);
    return result;
}

4.3湿度质控

湿度质控包括双权重离群值检查、极值检查等。

vector<qcFlag> rhumQC(vector<float> rhum,vector<float> pre,int length,int outside,int inside){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m1,m2;
    qcm.N = length;
    code = qcm.rhum_Double_weighted_outlier_check(rhum);
    for (int i=0;i<length;i++){
        m1 = qcm.Rhum_extreme_check(rhum[i],pre[i]);
        m2 = code[i];
        if (m1+m2 > 1)
            temp.code = "2";
        else if (m1+m2 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m2<<" ";
        if (m1==0){
            temp.label = "";
            }
        if (m1==1){
            if (i<outside)
                temp.label = "A8_Rh_1,";
            if (i>=outside && i< inside)
                temp.label = "B8_Rh_1,";
            if (i>inside)
                temp.label = "C8_Rh_1,";
            }
        if(m1==2){
            if (i<outside)
                temp.label = "A8_Rh_2,";
            if (i>=outside && i< inside)
                temp.label = "B8_Rh_2,";
            if (i>inside)
                temp.label = "C8_Rh_2,";
            
            }
        switch (m2)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A20_Rh_1,";
            if (i>=outside && i< inside)
                temp.label += "B20_Rh_1,";
            if (i>inside)
                temp.label += "C20_Rh_1";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A20_Rh_2,";
            if (i>=outside && i< inside)
                temp.label += "B20_Rh_2,";
            if (i>inside)
                temp.label += "C20_Rh_2,";
            break;
            }
        }
        result.push_back(temp);  
    }
    return result;
}

4.4位势高度质控

位势高度质控包括双权重离群值检查、极值检查

vector<qcFlag> gphQC(vector<float> gph,vector<float> pre,vector<float> lat,int length,int outside,int inside){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m1,m2;
    qcm.N = length;
    code = qcm.GPH_Double_weighted_outlier_check(gph);
    for (int i=0;i<length;i++){
        m1 = qcm.GPH_extreme_check(gph[i],pre[i],lat[i]);
        m2 = code[i];
        if (m1+m2 > 1)
            temp.code = "2";
        else if (m1+m2 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m2<<" ";
        if (m1==0){
            temp.label = "";
            }
        if (m1==1){
            if (i<outside)
                temp.label = "A2_GPH_1,";
            if (i>=outside && i< inside)
                temp.label = "B2_GPH_1,";
            if (i>inside)
                temp.label = "C2_GPH_1,";
            }
        if(m1==2){
            if (i<outside)
                temp.label = "A2_GPH_2,";
            if (i>=outside && i< inside)
                temp.label = "B2_GPH_2,";
            if (i>inside)
                temp.label = "C2_GPH_2,";
            
            }
        switch (m2)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A22_GPH_1,";
            if (i>=outside && i< inside)
                temp.label += "B22_GPH_1,";
            if (i>inside)
                temp.label += "C22_GPH_1";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A22_GPH_2,";
            if (i>=outside && i< inside)
                temp.label += "B22_GPH_2,";
            if (i>inside)
                temp.label += "C22_GPH_2,";
            break;
            }
        }
        result.push_back(temp);  
    }
    return result;
}

4.5露点温度质控

露点温度质控包括双权重离群值检查、温度露点一致性检查

vector<qcFlag> dewQC(vector<float> tem,vector<float> td,int length,int outside,int inside){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m1,m2;
    qcm.N = length;
    code = qcm.Td_Double_weighted_outlier_check(td);
    for (int i=0;i<length;i++){
        m1 = qcm.Temperature_Dewpoint_difference(tem[i],td[i]);
        m2 = code[i];
        if (m1+m2 > 1)
            temp.code = "2";
        else if (m1+m2 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m2<<" ";
        if (m1==0){
            temp.label = "";
            }
        if (m1==1){
            if (i<outside)
                temp.label = "A9_Td_1,";
            if (i>=outside && i< inside)
                temp.label = "B9_Td_1,";
            if (i>inside)
                temp.label = "C9_Td_1";
            }
        if(m1==2){
            if (i<outside)
                temp.label = "A9_Td_2,";
            if (i>=outside && i< inside)
                temp.label = "B9_Td_2,";
            if (i>inside)
                temp.label = "C9_Td_2,";
            
            }
        switch (m2)
        {
        case 0:{
            temp.label += "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A21_Td_1,";
            if (i>=outside && i< inside)
                temp.label += "B21_Td_1,";
            if (i>inside)
                temp.label += "C21_Td_1,";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A21_Td_2,";
            if (i>=outside && i< inside)
                temp.label += "B21_Td_2,";
            if (i>inside)
                temp.label += "C21_Td_2,";
            break;
            }
        }
        result.push_back(temp);  
    }
    return result;
}

4.6反算气压质控

反算气压质控包括气压反算气压一致性检查

vector<qcFlag> bpQC(vector<float> pre,vector<float> bcp,int length,int outside,int inside){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m1;
    qcm.N = length;
    
    for (int i=0;i<length;i++){
        m1 = qcm.Backcalculation(pre[i],bcp[i]);
        
        if (m1 > 1)
            temp.code = "2";
        else if (m1 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m2<<" ";
        if (m1==0){
            temp.label = "";
            }
        if (m1==1){
            if (i<outside)
                temp.label = "A24_IVP_1,";
            if (i>=outside && i< inside)
                temp.label = "B24_IVP_1,";
            if (i>inside)
                temp.label = "C24_IVP_1";
            }
        if(m1==2){
            if (i<outside)
                temp.label = "A24_IVP_2,";
            if (i>=outside && i< inside)
                temp.label = "B24_IVP_2,";
            if (i>inside)
                temp.label = "C24_IVP_2,";
            
            }
        
        result.push_back(temp);  
    }
    return result;
}

4.7北向速度质控

北向速度质控主要包括双权重离群值检查

vector<qcFlag> nspQC(vector<float> nsp,int length,int outside,int inside){
    qcFlag temp;
    QCMethod qcm;
    vector<int> code;
    vector<qcFlag> result;
    int m2;
    qcm.N = length;
    code = qcm.NSPD_Double_weighted_outlier_check(nsp);
    for (int i=0;i<length;i++){
        
        m2 = code[i];
        if (m2 > 1)
            temp.code = "2";
        else if (m2 == 1)
            temp.code = "1";
        else
            temp.code = "0";
        //cout<<m2<<" ";
        
        switch (m2)
        {
        case 0:{
            temp.label = "";
            break;
        }
        case 1:{
            if (i<outside)
                temp.label += "A17_NSPD_1,";
            if (i>=outside && i< inside)
                temp.label += "B17_NSPD_1,";
            if (i>inside)
                temp.label += "C17_NSPD_1,";
            break;
            }
        case 2:{
            if (i<outside)
                temp.label += "A17_NSPD_2,";
            if (i>=outside && i< inside)
                temp.label += "B17_NSPD_2,";
            if (i>inside)
                temp.label += "C17_NSPD_2,";
            break;
            }
        }
        result.push_back(temp);  
    }
    return result;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

nobrody

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值