Drainage basin rainfall data fusion analysis and display method based on python

Through the fusion analysis method of basin rainfall data based on python, the problems of uneven acquisition of basin rainfall data and large errors in traditional interpolation methods are solved, and efficient and accurate data processing and multi-dimensional visualization are realized, which is suitable for basin flood forecasting systems.

CN120429357AActive Publication Date: 2025-08-05HOHAI UNIV +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510520046.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-08-05
Estimated Expiration
2045-04-24

AI Technical Summary

Technical Problem

In the existing technology, the acquisition of rainfall data in the basin is uneven. The traditional interpolation method fails to fully consider the impact of topographic elevation factors on the spatial distribution of rainfall, resulting in insufficient data representation and large errors in the interpolation results. The calculation efficiency of hydrological data processing software is low, making it difficult to adapt to the real-time flood forecasting needs. The existing visualization tools lack the ability to analyze dynamic spatiotemporal evolution.

Method used

The fusion analysis method of basin rainfall data based on Python is adopted, and the rainfall-elevation gradient function and multiple interpolation methods are constructed through grid division, preprocessing, and data fusion analysis is carried out in combination with hierarchical analysis to generate surface rainfall spatial distribution and time trend charts to realize automated data processing and multi-dimensional visualization.

Benefits of technology

It improves data processing efficiency, accurately reflects the impact of terrain on rainfall, enhances data accuracy and visual display capabilities, and provides accurate core input elements for basin flood forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429357A_ABST
    Figure CN120429357A_ABST
Patent Text Reader

Abstract

The invention belongs to a hydrometeorological data processing technology, and discloses a python-based drainage basin rainfall data fusion analysis and display method, which comprises the following steps of: dividing a drainage basin grid to obtain a sampling point set; the rainfall data and the elevation data in a preset time period are preprocessed, and an effective rainfall data set and effective elevation data of the site are obtained; constructing a rainfall-elevation gradient function, calculating the area rainfall of the watershed in combination with various methods, constructing a fusion analysis model through an analytic hierarchy process, obtaining rainfall data at a sampling point set, and calculating the average area rainfall by adopting an averaging method; and generating a surface rainfall spatial distribution thermodynamic diagram time sequence and a surface average rainfall time trend chart. According to the method, drainage basin rainfall data are automatically fused and analyzed through the python programming language, the influence of the terrain on rainfall spatial distribution is comprehensively considered, rainfall spatial and temporal change characteristics are presented in a multi-dimensional visualization mode, and accurate core input elements are provided for drainage basin flood forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hydrological and meteorological data processing, and in particular to a Python-based basin rainfall data fusion analysis and display method, which is particularly suitable for rainfall data processing and analysis in a basin flood forecasting system. Background Art

[0002] Areal rainfall is a crucial parameter in hydrometeorology. As the initial value of hydrological models, its estimation is directly related to the accuracy of flood forecasts and the scientific nature of flood management decisions. Accurate rainfall data is a core input for river basin flood forecasting models. Currently, basin rainfall data acquisition relies primarily on ground-based meteorological stations and rain gauges. The uneven spatial distribution of monitoring stations results in insufficient data representation. Traditional interpolation methods fail to fully account for the impact of terrain elevation on the spatial distribution of rainfall. Furthermore, multiple interpolation methods lack a systematic integration mechanism, resulting in large errors in interpolation results in areas with complex terrain.

[0003] Traditional hydrological data processing software relies on manual operations, resulting in low computational efficiency and difficulty adapting to the needs of real-time flood forecasting. Existing visualization tools often focus on static display and lack the ability to analyze dynamic spatiotemporal evolution, making it difficult to intuitively present the spatiotemporal heterogeneity of rainfall. Summary of the Invention

[0004] Purpose of the invention: The purpose of the present invention is to address the deficiencies in the prior art and to provide a Python-based basin rainfall data fusion analysis and display method. Based on the Python programming language and measured rainfall data, the method automatically fuses and analyzes basin rainfall data, comprehensively considers the impact of terrain on the spatial distribution of rainfall, and presents the spatiotemporal variation characteristics of rainfall through multi-dimensional visualization, providing accurate core input elements for basin flood forecasting.

[0005] Technical solution: The present invention provides a Python-based basin rainfall data fusion analysis and display method, comprising the following steps:

[0006] Step 1: Divide the basin into multiple regular grids, take the center point of each grid as the sampling point, and then obtain the sampling point set [(x, y)] of the basin;

