将二进制文件转换为十进制矩阵

时间:2017-06-02 12:53:17

标签: r matrix binary decimal

我正在尝试将以下二进制文件转换为十进制矩阵:

http://ftp.cptec.inpe.br/modelos/io/tempo/regional/Eta40km_ENS/prec24/2017052812/pp20170528_0024.bin

该文件涉及巴西某些地理区域的水文测量级别

矩阵的尺寸应为[144,157]。 我试图使用的以下代码不会产生预期的结果(维度),也不会产生正确的降雨量(通常它应该显示0到200之间的数字)。

series_URL <- "http://ftp.cptec.inpe.br/modelos/io/tempo/regional/Eta40km_ENS/prec24/2017052812/pp20170528_0024.bin"
temp_1 <- tempfile()
download.file(series_URL,temp_1)
series_data <- readBin(temp_1, integer(), 157, size = 12)

输出:

1.  [1]  6.117009e-28  1.918706e-26  5.632241e-26  4.031371e-26  1.610915e-26  6.696818e-28  1.031170e-28
2.  [8]  7.196306e-29  2.134588e-26  2.617492e-25  1.529918e-24  5.790051e-22  3.294055e-18  2.576926e-21
3. [15]  4.624857e-14  2.101807e-11  7.428920e-12  4.827435e-14  8.710901e-16  1.533932e-10  5.958279e-10
4.  [22]  1.927221e-08  3.222763e-12  2.217207e-07  2.911737e-05  5.785809e-03  3.240025e+00  1.948279e+01
5. [29]  3.328233e-01  1.491561e-05  2.504128e-11  5.806955e-25  0.000000e+00  0.000000e+00  0.000000e+00
6. [36]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  7.526874e-14
7. [43]  1.743083e-07  1.210642e-05  4.649596e-04  2.202887e-01  2.431919e-01  4.425891e-01  3.531607e+00
8. [50] 5.306091e-315  0.000000e+00  1.457468e+00  4.544175e-02  7.958694e-05  5.449028e-08  3.995853e-10
9. [57]  1.640078e-14  1.989274e-15  1.073701e-10  1.934239e-14  2.930132e-11  6.641559e-23  1.061018e-26
10. [64]  1.578544e-17  2.620794e-37  5.464423e-44  7.958314e-44  5.238045e-46  9.309669e-59  0.000000e+00
11. [71]  0.000000e+00  4.400491e-23  8.166333e-19  6.828827e-18  3.376732e-18  1.547543e-18  1.626203e-19
12. [78]  1.176210e-20  1.472164e-21  4.558449e-22  1.056857e-21  5.552315e-21  1.214248e-20  4.670482e-20
13. [85]  3.427503e-18  5.521386e-19  6.161359e-15  3.035510e-12  1.279961e-12  1.686678e-13  2.518800e-15
14. [92]  4.103846e-11  3.123834e-08  2.791977e-09  2.297828e-11  1.196714e-09  1.754792e-06  8.313848e-05
15. [99]  3.953890e-02  2.554013e+01  8.521120e+01  1.288987e+00  1.203942e-04  9.161328e-09  5.437597e-16
16. [106] 4.986266e-315  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
17. [113]  0.000000e+00  1.266409e-20  3.181196e-09  9.675489e-07  5.719614e-05  3.281916e-04  7.979276e-03
18. [120]  7.910658e-02  6.103178e-01  2.789717e+00  0.000000e+00  3.321379e-01  1.508044e-02  5.727718e-06
19. [127]  1.889389e-09  5.041999e-16  7.681076e-19  1.456306e-20  1.351600e-12  1.873332e-13  2.032801e-12
20. [134]  1.943675e-47  2.082875e-20  2.344611e-19  1.232857e-48  8.101694e-47  3.536543e-46  6.575080e-49
21. [141]  5.945790e-55  2.474903e-26  4.272799e-18  1.126914e-14  4.022795e-14  9.839206e-14  1.570162e-14
22. [148]  6.422801e-15  3.428481e-16  1.087516e-17  1.357747e-18  1.415265e-19  1.237552e-19  3.247390e-19
23. [155]  8.213019e-19  6.309748e-16  7.546767e-15
你可以帮帮我吗?

0 个答案:

没有答案