Mesoscale eddy identification and history tracking method based on python

Through the mesoscale vortex recognition and history tracking method based on Python, the problem of inefficient vortex recognition in the prior art is solved, and the visual display of vortex history is realized, and the recognition accuracy and efficiency are improved.

CN120179748APending Publication Date: 2025-06-20CHANGSHA ZHONGYING MARINE METEOROLOGICAL SERVICE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510250400.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The prior art is inefficient in identifying mesoscale vortexes, unable to meet the needs of rapid businessization in front- and back-end interactive environments, and cannot effectively visualize vortex history.

Method used

Using the mesoscale vortex recognition and history tracking method based on Python, the SLA data is obtained, matrix processing is performed, contour closure and vortex features are detected, the vortex center is obtained and the data is stored, and the vortex history is tracked and visualized.

Benefits of technology

The accuracy and efficiency of vortex recognition are improved, and the visual display of vortex history is realized, allowing scientific researchers to more conveniently observe and analyze the dynamic evolution process of vortexes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179748A_ABST
    Figure CN120179748A_ABST
Patent Text Reader

Abstract

The invention discloses a mesoscale eddy identification and history tracking method based on python. The method comprises the following steps: acquiring SLA data; judging whether the SLA data is successfully loaded or not, if the SLA data is successfully loaded, processing the SLA data, and carrying out matrix processing on the SLA data; detecting whether contour lines in the matrix SLA data are closed or not, and if the contour lines are closed, further detecting whether the closed contour lines conform to mesoscale vortex characteristics or not; if the mesoscale vortex characteristics are met, vortex properties are detected, vortex centers are obtained, and vortex data are stored; and detecting whether the mesoscale vortex has a vortex history or not, and if yes, realizing vortex history tracking. According to the invention, the accuracy and efficiency of vortex identification are improved, and the visualized display of vortex history is realized, so that scientific researchers can observe and analyze the dynamic evolution process of the vortex more conveniently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly discloses a method for mesoscale vortex identification and historical tracking based on Python. Background Art

[0002] Based on the obtained sea level anomaly (SLA) data, first, according to multiple significant sea level anomaly extreme points (these extreme points are usually the positions where the sea level changes most violently) as segmentation marks, the original SLA data set is segmented into multiple initial sea level anomaly splines. Each initial SLA spline represents a specific change pattern of the sea level within a certain time and space range. Subsequently, according to a series of preset screening conditions, such as the length, amplitude, and morphological stability of the splines, a detailed screening process is carried out on multiple initial SLA splines, aiming to eliminate those sea level change splines that do not conform to the vortex characteristics or may be caused by other factors, so as to obtain multiple first quasi-vortex SLA splines with preliminary vortex characteristics. Further, on the basis of the first quasi-vortex SLA splines, more stringent screening criteria are adopted, especially focusing on the vortex characteristics exhibited by the splines, such as the rotation direction, the closure of the vortex, and the duration, etc., and the splines that truly belong to the category of mesoscale vortices are screened out from them to obtain multiple second quasi-vortex SLA splines. Mesoscale vortices are an important dynamic phenomenon in the ocean, and their scales are between the synoptic scale and the microscale, and they have important impacts on ocean circulation, energy transfer, and biogeochemical cycles, etc. Finally, based on these selected multiple second quasi-vortex SLA splines, advanced algorithms and models are used to comprehensively analyze information such as the spatial distribution and intensity change of each spline to determine the precise vortex boundary and vortex center of the mesoscale vortex. The determination of the vortex boundary helps to understand the spatial range and influence area of the vortex, and the identification of the vortex center provides a key basis for in-depth study of the dynamic characteristics, evolution laws of the vortex, and its interaction with other ocean phenomena.

[0003] With the rapid development of computer networks and the continuous progress of information technology, using the front-end GIS (Geographic Information System) platform for visual display of data has become an inevitable development trend in the application fields of meteorological and ocean data. This trend not only promotes the intuitive expression of data but also greatly enhances the efficiency of data analysis and decision-making. However, although certain progress has been made in the exploration of mesoscale vortex identification and historical tracking in current research in the fields of meteorology and oceanography, related research is still mainly limited to the academic research stage using MATLAB.

[0004] Specifically, existing MATLAB programs can relatively accurately identify mesoscale eddies, and this achievement provides important analysis tools for scientific researchers. However, the application scenarios of these programs are relatively narrow and are currently mainly used for academic analysis, thesis writing, or tasks that require scientific researchers to manually update data regularly. Such an operation mode is not only inefficient but also unable to meet the current demand for rapid businessization in the front-end and back-end interaction environment, especially in scenarios where mesoscale eddies need to be identified in real-time based on sea surface height.

[0005] In addition, existing methods also cannot well visualize the vortex history, and there are certain limitations in observing the evolution process of the vortex history. This results in scientific researchers being unable to comprehensively and deeply understand the dynamic processes such as the generation, development, and dissipation of vortices, thus affecting the deeper understanding and prediction of meteorological and oceanographic phenomena. Summary of the Invention

[0006] The present invention provides a method for identifying and historically tracking mesoscale eddies based on Python, aiming to solve at least one defect existing in the prior art when identifying mesoscale eddies.

[0007] The present invention relates to a method for identifying and historically tracking mesoscale eddies based on Python, including the following steps:

[0008] Obtain SLA data;

[0009] Judge whether the SLA data is successfully loaded. If the SLA data is successfully loaded, then process the SLA data and matrixize the SLA data.

[0010] Detect whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, then further detect whether the closed contour lines conform to the characteristics of mesoscale eddies. If they conform to the characteristics of mesoscale eddies, then detect the vortex properties and obtain the vortex center, and store the vortex data.

[0011] Detect whether the mesoscale eddy has a vortex history. If it has a vortex history, then implement vortex history tracking.

[0012] Furthermore, the step of obtaining SLA data includes:

[0013] Write a Python script, which is used to regularly download SLA data at fixed time points from CMEMS.

[0014] Use the nc.Dataset() method to read the SLA data in the netCDF format and save the SLA data to the database.

[0015] Further, it is detected whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, it is further detected whether the closed contour lines conform to the characteristics of mesoscale vortices; if they conform to the characteristics of mesoscale vortices, the vortex properties are detected and the vortex center is obtained. In the step of storing vortex data, when using the plt.contour() method to generate a contour map, if it is detected that the input SLA data contains null values or NaN values, matplotlib will automatically ignore the regions in the SLA data that contain null values or NaN values.

[0016] Further, it is detected whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, it is further detected whether the closed contour lines conform to the characteristics of mesoscale vortices; if they conform to the characteristics of mesoscale vortices, the vortex properties are detected and the vortex center is obtained. In the step of storing vortex data, a distance threshold and a numerical difference threshold are set. If it is detected that the distance between two points in the contour lines of the SLA data is less than the set distance threshold and the difference in SLA values in the contour lines of the SLA data is also less than the set numerical difference threshold, it is considered that these two points in the contour lines are connected together, thereby determining that the contour lines are closed.

[0017] Further, it is detected whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, it is further detected whether the closed contour lines conform to the characteristics of mesoscale vortices; if they conform to the characteristics of mesoscale vortices, the vortex properties are detected and the vortex center is obtained. In the step of storing vortex data, when it is detected that both the scale and amplitude of the vortex conform to the characteristics of mesoscale vortices, the vortex is determined to be a mesoscale vortex.

[0018] Further, it is detected whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, it is further detected whether the closed contour lines conform to the characteristics of mesoscale vortices; if they conform to the characteristics of mesoscale vortices, the vortex properties are detected and the vortex center is obtained. In the step of storing vortex data, based on the distribution characteristics of sea level anomalies, an automated detection algorithm is developed for quickly identifying the properties of vortices:

[0019] The eddy kinetic energy of mesoscale vortices is obtained from the geostrophic velocity anomalies provided by satellite altimeters:

[0020]

[0021] where EKE is the eddy kinetic energy of mesoscale vortices, and U gos and V gos are the zonal and meridional components of the geostrophic flow anomaly respectively;

[0022] The vortex intensity represents the energy distribution of mesoscale vortices, which is defined as the average eddy kinetic energy divided by the vortex area and is related to the eccentricity and total decay ratio of mesoscale vortices:

[0023]

[0024] Among them, EI is the vorticity intensity, A is the vortex area, and R is the vortex radius;

[0025] The advection non-linearity measures the ability of mesoscale vortices to transport water bodies and substances, and is defined as the ratio of the rotation speed to the propagation speed of mesoscale vortices:

[0026] NL = U / c

[0027] Among them, NL is the advection non-linearity, U is the rotation speed of the mesoscale vortex, and c is the propagation speed of the mesoscale vortex.

[0028] Furthermore, it is detected whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, it is further detected whether the closed contour lines conform to the characteristics of mesoscale vortices; if they conform to the characteristics of mesoscale vortices, when detecting the vortex properties and obtaining the vortex center and storing the vortex data, in combination with the meridional and zonal ranges, the vortex center is obtained through the np.mean() method, and the longitude and latitude of the vortex center are written into a JSON file.

[0029] Furthermore, it is detected whether the mesoscale vortex has a vortex history. If there is a vortex history, when implementing the step of vortex history tracking, after using the JSON.load() method to read the previously stored JSON file, according to the date order, it is calculated backward from the current date, and the change data of the vortex center is analyzed to determine whether it is the same vortex.

[0030] Furthermore, after using the JSON.load() method to read the previously stored JSON file, according to the date order, calculating backward from the current date, and analyzing the change data of the vortex center to determine whether it is the same vortex includes the following steps:

[0031] Read the vortex data of the current date, and the vortex data includes the center position information of the vortex;

[0032] Set a judgment threshold X for the change range of the vortex center, and the judgment threshold X is used to determine whether the change range of the vortex center is within the acceptance range of the same vortex;

[0033] Query the database, retrieve the vortex data of the previous date from the database, and arrange them in reverse order of dates;

[0034] Compare the vortex center positions, and for each historical vortex record, calculate the distance between the current vortex center and the historical vortex center;

[0035] Judge whether it is the same vortex. If the calculated distance between the current vortex center and the historical vortex center is less than or equal to the set judgment threshold X, it is considered that the current vortex and the historical vortex belong to the same vortex;

[0036] If the historical record of the same vortex is found, continue to use this historical record as the benchmark and continue to trace back the historical records in the database until no qualified historical records can be found;

[0037] If the historical record of the same vortex cannot be found, stop tracing.

[0038] Further, if the historical vortex record of the same vortex cannot be found, after the step of stopping tracing, it includes:

[0039] Sort out the historical records of the same vortex traced and store or display them.

[0040] The beneficial effects achieved by the present invention are:

[0041] The present invention provides a method for mesoscale vortex identification and historical tracking based on Python, which includes obtaining SLA data; determining whether the SLA data is successfully loaded. If the SLA data is successfully loaded, then process the SLA data and matrixize the SLA data; detect whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, then further detect whether the closed contour lines conform to the mesoscale vortex characteristics; if they conform to the mesoscale vortex characteristics, then detect the vortex properties and obtain the vortex center, and store the vortex data; detect whether the mesoscale vortex has a vortex history. If there is a vortex history, then realize the vortex history tracking. The method for mesoscale vortex identification and historical tracking based on Python provided by the present invention constructs a fast, efficient and business-oriented method for mesoscale vortex identification and historical tracking on the basis of the powerful and flexible programming language Python. This method not only improves the accuracy and efficiency of vortex identification, but also realizes the visual display of vortex history, enabling scientific researchers to more conveniently observe and analyze the dynamic evolution process of vortices. This innovative achievement not only promotes the research progress in the fields of meteorology and oceanography, but also provides strong technical support for the rapid businessization of related services. Description of the Drawings

[0042] Figure 1 It is a schematic flowchart of an embodiment of a method for mesoscale vortex identification and historical tracking based on Python of the present invention. Detailed Embodiments

[0043] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the drawings of the specification and specific embodiments.

[0044] As Figure 1 shown, the first embodiment of the present invention proposes a method for mesoscale vortex identification and historical tracking based on Python, including the following steps:

[0045] Step S100: Obtain SLA data.

[0046] To obtain and process SLA (sea level anomaly) data, a Python script is written. This script will regularly download SLA data at fixed time points from CMEMS (Copernicus Marine Environment Monitoring Service), then use the nc.Dataset() method to read the SLA data in the netCDF format, and save it to the database.

[0047] Step S200: Determine whether the SLA data is successfully loaded. If the SLA data is successfully loaded, process the SLA data and matrixize the SLA data.

[0048] After the SLA data is successfully loaded, use a for loop to traverse the data according to the data range to create a longitude-latitude grid, and tile the SLA data into the grid to complete matrixization.

[0049] Step S300: Detect whether the contour lines in the matrixized SLA data are closed. If the contour lines are closed, further detect whether the closed contour lines conform to the characteristics of mesoscale eddies; if they conform to the characteristics of mesoscale eddies, detect the eddy properties and obtain the eddy center, and store the eddy data.

[0050] Use the plt.contour() method to form a contour map of the SLA (sea level anomaly) data.

[0051] When using the plt.contour() method to generate a contour map, if it is detected that the input SLA data contains null values or NaN values, matplotlib will automatically ignore the areas in the SLA data that contain null values or NaN values.

[0052] Set a distance threshold and a numerical difference threshold. If it is detected that the distance between two points in the contour lines of the SLA data is less than the set distance threshold and the SLA value difference in the contour lines of the SLA data is also less than the set numerical difference threshold, then it is considered that these two points in the contour lines are connected together, thereby determining that the contour lines are closed.

[0053] When it is recognized that both the scale and amplitude of the eddy conform to the characteristics of mesoscale eddies, then the eddy is judged as a mesoscale eddy.

[0054] Combined with the meridional and zonal ranges, obtain the eddy center through the np.mean() method, and write the longitude and latitude of the eddy center into a JSON file.

[0055] Step S400: Detect whether the mesoscale vortex has a vortex history. If there is a vortex history, then implement vortex history tracking.

[0056] After using the JSON.load() method to read the previously stored JSON file, calculate backward from the current date according to the date order, and analyze the change data of the vortex center to determine whether it is the same vortex.

[0057] Furthermore, for the mesoscale vortex identification and historical tracking method based on Python provided in this embodiment, step S100 includes:

[0058] Step S110: Write a Python script that is used to regularly download SLA data at fixed time points from CMEMS.

[0059] Write a Python script that will regularly download SLA data at fixed time points from CMEMS (Copernicus Marine Environment Monitoring Service).

[0060] Step S120: Use the nc.Dataset() method to read SLA data in the netCDF format and save the SLA data to the database.

[0061] Use the nc.Dataset() method to read SLA data in the netCDF format and save it to the corresponding database.

[0062] Preferably, for the mesoscale vortex identification and historical tracking method based on Python provided in this embodiment, in step S300, based on the distribution characteristics of sea level anomalies, develop an automated detection algorithm for quickly identifying the nature of the vortex:

[0063] The eddy kinetic energy of the mesoscale vortex is obtained from the geostrophic velocity anomaly provided by the satellite altimeter:

[0064]

[0065] In formula (1), EKE is the eddy kinetic energy of the mesoscale vortex, U gos and V gos are the zonal and meridional components of the geostrophic flow anomaly respectively;

[0066] The vortex intensity represents the energy distribution of the mesoscale vortex, which is defined as the average eddy kinetic energy divided by the vortex area and is related to the eccentricity and total decay ratio of the mesoscale vortex:

[0067]

[0068] In formula (2), EI is the vorticity intensity, A is the vortex area, and R is the vortex radius;

[0069] The advection non-linearity measures the ability of mesoscale vortices to transport water bodies and substances, and is defined as the ratio of the rotation speed to the propagation speed of mesoscale vortices:

[0070] NL = U / c (3)

[0071] In formula (3), NL is the advection non-linearity, U is the rotation speed of the mesoscale vortex, and c is the propagation speed of the mesoscale vortex.

[0072] Furthermore, the mesoscale vortex identification and historical tracking method based on python provided in this embodiment, step S400 includes:

[0073] Step S410, read the vortex data of the current date, and the vortex data includes the central position information of the vortex.

[0074] Read the vortex data of the current date: Use the JSON.load() method to read the JSON file of the current date, which contains the central position information of the current vortex.

[0075] Step S420, set the judgment threshold X for the change range of the vortex center, and the judgment threshold X is used to judge whether the change range of the vortex center is within the acceptance range of the same vortex.

[0076] Set the judgment threshold for the change range of the vortex center: Define a variable X (default is 12 kilometers), which is used to judge whether the change range of the vortex center is within the acceptance range of the same vortex.

[0077] Step S430, query the database, retrieve the vortex data of the previous date from the database, and arrange them in reverse order according to the date.

[0078] Query the database: Retrieve the vortex data of the previous date from the database, and arrange them in reverse order according to the date so as to trace back from the most recent day forward.

[0079] Step S440, compare the vortex center positions, and for each historical vortex record, calculate the distance between the current vortex center and the historical vortex center.

[0080] Compare the vortex center positions: For each historical vortex record, calculate the distance between the current vortex center and the historical vortex center. Here, geographical calculation methods such as the Haversine formula can be used to calculate the distance between two geographical coordinates.

[0081] Step S450, judge whether it is the same vortex. If the calculated distance between the current vortex center and the historical vortex center is less than or equal to the set judgment threshold X, then it is considered that the current vortex and the historical vortex belong to the same vortex.

[0082] Determine whether it is the same vortex: If the calculated distance is less than or equal to the set threshold X, it is considered that the current vortex and this historical record belong to the same vortex.

[0083] Step S460: If a historical record of the same vortex is found, continue to use this historical record as a reference and continue to trace back the historical records in the database forward until no eligible historical records can be found.

[0084] Continue tracing: If a historical record of the same vortex is found, continue to use this historical record as a reference and continue to trace back the records in the database forward until no eligible records can be found.

[0085] Step S470: If no historical record of the same vortex is found, stop tracing.

[0086] Stop tracing: If no eligible historical vortex record is found, stop tracing.

[0087] Step S480: Organize the historical records of the traced same vortex and store or display them.

[0088] Store and display the results: Organize the traced vortex historical information and store or display it for subsequent analysis and research.

[0089] As Figure 1 shown below, a specific embodiment is used to illustrate the mesoscale vortex identification and historical tracking method based on python provided by this application:

[0090] 1. Methods and steps for SLA data acquisition and processing

[0091] To obtain and process SLA (Sea Surface Anomaly Height) data, a Python script is written. This script will regularly download SLA data at fixed time points from CMEMS (Copernicus Marine Environment Monitoring Service), then use the nc.Dataset() method to read the SLA data in the netCDF format, and save it to the database.

[0092] 1.1. Main steps

[0093] 1) Set up a scheduled task

[0094] Use the scheduled task tool of the operating system (such as cron in Linux or Task Scheduler in Windows) to regularly run the Python script every day.

[0095] 2) Download SLA data

[0096] Download the SLA data at a specified time point from the CMEMS API or using the FTP service provided by it.

[0097] 3) Read netCDF data

[0098] Use the nc.Dataset() method in the netCDF4 library to read the downloaded SLA data.

[0099] 4) Check the longitude and latitude range

[0100] Extract the longitude and latitude information from the netCDF file and check if it meets the expected range.

[0101] 5) Process null values

[0102] Detect null values (such as NaN) in the SLA data and perform appropriate processing (such as filling or interpolation).

[0103] 6) Check data accuracy

[0104] Evaluate the spatial resolution of the SLA data and perform interpolation if the accuracy is insufficient.

[0105] 7) Save to the database

[0106] Save the processed SLA data to the database (such as PostgreSQL, MySQL, etc.).

[0107] After the data is successfully loaded, use a for loop to traverse the data according to the data range to create a longitude and latitude grid, and tile the data into the grid to complete matrixization.

[0108] 1.2, Python script implementation code

[0109] It covers most of the functions in the above steps (excluding setting up scheduled tasks and the actual download steps, as these two parts depend on external environments and tools).

[0110]

[0111]

[0112]

[0113]

[0114] 1.3, Precautions

[0115] Scheduled Task Setup: Ensure to use the operating system's scheduled task tool (such as cron or Task Scheduler) to run this script daily at a scheduled time.

[0116] Download SLA Data: The actual script should include steps to download SLA data from CMEMS, which can be done using API requests or FTP downloads.

[0117] Database Connection: Ensure to correctly configure the database connection parameters and adjust the data saving logic according to the actual database table structure.

[0118] Interpolation Method: Select a suitable interpolation method (such as linear interpolation, cubic interpolation, etc.) according to actual requirements.

[0119] Error Handling: Add necessary error handling logic to ensure that the script can correctly handle and report errors in case of exceptions.

[0120] 2. Detect Contour Lines

[0121] In the process of using the plt.contour() method to form a contour map of SLA (Sea Level Anomaly) data, a series of steps need to be taken to ensure the accuracy and effectiveness of the contour map. First, the contour data needs to be checked to determine if there are null values or invalid data. This usually occurs in certain areas, especially if vortices have been detected, because these vortex areas may be marked as null values or NaN (Not a Number) values during data processing, and these areas need to be skipped when drawing the contour map.

[0122] Specifically, when using plt.contour() to generate a contour map, if the input data contains null values or NaN values, matplotlib will automatically ignore these areas. However, to ensure the analysis is complete and accurate, it is necessary to preprocess this data before plotting. This means traversing the contour data and checking whether each contour level contains null values. If a contour line consists entirely of null values, then this contour line should be skipped and not participate in the final plotting process.

[0123] However, simply skipping null value contours is not sufficient to meet all requirements. In some cases, even if the contour is not entirely composed of null values, it may be broken due to the influence of vortices, resulting in an incomplete contour. To detect such situations, it is also necessary to determine whether the contour is closed by numerical distance in the remaining set of contours. The criterion for judging closure can be determined based on the actual distance and numerical difference between two points. For example, a distance threshold (such as 0.5 km) and a numerical difference threshold (e.g., the change range of the SLA value is less than a certain specific threshold) can be set. If the distance between two points is less than the set distance threshold and the difference in their SLA values is also less than the set numerical difference threshold, then these two points can be considered connected, and thus the contour is judged to be closed.

[0124] This method of judging closure allows for flexible handling of the influence of vortices of different scales and intensities on the contour closure. By adjusting the thresholds of distance and numerical difference, it can adapt to different datasets and analysis requirements. Generally speaking, this process ensures that when using the plt.contour() method to draw a contour map, the spatial distribution characteristics of the SLA data can be accurately displayed, while avoiding problems such as incomplete or misleading contours caused by complex phenomena such as vortices.

[0125] 3. Detect whether it conforms to the characteristics of mesoscale vortices

[0126] In oceanographic research, detecting mesoscale vortices is a crucial task, which helps to deeply understand the ocean dynamic process and energy conversion mechanism. When faced with a large amount of ocean data, especially sea surface height (SSH, SEA SURFACE HEIGHT) data, how to accurately extract and identify mesoscale vortices from it becomes a core challenge. The following is a detailed and systematic detection process, aiming to ensure the accurate identification of targets that conform to the characteristics of mesoscale vortices.

[0127] Previously, closed contours were extracted from the SSH data. This step is crucial because closed contours are often an important sign of the presence of vortices. Through advanced image processing techniques and algorithms, these contours can be automatically identified and extracted, laying the foundation for subsequent analysis.

[0128] After extracting the closed contours, the next task is to calculate the distance between these contours. The purpose of this step is to evaluate the scale of the vortex, including its meridional and zonal ranges. According to the definition and characteristics of mesoscale vortices, it is known that its radius is usually greater than 45 km. Therefore, 45 km is set as the default value to judge whether the vortex represented by the contour conforms to the scale characteristics of mesoscale vortices.

[0129] After confirming that the vortex scale conforms to the characteristics of mesoscale vortices, it is necessary to further determine whether its amplitude meets the requirements. Amplitude is an important indicator to measure the intensity of a vortex and is usually reflected by the extreme value of SSH. Here, a default SSH height value of 3 cm is set as the basis for judging whether the amplitude reaches the mesoscale vortex standard. If the extreme value of SSH of a certain vortex is less than this set value, it will be excluded from the mesoscale vortices. Only when both the scale and amplitude of the vortex conform to the characteristics of mesoscale vortices can it be judged as a mesoscale vortex. Once a mesoscale vortex is identified, the original data matrix needs to be updated by removing the identified vortex range from the matrix. This step is to avoid subsequent repeated identification, ensure that each vortex is detected only once, and thus improve the accuracy and efficiency of the entire detection process.

[0130] 4. Detect Vortex Properties

[0131] By analyzing and calculating the positive and negative values of SLA (Sea Level Anomaly), the properties of vortices can be effectively examined. In oceanography, the properties of vortices are crucial for understanding ocean circulation and dynamic processes. Specifically, the vortex center of an anticyclonic vortex usually shows a lower sea level because the water body in the central region of the anticyclonic vortex diverges to the surrounding areas, resulting in a relatively lower sea level in the central region. On the contrary, the vortex center of a cyclonic vortex usually shows a higher sea level because the water body in the central region of the cyclonic vortex converges from the surrounding areas to the center, resulting in a relatively higher sea level in the central region.

[0132] Based on this distribution characteristic of sea level anomaly, an automated detection algorithm is developed for quickly identifying the properties of vortices:

[0133] Among them, the Eddy Kinetic Energy (EKE) of mesoscale vortices is obtained from the geostrophic velocity anomaly provided by satellite altimeters:

[0134]

[0135] In the formula: Ugos and Vgos are the zonal and meridional components of the geostrophic velocity anomaly respectively.

[0136] Vortex Intensity (EI) represents the energy distribution of mesoscale vortices and is defined as the average eddy kinetic energy divided by the vortex area (A), which is related to the eccentricity and total decay ratio of mesoscale vortices:

[0137]

[0138] In the formula: R is the radius of the vortex.

[0139] The advection nonlinearity can measure the ability of mesoscale eddies to transport water and substances, and is defined as the ratio U / c of the rotation speed (U) and the propagation speed (c) of the mesoscale eddy, where U is the maximum average geostrophic flow velocity at the edge of the mesoscale eddy. When U / c > 1, it indicates that the mesoscale eddy has nonlinear characteristics. The larger the ratio, the higher the degree of nonlinearity, representing a stronger transport ability of the mesoscale eddy.

[0140] Once the nature of the vortex is detected, it can be classified and marked with different labels. For the convenience of subsequent data processing and analysis, these labels can be stored and transmitted in JSON data format. In JSON data, a field named "type" can be set to represent the type of the vortex. If the vortex is identified as a cyclonic vortex, the value of the "type" field is set to 1; if the vortex is identified as an anticyclonic vortex, the value of the "type" field is set to -1.

[0141] This processing method not only makes the detection of vortex properties more efficient and accurate, but also provides convenience for subsequent data analysis and scientific research. By systematically collecting, processing, and storing these vortex property data, we can gain a deeper understanding of the distribution characteristics, evolution laws of ocean vortices, and their impact on the ocean environment, providing strong support for the development of ocean science and the exploitation of ocean resources.

[0142] 5. Obtain the vortex center

[0143] The vortex center is obtained through the np.mean() method combined with the meridional and zonal ranges obtained above, and the longitude and latitude of the vortex center are written into a JSON file. To describe this process in more detail, it can be decomposed into several steps, and each step of the operation is explained in detail.

[0144] First, the meridional (longitude) and zonal (latitude) ranges of the vortex need to be obtained through some means (possibly meteorological data, satellite image analysis, or other methods). These ranges usually represent the expansion of the vortex in the geographical space and are an important basis for determining the position of the vortex center. Next, the np.mean() method in the NumPy library will be used to calculate the longitude and latitude of the vortex center. The np.mean() method is a powerful tool that can calculate the average value of a given array. In this scenario, the longitude values and latitude values of the vortex can be stored in two arrays respectively, and then the np.mean() method is applied to these arrays respectively to obtain the average longitude and average latitude, which can approximately represent the center position of the vortex.

[0145] The specific steps are as follows:

[0146] Obtain the longitude and latitude data of the vortex: This may involve reading the longitude and latitude information of the vortex from meteorological data files, databases, or real-time data sources, and storing this information in an appropriate data structure, such as a list or a NumPy (Numerical Python) array.

[0147] Calculate the average longitude and latitude: Use the np.mean() method to calculate the average values of the longitude array and the latitude array respectively. These two average values will be used as the longitude and latitude of the vortex center.

[0148] Prepare the JSON file: Create a new JSON file to store the longitude and latitude information of the vortex center. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and also easy for machines to parse and generate.

[0149] Write to the JSON file: Write the longitude and latitude information of the vortex center to the JSON file in the form of key-value pairs. For example, a dictionary containing the keys "longitude" and "latitude" can be created, and the calculated average longitude and average latitude are used as the values of these keys. Then, use the JSON module in Python to write this dictionary to the file. Through the above steps, it is possible to use the np.mean() method in combination with the obtained meridional and zonal ranges of the vortex to determine the center position of the vortex, store it by date and location, and store this information in JSON format for subsequent analysis or visualization.

[0150] 6. Detect the vortex history

[0151] After using the JSON.load() method to read the previously stored JSON file, calculate backward from the current date according to the date order, and analyze the change data of the vortex center to determine whether it is the same vortex. In this process, a judgment threshold X (default is 12 kilometers) needs to be set. If the change range of the vortex center is less than this threshold, it is regarded as the same vortex. To implement this function, it is necessary to ensure that the vortex data of the previous date is available, and this data needs to be stored in a certain form of database (such as relational databases like SQLite, MySQL, or non-relational databases like MongoDB). In the database, the records of each vortex should contain key information such as the center position (longitude and latitude coordinates), date, and timestamp of the vortex.

[0152] The specific steps are as follows:

[0153] Read the vortex data of the current date: Use the JSON.load() method to read the JSON file of the current date, which contains the center position information of the current vortex.

[0154] Set the threshold for the range of vortex center changes: Define a variable X (default value is 12 kilometers) to determine whether the range of vortex center changes is within the acceptable range of the same vortex.

[0155] Query the database: Retrieve the vortex data of previous dates from the database and sort them in reverse chronological order to trace back from the most recent day.

[0156] Compare the positions of vortex centers: For each historical vortex record, calculate the distance between the current vortex center and the historical vortex center. Geographic calculation methods such as the Haversine formula can be used here to calculate the distance between two geographic coordinates.

[0157] Determine whether it is the same vortex: If the calculated distance is less than or equal to the set threshold X, it is considered that the current vortex and this historical record belong to the same vortex.

[0158] Continue tracing: If a historical record of the same vortex is found, continue to use this historical record as a reference and continue to trace back the records in the database until no eligible records are found.

[0159] Stop tracing: If no eligible historical vortex records are found, stop tracing.

[0160] Store and display the results: Organize the traced vortex historical information and store or display it for subsequent analysis and research.

[0161] Note that the implementation of this function depends on the integrity and accuracy of the previous vortex data. At the same time, appropriate database query and optimization techniques are required to improve the processing efficiency and accuracy. In practical applications, complex situations such as data exception handling, multi-threaded processing, or distributed computing may also need to be considered.

[0162] 7. Implement vortex historical tracking

[0163] Store the vortex data numbered (6) in JSON (JavaScript Object Notation) format in chronological order or a specific format. This process aims to construct a historical path record of the vortex. This record does not rely on any database storage but is directly generated and returned dynamically based on the real-time incoming data. This processing method allows the system to immediately reflect the movement trajectory of the vortex without going through intermediate links such as data storage and query in the database, thus improving the timeliness and flexibility of data processing. In practical applications, whenever new vortex position data is received, the system will integrate it into the JSON structure according to the existing data set to ensure the continuity and integrity of the historical path. In this way, users can quickly obtain the latest dynamics and complete movement history of the vortex, providing strong data support for disaster warning, meteorological analysis, and other work.