[0007] Step 2: Create a new Python file based on the PyCharm editor and preprocess the relevant watershed data;

[0008] Step 2.1: Preprocess the rainfall data obtained in the basin;

[0009] First, obtain the measured rainfall dataset of m rainfall monitoring points in the basin. Then import the pymysql library to write SQL statements to read the measured rainfall dataset of m rainfall monitoring points within the preset time period t. Each data record includes the timestamp, point coordinates and rainfall amount. After removing outliers and null values, the original rainfall dataset {po} is obtained. Then, the effective rainfall dataset {pe} of the m rainfall monitoring points is calculated using the quartile method and spline interpolation method.

[0010] Step 2.2: Preprocess the basin elevation data;

[0011] First, read the original elevation data of the basin, import the rasterio library, read the elevation data of the sampling point set [(x,y)], and obtain the original elevation data [eo]. Then calculate the effective elevation data, that is, import the numpy and scipy libraries, replace the invalid elevation values, and obtain the effective elevation data [ee].

[0012] Step 3: Construct a basin rainfall data fusion analysis model. The basin rainfall data fusion analysis model includes the rainfall-elevation gradient function time series [f] n and rainfall data fusion analysis model time series [fm] n ; n is the total number of time series of measured rainfall data;

[0013] Step 4: Calculate the basin rainfall data fusion analysis results output by the basin rainfall data fusion analysis model in step 3 to obtain the basin's fusion surface rainfall spatial distribution time series [spm] n and the time series of the average rainfall in the basin [pa] n ;

[0014] Step 5: Display and export the fusion analysis results of the basin rainfall data in step 4 to obtain the time series of the heat map of the spatial distribution of the basin rainfall [h] n Time trend chart of average rainfall in the region l.

[0015] Furthermore, when performing watershed grid division in step 1, the watershed basin is divided into multiple regular grids with a horizontal spatial resolution Δx and a vertical spatial resolution Δy. The formula for the sampling point set [(x, y)] of the watershed basin is as follows:

[0016]

[0017] Where x is the horizontal length of the basin, y is the vertical length of the basin, r is the total number of horizontal grids, and s is the total number of vertical grids.

[0018] Furthermore, the formula of the original rainfall dataset {po} in step 2.1 is as follows:

[0019] {po}={[po1] n ,[po2] n ,...,[po m ] n}

[0020]

[0021] n=t / Δt

[0022] n is the total number of time series of measured rainfall data; Δt is the collection time interval of measured rainfall data; [po m ] n is the original rainfall dataset of the mth rainfall monitoring point within the preset period t; m,n is the original rainfall data of the mth rainfall monitoring point at the nth moment;

[0023] For m rainfall monitoring points, the calculation method of the preprocessed effective rainfall dataset {pe} is:

[0024] The original rainfall data set of the mth rainfall monitoring point [po m ] n For example, import the numpy library and calculate [po m ] n The lower quartile po m,1 / 4 , median po m,1 / 2 , upper quartile po m,3 / 4 , interquartile range po m,r , effective value upper boundary po m,u and the lower boundary of the effective value po m,d , draw a box plot and eliminate invalid data;

[0025] po m,r =po m,3 / 4 -po m,1 / 4

[0026] po m,u =po m,3 / 4 +1.5po m,r

[0027] po m,d =po m,1 / 4 -1.5po m,r

[0028] If the value is greater than the upper limit of the valid value po m,u Or less than the lower limit of the effective value po m,d , it is determined to be invalid data and the elimination operation is performed;

[0029] The spline interpolation method is used to complete the invalid data and obtain the valid data set of the mth rainfall monitoring point [pe m ] n , the formula is as follows:

[0030]

[0031] Finally, traverse the m rainfall monitoring points to obtain the preprocessed effective rainfall dataset {pe};

[0032] {pe}={[pe1] n ,[pe2] n ,...,[pe m ] n}.

[0033] Furthermore, the formula of the original elevation data [eo] in step 2.2 is as follows:

[0034]

[0035] The calculation formula for effective elevation data [ee] is as follows:

[0036]

[0037] It refers to the sampling point (x r ,y1)’s original elevation, is the sampling point (x r ,y1)’s effective elevation.

[0038] Furthermore, the specific process of calculating the basin rainfall data fusion analysis results in step 3 is as follows:

[0039] Step 3.1: Construct the rainfall-elevation gradient function time series [f] n :

[0040] Taking the nth time series as an example, import the numpy and scikit-learn libraries, based on the effective rainfall dataset of m rainfall monitoring points [pe n ] m and effective elevation data [ee], construct the rainfall-elevation gradient function f n ;

[0041] [pe n ] m =[pe 1,n ,pe 2,n ,...,pe m,n ]

[0042] fn =Poly([pe n ] m ,[ee])

[0043] Poly is the polynomial gradient function;

[0044] Then traverse n time series to obtain the rainfall-elevation gradient function time series [f] n ;

[0045] [f] n =[f1,f2,...,f n ]

[0046] Step 3.2: Construct rainfall data fusion analysis model time series [fm] n ;

[0047] Step 3.2.1: Calculate the surface rainfall time series. For the nth time series, first calculate the effective rainfall data set [pe n ] m and rainfall-elevation gradient function f n , the Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method are used to calculate the surface rainfall sp of the basin. v,n 、sp e,n 、sp a,n and sp k,n , the expression is as follows:

[0048]

[0049] Voro, Equa, Aver and Krig are the Thiessen polygon method, isohyetal method, arithmetic mean method and Kriging interpolation method functions respectively;

[0050] Then traverse n time series to obtain the basin area rainfall time series calculated by Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method [sp v ] n 、[sp e ] n 、[sp a ] n and [sp k ] n , the expression is as follows:

[0051] [sp v ] n =[sp v,1 ,sp v,2 ,...,sp v,n ]

[0052] [spe ] n =[sp e,1 ,sp e,2 ,...,sp e,n ]

[0053] [sp a ] n =[sp a,1 ,sp a,2 ,...,sp a,n ]

[0054] [sp k ] n =[sp k,1 ,sp k,2 ,...,sp k,n ]

[0055] Step 3.2.2, build the rainfall data fusion analysis model time series, take the nth time series as an example, import the pyahp library, and calculate the basin area rainfall sp based on the Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method. v,n 、sp e,n 、sp a,n and sp k,n , the weights w of Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method are determined by using the analytic hierarchy process v,n 、w e,n 、w a,n and w k,n , build rainfall data fusion analysis model fm n , the expression is as follows:

[0056] [w v,n ,w e,n ,w a,n ,w k,n ]=AHP(sp v,n ,sp e,n ,sp a,n ,sp k,n )

[0057] fm n =w v,n sp v,n +w e,n sp e,n +w a,n sp a,n +w k,n sp k,n

[0058] AHP is the analytic hierarchy process function;

[0059] Traverse n time series to obtain the rainfall data fusion analysis model time series [fm] n ;

[0060] [fm] n =[fm1,fm2,...,fm n ].

[0061] The present invention uses the Thiessen polygon method, the isohyetal method, the arithmetic mean method and the Kriging interpolation method to calculate the surface rainfall of the watershed. The accuracy of these four methods depends on the actual situation, the characteristics of the watershed, the distribution of rain gauges and the quality of the data. The arithmetic mean method is feasible when the rain gauges are dense and the rainfall is uniform, but in most cases the accuracy is the lowest; the Thiessen polygon method is medium when the rain gauges are dense and evenly distributed, but the accuracy is low in areas with complex terrain or large rainfall gradients; for the isohyetal method, if the contour lines are drawn accurately (such as combining terrain and meteorological knowledge), the accuracy is usually the highest, but it is greatly affected by human factors. For the Kriging interpolation method: the accuracy is higher in areas with sufficient data and strong spatial correlation, close to the isohyetal method.

[0062] Furthermore, the detailed process of step 4 is as follows:

[0063] Step 4.1. Calculate the spatial distribution time series of surface rainfall [spm] n ,

[0064] For the nth time series, firstly based on the rainfall data fusion analysis model fm n Calculate the integrated surface rainfall spm of the basin n ;

[0065]

[0066] Then traverse n time series to obtain the fusion surface rainfall spatial distribution time series of the basin [spm] n ;

[0067] [spm] n =[spm1,spm2,...,spm n ]

[0068] Step 4.2: Calculate the time series of surface average rainfall [pa] n For the nth time series, firstly based on the fusion surface rainfall spm n Calculate the average rainfall area pa n ;

[0069] pa n =spm n ΔxΔy / xy

[0070] Then import the tqdm library, traverse n time series, and finally get the area average rainfall time series of the basin [pa] n , the expression is as follows:

[0071] [pa] n =[pa1,pa2,...,pa n ].

[0072] Furthermore, the detailed method of step 5 is:

[0073] Step 5.1, calculate the time series of the heat map of the spatial distribution of surface rainfall. Taking the nth time series as an example, import the matplotlib.pyplot library and calculate the fusion surface rainfall spm based on the basin. n Generate heat map h n ,

[0074] [h] n =HeatMap(spm n );

[0075] HeatMap is the heat map function;

[0076] Then traverse n time series to obtain the time series of the heat map of the spatial distribution of surface rainfall in the basin [h] n , the expression is as follows:

[0077] [h] n =[h1,h2,...,h n ];

[0078] Step 5.2, calculate the time trend graph of the average rainfall in the area l, that is, import the matplotlib.pyplot library, based on the time series of the average rainfall in the basin [pa] n Generate a time trend graph of average rainfall on the surface.

[0079] l=LineMap([pa] n )

[0080] LineMap is a trend chart function;

[0081] Step 5.3: Convert the time series of the heat map of spatial distribution of rainfall [h] n Export the time trend graph of average rainfall over the surface and save it locally in .jpg format.

[0082] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects:

[0083] (1) The present invention realizes the automatic fusion analysis of rainfall data and improves the data processing efficiency.

[0084] (2) The present invention combines elevation data and accurately reflects the impact of terrain on rainfall through the elevation gradient function.

[0085] (3) The multi-method fusion analysis results of the present invention are more accurate than those of a single method.

[0086] (4) The present invention can visualize and intuitively present the temporal and spatial variation characteristics of rainfall.

[0087] (5) The whole process of the present invention is implemented in Python, which is convenient for integration into the existing flood forecasting system. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] Figure 1 It is the overall flow chart of the present invention;

[0089] Figure 2 The heat map of spatial distribution of rainfall in the watershed calculated based on the Thiessen polygon method in the embodiment;

[0090] Figure 3 The heat map of spatial distribution of rainfall in the watershed calculated based on the isohyetal method in the embodiment;

[0091] Figure 4 The heat map of spatial distribution of rainfall in the watershed calculated based on the arithmetic mean method in the embodiment;

[0092] Figure 5 This is a heat map of spatial distribution of rainfall in the watershed calculated based on the Kriging interpolation method in the embodiment;

[0093] Figure 6 The heat map of spatial distribution of rainfall in the watershed calculated based on the rainfall data fusion analysis model in the embodiment;

[0094] Figure 7 This is a time trend diagram of the surface average rainfall calculated based on the rainfall data fusion analysis model in the embodiment. DETAILED DESCRIPTION

[0095] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.

[0096] like Figure 1 As shown, the Python-based basin rainfall data fusion analysis and display method of the present invention includes the following steps:

[0097] Step 1: Divide the basin into multiple regular grids, set the center point of each grid as the sampling point, and then obtain the sampling point set [(x, y)] of the basin;

[0098] Step 2: Preprocess the relevant watershed data based on the PyCharm editor;

[0099] Step 2.1: Preprocess the rainfall data obtained in the basin;

[0100] First, the measured rainfall dataset of m rainfall monitoring points in the basin is obtained. The measured rainfall dataset of m rainfall monitoring points in the preset period t is read, and the original rainfall dataset {po} is obtained after removing outliers and null values. Then, the effective rainfall dataset {pe} of the m rainfall monitoring points is calculated by the quartile method and spline interpolation method.

[0101] Step 2.2: Preprocess the basin elevation data;

[0102] First, read the original elevation data of the basin [eo]; then replace the invalid elevation value to obtain the valid elevation data [ee];

[0103] Step 3: Construct a basin rainfall data fusion analysis model. The basin rainfall data fusion analysis model includes the rainfall-elevation gradient function time series [f] n and rainfall data fusion analysis model time series [fm] n ; n is the total number of time series of measured rainfall data;

[0104] Step 4: Calculate the basin rainfall data fusion analysis results output by the basin rainfall data fusion analysis model in step 3 to obtain the basin's fusion surface rainfall spatial distribution time series [spm] n and the time series of the average rainfall in the basin [pa] n ;

[0105] Step 5: Display and export the fusion analysis results of the basin rainfall data in step 4 to obtain the time series of the heat map of the spatial distribution of the basin rainfall [h] n Time trend chart of average rainfall in the region l.

