py-eddy-tracker icon indicating copy to clipboard operation
py-eddy-tracker copied to clipboard

Using along track satellite data

Open hanyangliu1002 opened this issue 3 years ago • 11 comments

I downloaded the simulated SWOT data from AVISO. The data is along the track. I used the PET method to detect the eddy, but it could not be carried out. The returned error shows that the latitude and longitude can only be 1D array. longitude and latitude of the simlated SWOT data is 2D array., is there any way to fix it , thanks.

hanyangliu1002 avatar Sep 23 '22 06:09 hanyangliu1002

You must use unregulargrid class for swath data

AntSimi avatar Sep 24 '22 11:09 AntSimi

I provide my code for you to check. The error finally shows is as follows (Using unregulargidDataset).

Traceback (most recent call last): File "x:\MasterStudent_HY\Some data\Simulated SWOT data\Step1_identification.py", line 24, in shape_error=55, # Error max (%) between ratio of circle fit and contour TypeError: eddy_identification() missing 1 required positional argument: 'date'

Besides, the SWOT simulated data does not have the two parameters of u and v. Could this be the reason?

code.txt

hanyangliu1002 avatar Sep 26 '22 03:09 hanyangliu1002

the data information is as following : The simulated SWOT data information.txt

hanyangliu1002 avatar Sep 27 '22 03:09 hanyangliu1002

If you take look at the API doc, you could see that u field and v field are mandatory. There is no builtin method to compute U/V field on non cartesian grid. It's something to improve.

AntSimi avatar Sep 28 '22 13:09 AntSimi

If I calculate the u and v parameters and put them in the original altimetry file(nc file), will I be able to do the eddy identification.

hanyangliu1002 avatar Oct 07 '22 04:10 hanyangliu1002

It must work

AntSimi avatar Oct 07 '22 10:10 AntSimi

Dear @AntSimi

I recently calculated the two geostrophic velocity components of u and v, and saved them to the nc file. The program seems to be able to work, but the following error message appears. How can I fix it?

IndexError: index 3155 is out of bounds for axis 0 with size 2

thank you

H.Y.

hanyangliu1002 avatar Nov 11 '22 09:11 hanyangliu1002

To investigate, we need information to repoduce your problem (i. e. code and data).

AntSimi avatar Nov 15 '22 12:11 AntSimi

Dear @AntSimi

data as following : SWOT_L2_LR_SSH_Expert_266_008_20150101T003140_20150101T012245_DG10_01.nc.zip

and code :

grid_name, lon_name, lat_name = (
    "X:\MasterStudent_HY\Some data\Simulated SWOT data\SWOT_L2_LR_SSH_Expert_266_008_20150101T003140_20150101T012245_DG10_01.nc",
    "longitude",
    "latitude",
)

from datetime import datetime
from py_eddy_tracker.dataset.grid import UnRegularGridDataset
from matplotlib import pyplot as plt

h = UnRegularGridDataset(grid_name, lon_name, lat_name,)

date = datetime(2015,1,1)

a, c = h.eddy_identification (
    'ssha_karin', 'ugosa', 'vgosa', # Variables used for identification
    date, # Date of identification
    0.002, # step between two isolines of detection (m) 
    pixel_limit=(8, 1000), # Min and max pixel count for valid contour 
    shape_error=70, # Error max (%) between ratio of circle fit and contour
    )

fig = plt.figure(figsize=(15,7))
ax = fig.add_axes([.03,.03,.94,.94])
ax = fig.add_subplot(1, 1, 1)
ax.set_title('Eddies detected -- Cyclonic(red) and Anticyclonic(blue)')
ax.set_ylim(-5,35)
ax.set_xlim(105,135)
ax.set_aspect('equal')
a.display(ax, label="Anticyclonic ({nb_obs} eddies)",color='b', linewidth=1)
c.display(ax, label="cyclonic ({nb_obs} eddies)",color='r', linewidth=1)
ax.legend(loc="upper left") 
ax.grid()
print(a, c)

many thanks

hanyangliu1002 avatar Nov 15 '22 13:11 hanyangliu1002

When i take a look at ssha_karin i didn't see mesoscale signal? ugosa and vgosa haven't same dimensions in netcdf than ssha_karin

AntSimi avatar Nov 28 '22 16:11 AntSimi

The matrix size of ugosa and vgosa I calculated should be the same as the size of ssha_karin. I would like to ask how to solve the problem of dimension

hanyangliu1002 avatar Feb 07 '23 05:02 hanyangliu1002