[0164] 8. Visualization Implementation

[0165] Front-end part: Based on the powerful open-source JavaScript library Leaflet, a complex and feature-rich meteorological data visualization project is implemented. This project aims to receive the date and specific longitude and latitude data input by users through the front-end page and then send this data to the back-end server for processing. After receiving this data, the back-end server will call the recognition program (the program number is 1-7, which is specifically responsible for data processing), and this program will further retrieve SLA (Sea Level Anomaly) data related to this date and geographical location from the database.

[0166] SLA data is crucial in oceanography for describing the height change of the sea surface relative to the mean sea level and is essential for analyzing ocean phenomena such as mesoscale eddies (mesoscale eddies are an important dynamic process in the ocean, with significant horizontal and vertical structural characteristics and having important impacts on ocean circulation, heat exchange, and the ecosystem). The back-end server will perform a series of complex algorithmic processes on this SLA data to identify the mesoscale eddies present in this area and encapsulate the relevant information of these eddies (such as the longitude and latitude coordinates, amplitude, radius, etc. of the eddies) in JSON format and return it to the front-end. On the front-end, Leaflet will use these returned longitude and latitude data to dynamically construct the surface elements (polygons or other shapes) of mesoscale eddies on the map and set different color fills according to the cold and warm properties of the eddies (cold eddies usually show negative SLA values, while warm eddies show positive SLA values), for example, cold eddies are represented by blue and warm eddies are represented by red. This color-coded presentation method is not only intuitive and easy to understand but also can effectively convey the properties and intensity information of the eddies.

[0167] Furthermore, we add click event listeners to these eddy surface elements. When the user clicks on a certain eddy surface, the front-end will pop up an information box or sidebar to display the detailed parameter information of this eddy, including but not limited to the amplitude of the eddy (representing the intensity of the eddy), the radius (representing the coverage range of the eddy), and the exact position of the eddy center. This information is valuable data for meteorologists and oceanographers to conduct in-depth research and analysis. More advanced is that when the user clicks on the eddy center position, the front-end will trigger another event processing process to request and obtain the historical trajectory data of this eddy from the back-end. These data include the records of the amplitude and radius changes of the eddy over a certain period in the past (such as the past few days, weeks, or even months). Subsequently, the front-end uses the powerful open-source chart library ECharts to display these historical data in the form of charts, such as line charts or area charts, to visually present the historical change trends of the eddy amplitude and radius.

[0168] In this way, users can not only intuitively see the vortex distribution and properties at the current moment, but also track the evolution process of vortices through the visualization of historical data, and deeply understand their dynamic characteristics and influence mechanisms. This comprehensive visualization method not only greatly improves the efficiency and accuracy of data interpretation, but also provides strong support for scientific research and prediction in the fields of meteorology and oceanography.

[0169] In traditional MATLAB programs, when conducting mesoscale vortex identification, researchers or analysts usually need to manually import SLA (sea surface height anomaly) data files. This process is cumbersome and inefficient because it requires users to operate separately for each specific date, and only one vortex identification map corresponding to the date can be generated each time the program runs. After the map is generated, if users need to view data for other dates, they have to manually change the data source and re-run the program, which is not only time-consuming and laborious, but also greatly limits the timeliness and flexibility of data processing. In addition, when faced with a large number of SLA data sets that need to be imported and analyzed in batches, the traditional MATLAB processing method appears particularly clumsy. It lacks the ability of automated batch processing and cannot effectively meet the requirements of rapid analysis and visualization of large-scale data, thus making it difficult to meet the urgent requirements of scientific research and real-time monitoring.

[0170] To solve these problems, the present invention proposes an innovative solution. This solution can not only realize the timed automatic download and update of publicly available SLA data on the network, ensuring the timeliness and accuracy of the data, but also provides a user-friendly web interaction interface. Through this interface, users can access and view vortex data at any historical time point at any time, without the need for cumbersome manual operations.

[0171] More importantly, the present invention can real-time identify key parameters such as the position, amplitude, and radius of vortices, and can track the historical trajectories of vortices. These functions not only greatly improve the depth and breadth of data analysis, but also provide strong assistance for the judgment of sea conditions and meteorology. Users can overlay vortex data on various layers as needed, such as ocean current fields, temperature fields, salinity fields, etc., so as to more comprehensively understand the dynamic changes of the ocean environment.

[0172] In addition, the web interface of the present invention is beautifully designed and easy to operate, and can be compatible with different front-end WebGIS engines. This means that users can choose different display platforms and output formats according to their own needs and preferences to achieve various display effects. This high degree of flexibility and customizability makes the present invention have broad application prospects in the fields of ocean science research, meteorological forecasting, ocean resource development, etc.

[0173] In summary, the present invention greatly improves the efficiency and accuracy of mesoscale vortex identification by realizing the automatic download and update of network data, providing a friendly web interaction interface, and real-time vortex identification and trajectory tracking functions, providing strong support for the monitoring and research of the marine environment.

[0174] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention. Obviously, those skilled in the art can make various changes and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims

1. A mesoscale eddy identification and history tracking method based on Python, characterized in that: The following steps are involved: Get SLA data; Determine whether the SLA data is loaded successfully, and if the SLA data is loaded successfully, process the SLA data and matrix the SLA data; Detect whether the contour lines in the matrixed SLA data are closed. If the contour lines are closed, further detect whether the closed contour lines meet the characteristics of the mesoscale eddy. If the characteristics of the mesoscale vortex are met, the vortex properties are detected, the vortex center is obtained, and the vortex data is stored; Detect whether the mesoscale vortex has a vortex history. If so, vortex history tracking is achieved.

2. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 1, characterized in that: The step of obtaining SLA data includes: Write a Python script, which is used to periodically download SLA data at a fixed time point from CMEMS; The SLA data in the netCDF format is read using the nc.Dataset() method, and the SLA data is saved in the database.

3. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 1, characterized in that: The step of detecting whether the contour lines in the matrixed SLA data are closed, and if the contour lines are closed, further detecting whether the closed contour lines meet the characteristics of the mesoscale vortex; If it meets the characteristics of a mesoscale vortex, the vortex properties are detected and the vortex center is obtained. In the step of storing the vortex data, when the plt.contour() method is used to generate a contour map, if it is detected that the input SLA data contains null values ​​or NaN values, matplotlib will automatically ignore the area containing null values ​​or NaN values ​​in the SLA data.

4. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 3, characterized in that: The step of detecting whether the contour lines in the matrixed SLA data are closed, and if the contour lines are closed, further detecting whether the closed contour lines meet the characteristics of the mesoscale vortex; If it meets the characteristics of the mesoscale vortex, the vortex properties are detected and the vortex center is obtained. In the step of storing the vortex data, a distance threshold and a numerical difference threshold are set. If it is detected that the distance between two points in the contour line of the SLA data is less than the set distance threshold and the SLA value difference in the contour line of the SLA data is also less than the set numerical difference threshold, it is considered that the two points in the contour line are connected together, thereby judging that the contour line is closed.

5. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 4, characterized in that: The step of detecting whether the contour lines in the matrixed SLA data are closed, and if the contour lines are closed, further detecting whether the closed contour lines meet the characteristics of the mesoscale vortex; If it meets the characteristics of a mesoscale vortex, the vortex properties are detected and the vortex center is obtained. In the step of storing the vortex data, when it is detected that the scale and amplitude of the vortex meet the characteristics of a mesoscale vortex, the vortex is judged to be a mesoscale vortex.

6. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 5, characterized in that: The step of detecting whether the contour lines in the matrixed SLA data are closed, and if the contour lines are closed, further detecting whether the closed contour lines meet the characteristics of the mesoscale vortex; If the mesoscale vortex characteristics are met, the vortex properties are detected and the vortex center is obtained. In the step of storing the vortex data, an automated detection algorithm is developed based on the distribution characteristics of the sea level guide constant to quickly identify the properties of the vortex: The eddy kinetic energy of the mesoscale eddy is obtained from the geostrophic velocity anomaly provided by the satellite altimeter: Where EKE is the eddy kinetic energy of the mesoscale eddy, U gos and V gos are the latitudinal and meridional components of geostrophic current anomalies, respectively; The eddy strength represents the energy distribution of the mesoscale eddy, which is defined as the average eddy kinetic energy divided by the eddy area and is related to the eccentricity and total decay ratio of the mesoscale eddy: Where, EI is the vortex intensity, A is the vortex area, and R is the vortex radius; The advection nonlinearity measures the ability of mesoscale eddies to transport water and matter, and is defined as the ratio of the rotation speed and propagation speed of the mesoscale eddies: NL=U / c Among them, NL is the advection nonlinearity, U is the rotation speed of the mesoscale eddy, and c is the propagation speed of the mesoscale eddy.

7. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 6, characterized in that: The step of detecting whether the contour lines in the matrixed SLA data are closed, and if the contour lines are closed, further detecting whether the closed contour lines meet the characteristics of the mesoscale vortex; If it meets the characteristics of a mesoscale vortex, the vortex properties are detected and the vortex center is obtained. In the step of storing the vortex data, the vortex center is obtained by the np.mean() method in combination with the longitude and latitude ranges, and the longitude and latitude of the vortex center are written into a JSON file.

8. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 7, characterized in that: The detection of whether the mesoscale vortex has a vortex history, if there is a vortex history, then in the step of implementing vortex history tracking, after using the JSON.load() method to read the previously stored JSON file, calculate from the current date forward according to the date sequence, and analyze the change data of the vortex center to determine whether it is the same vortex.

9. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 8, characterized in that: After reading the previously stored JSON file using the JSON.load() method, the steps of calculating from the current date forward according to the date sequence and analyzing the change data of the vortex center to determine whether it is the same vortex include: Reading vortex data of the current date, wherein the vortex data includes central position information of the vortex; Setting a judgment threshold X of the vortex center variation range, wherein the judgment threshold X is used to judge whether the variation range of the vortex center is within the acceptance range of the same vortex; Query the database, retrieve the vortex data of previous dates from the database, and arrange them in reverse order of date; Compare the vortex center positions, and for each historical vortex record, calculate the distance between the current vortex center and the historical vortex center; Determine whether they are the same vortex. If the calculated distance between the center of the current vortex and the center of the historical vortex is less than or equal to the set judgment threshold X, then it is considered that the current vortex and the historical vortex belong to the same vortex; If a historical record of the same vortex is found, the historical record is used as a benchmark to continue tracing back the historical records in the database until no historical record that meets the conditions is found; If no historical records matching the same vortex are found, the tracing process stops.

10. The mesoscale vortex identification and history tracking method based on Python as claimed in claim 9, characterized in that: If the historical vortex record that matches the same vortex cannot be found, the step of stopping tracing includes: The historical records traced back to the same vortex are organized and stored or displayed.