[0106] This paper uses the Python programming language to automatically integrate and analyze basin rainfall data, comprehensively considers the impact of terrain on the spatial distribution of rainfall, and presents the spatiotemporal variation characteristics of rainfall through multi-dimensional visualization, providing accurate core input elements for basin flood forecasting.

[0107] Example,To verify the technical effect of the present invention, this example is specifically applied in a river basin in the south, which has a horizontal length of 55 km and a vertical length of 21 km;

[0108] This embodiment includes the following steps:

[0109] S1. Watershed grid division.

[0110] In this embodiment, the basin is divided into multiple regular grids with a horizontal spatial resolution Δx and a vertical spatial resolution Δy. Δx and Δy are both 0.1 km. The total number of horizontal grids is 550, and the total number of vertical grids is 210. The center point of the grid is taken as the sampling point to obtain the sampling point set [(x, y)] of the basin.

[0111]

[0112] S2. Preprocessing of watershed data: Create a new Python file using the PyCharm editor.

[0113] S2.1: Preprocessing of rainfall data.

[0114] (1) Reading raw rainfall data

[0115] Obtain the measured rainfall dataset of 20 rainfall monitoring points in the basin, import the pymysql library, write SQL statements, and read the measured rainfall dataset of 20 rainfall monitoring points within a preset period of 360 minutes. The collection time interval is 5 minutes, and the total number of time series is 72. A single data record includes a timestamp, point coordinates, and rainfall. After removing outliers and null values, the original rainfall dataset {po} is obtained.

[0116] {po}={[po1] 72 ,[po2] 72 ,...,[po 20 ] 72}

[0117] Taking the first rainfall monitoring point as an example, [po1] 72 is the original rainfall dataset of the first rainfall monitoring point within the preset period; po 1,72 This is the original rainfall data of the first rainfall monitoring point at the 72nd moment.

[0118]

[0119] (2) Calculation of effective rainfall data

[0120] The original rainfall dataset of the first rainfall monitoring point [po1] 72 For example, import the numpy library and calculate [po 1 ] 72 The lower quartile po 1,1 / 4 , median po 1,1 / 2 , upper quartile po 1,3 / 4 , interquartile range po 1,r , effective value upper boundary po 1,u and the lower boundary of the effective value po 1,d, draw a box plot and eliminate invalid data.

[0121] po 1,1 / 4 =7.73

[0122] po 1,3 / 4 =11.37

[0123] po 1,r =po 1,3 / 4 -po 1,1 / 4 =3.64

[0124] po 1,u =po 1,3 / 4 +1.5po 1,r =16.83

[0125] po 1,d =po 1,1 / 4 -1.5po 1,r =2.27

[0126] If the value is greater than the upper limit of the valid value po 1,u Or less than the lower limit of the effective value po 1,d , it is determined to be invalid data and the elimination operation is performed.

[0127] Using the spline interpolation method, the invalid data that was eliminated was supplemented to obtain the valid data set of the first rainfall monitoring point [pe1] 72 .

[0128]

[0129] Traverse m rainfall monitoring points and obtain the preprocessed effective rainfall dataset {pe}.

[0130] {pe}={[pe1] 72 ,[pe2] 72 ,...,[pe 20 ] 72}

[0131] S2.2. Elevation data preprocessing.

[0132] (1) Reading original elevation data

[0133] Get the elevation data of the basin, import the rasterio library, read the elevation data of the sampling point set [(x,y)], and get the original elevation data [eo].

[0134]

[0135] (2) Calculation of effective elevation data

[0136] Import the numpy and scipy libraries, replace invalid elevation values, and obtain valid elevation data [ee].

[0137]

[0138] S3. Construction of basin rainfall data fusion analysis model.

[0139] S3.1. Construction of rainfall-elevation gradient function time series.

[0140] Taking the 36th time series as an example, we import the numpy and scikit-learn libraries and use the effective rainfall dataset [pe 36 ] 20 and effective elevation data [ee], construct the rainfall-elevation gradient function f 36 .

[0141] [pe 36 ] 20 =[pe 1,36 ,pe 2,36 ,...,pe 20,36 ]

[0142] f 36 =Poly([pe 36 ] 20 ,[ee])

[0143] Traverse 72 time series and obtain the rainfall-elevation gradient function time series [f] 72 .

[0144] [f] 72 =[f1,f2,...,f 72 ]

