gulfofmaine / sdm_workflow

A repository to help streamline the species distribution model development and prediction workflow.
MIT License
2 stars 0 forks source link

Small edits to Matt's code #67

Open aallyn opened 1 year ago

aallyn commented 1 year ago

I made some slight edits to Matt's code. A couple changes to fcts.py to account for the Box weirdness and getting the paths to work out okay. Then, within the main workhorse script ZarrCMIP6.py I did the following:

I am able to download and save the different files, expect for MIROC6 gave me a fit about not having depth? Then after the downloading and saving bits, on line 296 (names = {'name': [], 'minDate': [], 'maxData': [], 'length': []} is where I get an error that name "name" is not defined. It doesn't seem to make a difference in the actual accessing, processing and downloading, but does seem to toss a wrench in things so that it doesn't go to the next climate model member -- hence running manually one at a time.

Thanks for checking it out!

adamkemberling commented 1 year ago

I'm not seeing lines of code through 296, but this bit {'name': [], 'minDate': [], 'maxData': [], 'length': []} can be thought of like a named list with empty vectors, an r analog would be: list("name" = c(), "minDate" = c(), "maxData" = c()", "length" = c())

I can't find where it is for broader context, but the error sounds like either the model doesn't contain that field/dimension or it has a different name and its throwing an error because they don't match up.

aallyn commented 1 year ago

Hm...let's see if this works. Here's the line that seems to be giving the error. A bit weird that it happens there when it is just setting up an empty list?

aallyn commented 1 year ago

Welp that link definitely did not go directly to the line...stand by haha

aallyn commented 1 year ago

Huh...looks like the syntax is right because it does highlight the line if its in the first viewable section without having to click to see more. So, you don't see line 294/296 in ZarrCMIP6.py?

adamkemberling commented 1 year ago

Nvm, I had scrolled past ZarrCMIP6.py and was expanding the other file. I think the error is happening here: https://github.com/gulfofmaine/sdm_workflow/pull/67/commits/a5e8e91f41bc519de669ce8432253950be59661d#diff-4781834eced6e7a695d26efa59e1e0fd025602c6c137561a23f7fbd2360cdd44L303-L309

Lines 303-309, 307 specifically.

aallyn commented 1 year ago

Working now and processing all the files listed in source list. Once these download, will experiment with processing side of things