hannnwang / Anisotropic-Helmholtz-decomposition-for-Lagrangian-data

Synthetic examples and data codes that conduct Helmholtz decomposition in Lagrangian data allowing for anisotropy
2 stars 0 forks source link

How to generate mat files #1

Open dhruvbalwada opened 3 years ago

dhruvbalwada commented 3 years ago

Hi Han,

Thanks for creating this repo. It is always great to be able to see the codes that go with the paper, since they are so essential.

I noticed that in your codes you are using LASER.mat files to access the LASER data. I am wondering, where is the script that converts from the .dat file that is available on the CARTHE website to the *.mat files?

hannnwang commented 3 years ago

Hi Dhruv,

Thank you for taking interest in this! I will look into it and get back to you by the end of this week.

Best, Han

On Mon, Mar 1, 2021 at 1:22 AM Dhruv Balwada notifications@github.com wrote:

Hi Han,

Thanks for creating this repo. It is always great to be able to see the codes that go with the paper, since they are so essential.

I noticed that in your codes you are using LASER.mat files to access the LASER data. I am wondering, where is the script that converts from the .dat file that is available on the CARTHE website to the *.mat files?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hannnwang/Anisotropic-Helmholtz-decomposition-for-Lagrangian-data/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGRLBYPCBLG5DTFH5BHJXDTBMXCPANCNFSM4YL7IVUQ .

hannnwang commented 3 years ago

To answer your question, the corresponding code is dataformating_all.m. I just added some instructions in that file.

This makes me realize how poorly illustrated this folder is. You'd still encounter significant confusions in other codes here. I will add more explanations this week. The synthetic folder is clearer, but I understand the need to directly look at the codes on real data.

dhruvbalwada commented 3 years ago

Thanks for adding the comments Hann! They are very helpful, and I am mostly able to run the code.

I have a question. It seems to me like you end up using all the drifter data, and not just the drifters with codes "L". Was that on purpose? Or did you remove the drifters with codes "U/V/M" (mostly the undrogued drifters) before this code is used?

hannnwang commented 3 years ago

Glad that you figured it out.

And thank you spotting that issue -- I just checked and it's a negligence on my side. I misunderstood the data description, assuming that all the undrogued drifters are already left out. I didn't see the last lines in the Readme under the LASER_SPOT.zip that explains what the letters U/V/M mean.

That means a lot of the results in the paper include the undrogued drifters too.

We did not intend to include the undrogued data, as the undrogued drifters may not be on the same horizontal level as the drogued ones.

I think this may be a serious problem -- what do you think? I may contact the editors to issue a correction about this.

dhruvbalwada commented 3 years ago

Apart from being at a different level (undrogued drifters track the top few cm), they are also moving due to direct impact of wind on the object. However, I would not assume directly that it is actually that serious a problem (likely would not change results qualitatively). This is because I read (I think in the Novelli et al 2017) that the impact of the wind is only 2%, which may or may not be big. Best to just check, rather than assume.

I have setup the code and have been able to calculate the global statistics (not the anisotropic decomposition but the longitudinal and transverse SF2) so far, and they qualitatively look quite similar to what I would expect based on your global results.

If you can guide me to the code where you divide the data into the 4 sets, I can use the same method to divide only the drogued data and check if things look very different. If they do then you can do a correction, but if things don't change then it's probably not worth it.

P.S. : I did change the algorithm from what I had many years ago (and sort of what your code seems to be loosely based on) quite drastically, and can now run the full calculation of structure functions for both GLAD and LASER in less than 10minutes on my laptop. I can share it with you when it is a bit further along if you would like.

hannnwang commented 3 years ago

Agree on the wind impact, and that it's best to just check.

I updated the folder with a little more captions, and the code that defines the four sub-regions are in circlespec.m. A convenient way to use the specification in circlespec.m is this:

Radius_test=sqrt((converted_X-center_x).^2+(converted_Y-center_y).^2); trajmat_U(Radius_test>radius)=NaN; trajmat_V(Radius_test>radius)=NaN;

where converted_X and converted_Y are the x and y coordinates converted from the longitude and latitudes data, using your favorite transform.

It will be really helpful if you could help me check this! I don't have access to Matlab at my current institute.

P.S. I'm interested in your new version of structure function codes! If I recall correctly, my version also just takes minutes to run, but it consumes an awful amount of memory for the LASER data. But no need to rush this if you are busy.