[0145] S3.2. Construction of time series of rainfall data fusion analysis model.

[0146] (1) Calculation of surface rainfall time series

[0147] Taking the 36th time series as an example, based on the effective rainfall data set of 20 rainfall monitoring points [pe 36 ] 20 and rainfall-elevation gradient function f 36 The area rainfall sp of the basin is calculated using the Thiessen polygon method, isohyetal method, arithmetic mean method and Kriging interpolation method. v,36 、sp e,36 、sp a,36 and sp k,36 , its effect is as follows Figures 2 to 5 shown.

[0148]

[0149]

[0150] Traversing 72 time series, we get the basin area rainfall time series calculated by Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method [sp v ] 72 、[sp e ] 72 、[sp a ] 72 and [sp k ] 72 .

[0151] [sp v ] 72 =[sp v,1 ,sp v,2 ,...,sp v,72 ]

[0152] [sp e ] 72 =[sp e,1 ,sp e,2 ,...,sp e,72 ]

[0153] [sp a ] 72 =[sp a,1 ,sp a,2 ,...,sp a,72 ]

[0154] [sp k ] 72 =[sp k,1 ,sp k,2 ,...,sp k,72 ]

[0155] (2) Construction of time series of rainfall data fusion analysis model

[0156] Taking the 36th time series as an example, the pyahp library is imported, and the basin surface rainfall sp is calculated based on the Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method. v,36 、sp e,36 、sp a,36 and sp k,36 , the weights w of Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method are determined by using the analytic hierarchy process v,36 、w e,36 、w a,36 and w k,36 , build rainfall data fusion analysis model fm 36 .

[0157] [w v,36 ,w e,36 ,w a,36 ,w k,36 ]=[0.19,0.49,0.06,0.26]

[0158] fm 36 =w v,36 sp v,36 +w e,36 sp e,36 +w a,36 sp a,36 +w k,36 sp k,36

[0159] Traverse 72 time series and obtain the rainfall data fusion analysis model time series [fm] 72 .

[0160] [fm] 72 =[fm1,fm2,...,fm 72 ];

[0161] Here, the analytic hierarchy process (AHP) is used to determine the weights for the Thiessen polygon method, isohyetal method, arithmetic mean method, and kriging interpolation methods, and then the weighted sum is calculated. This avoids the problem of traditional interpolation methods failing to fully consider the influence of terrain elevation on the spatial distribution of rainfall, and systematically integrates multiple interpolation methods to reduce errors.

[0162] S4. Calculation of basin rainfall data fusion analysis results.

[0163] S4.1. Calculation of spatial distribution time series of surface rainfall

[0164] Taking the 36th time series as an example, based on the rainfall data fusion analysis model fm 36 Calculate the integrated surface rainfall spm of the basin 36 .

[0165]

[0166] Traverse 72 time series and obtain the fusion surface rainfall spatial distribution time series of the basin [spm] 72 .

[0167] [spm] 72 =[spm1,spm2,...,spm 72 ]

[0168] S4.2. Calculation of time series of surface average rainfall.

[0169] Taking the 36th time series as an example, based on the fusion surface rainfall spm36 Calculate the average rainfall area pa 36 .

[0170] pa 36 =spm 36 ΔxΔy / xy=4.09

[0171] Import the tqdm library, traverse 72 time series, and obtain the basin's average rainfall time series [pa] 72 .

[0172] [pa] 72 =[pa1,pa2,...,pa 72 ]

[0173] S5. Display and export of basin rainfall data fusion analysis results.

[0174] S5.1. Calculation of time series of heat maps of spatial distribution of surface rainfall.

[0175] Taking the 36th time series as an example, import the matplotlib.pyplot library and calculate the fused surface rainfall spm based on the watershed. 36 Generate heat map h 36 .

[0176] [h] 36 =HeatMap(spm 36 )

[0177] Traverse 72 time series and obtain the time series of the heat map of the spatial distribution of surface rainfall in the basin [h] 72 .

[0178] [h] 72 =[h1,h2,...,h 72 ]

[0179] S5.2. Calculation of time trend chart of surface average rainfall.

[0180] Import the matplotlib.pyplot library, basin-based average rainfall time series [pa] 72 Generate a time trend graph of surface average rainfall l.

[0181] l=LineMap([pa] 72 )

[0182] S5.3. Export the time series of the heat map of the spatial distribution of surface rainfall [h] 72 Save the time trend graph of average rainfall in the local area in .jpg format, such as Figure 6 and Figure 7 shown.

Claims

1. A Python-based method for fusion analysis and display of basin rainfall data, characterized by: The following steps are involved: Step 1: Divide the basin into multiple regular grids, set the center point of each grid as the sampling point, and then obtain the sampling point set [(x, y)] of the basin; Step 2: Preprocess the relevant watershed data based on the PyCharm editor; Step 2.1: Preprocess the rainfall data obtained in the basin; First, the measured rainfall dataset of m rainfall monitoring points in the basin is obtained. The measured rainfall dataset of m rainfall monitoring points in the preset period t is read, and the original rainfall dataset {po} is obtained after removing outliers and null values. Then, the effective rainfall dataset {pe} of the m rainfall monitoring points is calculated by the quartile method and spline interpolation method. Step 2.2: Preprocess the basin elevation data; First, read the original elevation data of the basin [eo]; then replace the invalid elevation value to obtain the valid elevation data [ee]; Step 3: Construct a basin rainfall data fusion analysis model. The basin rainfall data fusion analysis model includes the rainfall-elevation gradient function time series [f] n and rainfall data fusion analysis model time series [fm] n ; n is the total number of time series of measured rainfall data; Step 4: Calculate the basin rainfall data fusion analysis results output by the basin rainfall data fusion analysis model in step 3 to obtain the basin's fusion surface rainfall spatial distribution time series [spm] n and the time series of the average rainfall in the basin [pa] n ; Step 5: Display and export the fusion analysis results of the basin rainfall data in step 4 to obtain the time series of the heat map of the spatial distribution of the basin rainfall [h] n Time trend chart of average rainfall in the region l.

2. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: When performing watershed grid division in step 1, the watershed basin is divided into multiple regular grids with a horizontal spatial resolution Δx and a vertical spatial resolution Δy. The formula for the sampling point set [(x, y)] of the watershed basin is as follows: r = x / Δx; s=y / Δy; Where x is the horizontal length of the basin, y is the vertical length of the basin, r is the total number of horizontal grids, and s is the total number of vertical grids.

3. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: The formula of the original rainfall dataset {po} in step 2.1 is as follows: {after}={[after1] n ,[after 2] n ,...,[after m ] n } n=t / Δt Δt is the time interval for collecting measured rainfall data; [po m ] n is the original rainfall dataset of the mth rainfall monitoring point within the preset period t; m,n is the original rainfall data of the mth rainfall monitoring point at the nth moment; For the original rainfall data set of the mth rainfall monitoring point [po m ] n , import it into the numpy library, calculate [po m ] n The lower quartile po m,1 / 4 , median po m,1 / 2 , upper quartile po m,3 / 4 , interquartile range po m,r , effective value upper boundary po m,u and the lower boundary of the effective value po m,d , draw a box plot and eliminate invalid data; after m,r =after m,3 / 4 -after m,1 / 4 yes m,u =po m,3 / 4 +1.5pi m,r yes m,d =po m,1 / 4 -1.5po m,r If the value is greater than the upper limit of the valid value po m,u Or less than the lower limit of the effective value po m,d , it is determined to be invalid data and the elimination operation is performed; The spline interpolation method is used to complete the invalid data and obtain the valid data set of the mth rainfall monitoring point [pe m ] n , the formula is as follows: Finally, traverse the m rainfall monitoring points to obtain the preprocessed effective rainfall dataset {pe}; {on}={[on1] n ,[on2] n ,...,[on m ] n }。 4. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: The formula for the original elevation data [eo] in step 2.2 is as follows: The calculation formula for effective elevation data [ee] is as follows: It refers to the sampling point (x r ,y1)’s original elevation, is the sampling point (x r ,y1)’s effective elevation.

5. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: The specific process of calculating the basin rainfall data fusion analysis results in step 3 is as follows: Step 3.1: Construct the rainfall-elevation gradient function time series [f] n : For the nth time series, import it into numpy and scikit-learn libraries, based on the effective rainfall dataset of m rainfall monitoring points [pe n ] m and effective elevation data [ee], construct the rainfall-elevation gradient function f n ; [on n ] m =[on 1,n ,on 2,n ,...,on m,n ] f n =Poly([or n ] m ,[Yeah]) Poly is the polynomial gradient function; Then traverse n time series to obtain the rainfall-elevation gradient function time series [f] n ; [f] n =[f1,f2,...,f n ] Step 3.2: Construct rainfall data fusion analysis model time series [fm] n ; Step 3.2.1: Calculate the surface rainfall time series. For the nth time series, first calculate the effective rainfall data set [pe n ] m and rainfall-elevation gradient function f n , the Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method are used to calculate the surface rainfall sp of the basin. v,n 、sp e,n 、sp a,n and sp k,n , the expression is as follows: Voro, Equa, Aver and Krig are the Thiessen polygon method, isohyetal method, arithmetic mean method and Kriging interpolation method functions respectively; Then traverse n time series to obtain the basin area rainfall time series calculated by Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method [sp v ] n 、[sp e ] n 、[sp a ] n and [sp k ] n , the expression is as follows: [sp v ] n =[sp v,1 ,sp v,2 ,...,sp v,n ] [sp e ] n =[sp e,1 ,sp e,2 ,...,sp e,n ] [sp a ] n =[sp a,1 ,sp a,2 ,...,sp a,n ] [sp k ] n =[sp k,1 ,sp k,2 ,...,sp k,n ] Step 3.2.2, build the rainfall data fusion analysis model time series, for the nth time series, import it into the pyahp library, and calculate the basin area rainfall sp based on the Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method. v, 、sp e,n 、sp a,n and sp k,n , the weights w of Thiessen polygon method, isohyet method, arithmetic mean method and Kriging interpolation method are determined by using the analytic hierarchy process v,n 、w e,n 、w a,n and w k,n , build rainfall data fusion analysis model fm n , the expression is as follows: [w v,n ,w e,n ,w a,n ,w k,n ]=AHP(sp v,n ,sp e,n ,sp a,n ,sp k,n ) fm n =w v,n sp v,n +w e,n sp e,n +w a,n sp a,n +w k,n sp k,n AHP is the analytic hierarchy process function; Traverse n time series to obtain the rainfall data fusion analysis model time series [fm] n ; [fm] n =[fm1,fm2,...,fm n ]。 6. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: The detailed process of step 4 is as follows: Step 4.

1. Calculate the spatial distribution time series of surface rainfall [spm] n , For the nth time series, firstly based on the rainfall data fusion analysis model fm n Calculate the integrated surface rainfall spm of the basin n ; Then traverse n time series to obtain the fusion surface rainfall spatial distribution time series of the basin [spm] n ; [spm] n =[spm1,spm2,...,spm n ] Step 4.2: Calculate the time series of surface average rainfall [pa] n For the nth time series, firstly based on the fusion surface rainfall spm n Calculate the average rainfall area pa n ; pa n =spm n ΔxΔy / xy Then import the tqdm library, traverse n time series, and finally get the area average rainfall time series of the basin [pa] n , the expression is as follows: [bye] n =[pa1,pa2,...,pa n ]。 7. The Python-based basin rainfall data fusion analysis and display method according to claim 1 is characterized in that: The detailed method of step 5 is: Step 5.1, calculate the time series of the heat map of the spatial distribution of surface rainfall. For the nth time series, import it into the matplotlib.pyplot library and calculate the fused surface rainfall spm based on the watershed. n Generate heat map h n , [h] n =HeatMap(spm n ); HeatMap is the heat map function; Then traverse n time series to obtain the time series of the heat map of the spatial distribution of surface rainfall in the basin [h] n , the expression is as follows: [h] n =[h1,h2,...,h n ]; Step 5.2, calculate the time trend graph of the average rainfall in the area l, that is, import the matplotlib.pyplot library, based on the time series of the average rainfall in the basin [pa] n Generate a time trend graph of average rainfall on the surface. l=LineMap([pa] n ) LineMap is a trend chart function; Step 5.3: Convert the time series of the heat map of spatial distribution of rainfall [h] n Export the time trend graph of average rainfall over the surface and save it locally in .jpg format.

Citation Information

Patent Citations

  • Drainage basin surface rainfall time sequence calculation method and system based on point-surface fusion

    CN116010481A

  • Drainage basin hydrological situation expression method based on runoff modulus grid

    CN117237554A

  • Multi-scale adaptive selection urban flood modeling simulation method

    CN117332542A

  • Grid space-time integrated analysis method and system for rain condition information

    CN118068451A

  • Efficient total runoff control device and scheduling method for civil airport in highly built-up area

    CN118521103A