Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using along track satellite data #170

Open
hanyangliu1002 opened this issue Sep 23, 2022 · 11 comments
Open

Using along track satellite data #170

hanyangliu1002 opened this issue Sep 23, 2022 · 11 comments

Comments

@hanyangliu1002
Copy link

hanyangliu1002 commented Sep 23, 2022

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.

@AntSimi
Copy link
Owner

AntSimi commented Sep 24, 2022

You must use unregulargrid class for swath data

@hanyangliu1002
Copy link
Author

hanyangliu1002 commented Sep 26, 2022

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
Copy link
Author

hanyangliu1002 commented Sep 27, 2022

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

@AntSimi
Copy link
Owner

AntSimi commented Sep 28, 2022

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.

@hanyangliu1002
Copy link
Author

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.

@AntSimi
Copy link
Owner

AntSimi commented Oct 7, 2022

It must work

@hanyangliu1002
Copy link
Author

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.

@AntSimi
Copy link
Owner

AntSimi commented Nov 15, 2022

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

@hanyangliu1002
Copy link
Author

hanyangliu1002 commented Nov 15, 2022

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

@AntSimi
Copy link
Owner

AntSimi commented Nov 28, 2022

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

@hanyangliu1002
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants