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

local variable 'eddz' referenced before assignment #18

Open
JoMaHoPo opened this issue Nov 23, 2022 · 4 comments
Open

local variable 'eddz' referenced before assignment #18

JoMaHoPo opened this issue Nov 23, 2022 · 4 comments

Comments

@JoMaHoPo
Copy link

Hello

I have been trying to run the analyseddyzt function in order to detect the positive eddies on a SLA subset (55,70 N; 30,5 W) from the CMEMS_SEALEVEL_008_057 dataset. I have selected one year, so it has 365 timesteps. I have also set the time and spatial filters to None.

However when I run the function the same error always pops up "local variable 'eddz' referenced before assignment". So I don't know how to proceed since I don't detect what I can be doing wrong or if any step is missing in applying the routine.

positive_eddies=analyseddyzt(sla,lon,lat,0,364,365,levels,preferences=preferences
,areamap=areamap,areaparms=checkarea,filters=filters
,maskopt='contour',diagnostics=False,pprint=True)

This error is repeated if I only choose one timestep from my dataset and use the same configuration as the How_TrakcEddy_Works script.

I have tried to look into the function script in order to see the possible mistake from my side, however, I have not found the reason.

Also, I was wondering if there is any function that calculates EKE, TEKE and TRKE and TRKEc since I am mostly interested in these variables.

Kind regards, Joan

@JoMaHoPo
Copy link
Author

I have tried to run the Trackeddy with one day of global SLA. It worked. Is there any documented issue with using just a region of the ocean?

Thanks a lot for all the help so far!

@josuemtzmo
Copy link
Owner

Hello @JoMaHoPo, that seems like a weird issue, my guess is that it may have to do with the levels you are using:

  • Are the levels within the same value range as your data?

Regarding the energy decomposition, first you need to reconstruct the surface anomaly from each field to then compute geostrophic velocities of each one of them. If I remember properly there is a function called reconstruct_syntetic that allows you to create the surface elevation.

@JoMaHoPo
Copy link
Author

Hello Josue,

Yes, I was thinking the same, but what is intriguing me is that for the GLOBAL CMEMS dataset the function works as planned, but if my initial SLA field is a subset of that same global dataset, the function crashes giving me this error all the time. Could it have something to do with the fact that my longitude goes from -180 to 180? Or the fact that I my data is all located in all negative longitudes?

Regarding the reconstruction of the fields, I realised about that just after writing the question (silly of me, I am sorry).

Also, do you know if from your papers you created a full time series of the global reconstructed fields, so at some point I could compare the results of the reconstructed fields and the EKE, TEKE, TRKE fields?

Thanks a lot for the help so far, and sorry for all trouble.

@josuemtzmo
Copy link
Owner

I don't think I hard coded something regarding the longitude. Since I have no clue, It will be easier if you provide me more info here, i.e. the range of your field, the region.

I have the dataset of the reconstructed fields, so of course, I could share this with you. If you want, we can have a call, so I can help with the model details as well. We can arrange that by email ([email protected]).

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