jfaghm / OceanEddies

A collection of algorithms to autonomously identify and track mesoscale ocean eddies in sea surface height (SSH) satellite data
92 stars 51 forks source link

Beginner Issues #9

Closed utong closed 7 years ago

utong commented 7 years ago

Hi, I am planning to use OceanEddies tools for my study area on the east coast of Queensland, Australia (152 - 156 E; 24 - 28 S). For your information, I have three-dimensional SSHa (lon,lat,time) for every second-day data from January 1993 - December 2016 with 0.25 degree resolution. I save the ssh files in the mat files with the structure below:

  1. SSH (26x31x5469 double)
  2. Lat (31x1 single)
  3. Lon (26x1 single)
  4. Time (5469x1 double)
  5. I create the area_map using generate_area_map function with the output: area_map (31x1 double).
  6. Change the dimension of SSH using permute function with the output now: SSHed (31x26x5469).

Since all inputs all there, I run the single_scan eddy function to with the script below: cyc_eddies = scan_single(SSHed(:,:,:), Lat, Lon, Time, 'cyclonic', 'v2',area_map); And the result is: Matrix dimensions must agree. Error in scan_single (line 24) if ~all(size(ssh) == [length(lat) length(lon)])

However when I run the single_scan eddy again for one particular time (e.g. day 5): cyc_eddies = scan_single(SSHed(:,:,5), Lat, Lon, Time(5), 'cyclonic', 'v2',area_map); the result is:

Warning: Name is nonexistent or not a directory: lib

In path (line 109) In addpath (line 88) In scan_single (line 38) Subscript indices must either be real positive integers or logicals.

Error in bottom_up_single (line 86) sshExtended = [ssh_data(:, end-199:end), ssh_data(:, :), ssh_data(:, 1:200)];

Error in scan_single (line 43) eddies = bottom_up_single(ssh, lat, lon, areamap, ctype, varargin{:});

Could you please help me solve this issues.

Thank you

lematt1991 commented 7 years ago

Hi @utong, the scan_single function is used to identify all eddies within a single time stamp, so: cyc_eddies = scan_single(SSHed(:,:,:), Lat, Lon, Time, 'cyclonic', 'v2',area_map); fails as expected as you are passing in data for all time stamps.

The error that you are receiving is due to the comment here. There is an issue that we encounter when processing eddies for the entire world in that you find a bunch of duplicate eddies that are at the edge of the map where the world wraps around. To sidestep this problem we pad one side of the world with a strip from the opposite side of the world. Since you are are only processing a small subset of the world, you will want to disable padding. You can do this by running:

cyc_eddies = scan_single(SSHed(:,:,5), Lat, Lon, Time(5), 'cyclonic', 'v2',area_map, 'isPadding', false);

The documentation is admittedly bad, and I'll be sure to update it shortly.

Hope this helps.

lematt1991 commented 7 years ago

Docs have been added here

utong commented 7 years ago

Hi @ml9951, Thank you for the detailed information. The scan_single function is running now even though there are some warning like this: Warning: Name is nonexistent or not a directory: lib

In path (line 109) In addpath (line 88) In scan_single (line 38)

I have further question regarding the input of the SSH data. Should I convert the unit of my SSH data from meter to centimeter? Another question is I am running the scan_multi function using the same input with the scan_sincle function with more time step and adding destination directory into the input:

cyc_multieddies = scan_multi(SSHed(:,:,5:9), Lat, Lon, Time(5:9), 'cyclonic', 'v2',area_map, 'E:\Data\' ,'isPadding', false);

And I got an error message below: _Error using scanmulti Too many output arguments

Is there something with the input for the scan_multi that I have to modify?

Best regards, Utong

lematt1991 commented 7 years ago

The scan_single function is running now even though there are some warning like this:


Warning: Name is nonexistent or not a directory: lib

In path (line 109) In addpath (line 88) In scan_single (line 38)



That's strange, I'm not seeing these warnings on my end.  What directory are you calling the function from?  Try executing from inside the `eddyscan` directory, or else add the `eddyscan` directory to your path.  If there aren't any errors though it shouldn't be a problem, `addpath` simply brings files into scope, so if no errors are triggered you should be OK either way.

> Should I convert the unit of my SSH data from meter to centimeter?

Yes, the functions expect SSH data to be in centimeters, but this should be an easy transformation

> And I got an error message below:
Error using scan_multi
Too many output arguments
Is there something with the input for the scan_multi that I have to modify?

The `scan_multi` function [doesn't actually return anything](https://github.com/jfaghm/OceanEddies/blob/master/eddyscan/scan_multi.m#L28), it simply saves the results to disk.  I'll add documentation for this as well.
utong commented 7 years ago

What directory are you calling the function from? Try executing from inside the eddyscan directory, or else add the eddyscan directory to your path. If there aren't any errors though it shouldn't be a problem.

I was calling the scan_single function inside the eddyscan directory without no errors now :-).

Another question is I still have output errors when I run the scan_multi function below:

cyc_multieddies = scan_multi(SSHed(:,:,5:9), Lat, Lon, Time(5:9), 'cyclonic', 'v2',area_map, 'E:\Data','isPadding', false);

and

cyc_multieddies = scan_multi(SSHed(:,:,5:9), Lat, Lon, Time(5:9), 'cyclonic', 'v2',area_map, 'E:\Data\ ','isPadding', false);

The output errors message is: Error using scan_multi Too many output arguments

I think this is related to the destination directory to save eddies (destdir) in the input format. Could you please give an example of the destination directory input template as well. For your information, I am using Matlab in Windows 10 environment.

lematt1991 commented 7 years ago

The error is because you are trying to get a return value from scan_multi, but it doesn't return anything. You should instead call it like:

scan_multi(SSHed(:,:,5:9), Lat, Lon, Time(5:9), 'cyclonic', 'v2',area_map, 'E:\Data\','isPadding', false);

Notice I'm not trying to get a return value. Instead, the results will be written to a .mat file on disk.