Skip to content

Generate wave resource JPD file from multiple years of time series data#993

Merged
mjprilliman merged 13 commits into
patchfrom
me_jpd_generation
Apr 5, 2022
Merged

Generate wave resource JPD file from multiple years of time series data#993
mjprilliman merged 13 commits into
patchfrom
me_jpd_generation

Conversation

@mjprilliman

Copy link
Copy Markdown
Collaborator

Description

New feature that takes a folder of downloaded wave resource time series files and generates a joint probability distribution of wave height and wave period from the time range to then be used in Frequency of Occurence resource definition within SAM. Feature can be used from SAM menu or user is prompted after downloading wave resource data from the API.

May require a beta version from patch once merged (operating system to be determined).

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@mjprilliman mjprilliman added this to the 2021.12.02 Patch 2 milestone Mar 30, 2022
@mjprilliman mjprilliman self-assigned this Mar 30, 2022
@sjanzou

sjanzou commented Mar 31, 2022

Copy link
Copy Markdown
Collaborator

@mjprilliman,

  1. Why are there so many CSP file changes in this pull request?
  2. What exactly should we be testing? Do you have a SAM file or steps to test?

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@mjprilliman,

  1. Why are there so many CSP file changes in this pull request?
  2. What exactly should we be testing? Do you have a SAM file or steps to test?
  1. I built SAM_api in the build process so those api updates must be from previous work that was not updated in the SAM_api
  2. I will add detailed test instructions and files here

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

Test instructions:
-Download weather files in attached zip file to dedicated folder (nothing else in folder)

-Open a Marine Wave - LCOE Calculator case
-On Wave Resource page, select Time Series option
-Click 'Create JPD from time series file(s) button'
-Follow prompts to select folder containing only downloaded wave files, then file for output JPD file
-Check that file is saved correctly and appears in 'Frequency of Occurence' library with naming convention 'latX_lonX_startyear_endyear'

Additional test:
-Run wave download tool from button
-Download file(s) (must have API calls set up to work from built version)
-Ensure that yesno prompts user to run JPD file generator, same steps as previous test

ME_humboldt_bay.zip

@cpaulgilman

cpaulgilman commented Mar 31, 2022

Copy link
Copy Markdown
Collaborator

The functionality here is generally good. A couple of comments to improve the user experience:

  1. When I try to download files for all years, if the API call fails, I get a "Weather file not available" message for each file, so I have to click OK a bunch of times. I would expect the download to stop if the API call fails instead of trying for each file. For example, if the API returns "API_KEY_MISSING" the download process should stop after displaying the first "Weather file not available" message.

  2. I think SAM is creating a "SAM Downloaded Device Files" folder in my user folder. Should that be "SAM Downloaded Wave Resource Files" instead?

  3. The "Choose folder" dialog title might be more informative as "Choose folder containing single-year wave resource files."

  4. Please change the "Save MultiYear JPD File as" dialog title to "Save multi-year JPD file as" and the save as type from "JPD files" to "JPD File".

  5. Please change the message text "A JPD file of the time series wave resource data has been generated and can be found on the Frequency of Occurence tab" to "Multi-year JPD file saved.\nTo use the file, switch from the Frequency of Occurrence option to Time Series, and choose " + jpd_name_parameter + " from the library.", where jpd_name_parameter is the name listed in the library. Because the library does not list the file name, it was hard for me to figure out what to choose to get the multi-year JPD.

  6. The Average Power Flux column for the multi-year JPD file shows "nan" in the library list.

7, Each time I create a multi-year JPD file. SAM adds the weather file folder to the Frequency of Occurrence library folders even if it is already there. In this case, the ME_humboldt_bay folder is listed twice:

image

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I agree with Paul on the user experience and "nice" messages and a way to avoid repeated dialogs on an API fail. I am approving subject to the feedback from Paul being addressed...

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@cpaulgilman Can you re-review for user experience when you get the chance? I tried to address all your points in your first review.

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Hi Matt,

I tested running the make JPD file feature by following the prompt after downloading single year files, and get this error:

image

I get a similar error after clicking Creaste JPD from time series weather file(s) as a separate step.

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

Hi Matt,

I tested running the make JPD file feature by following the prompt after downloading single year files, and get this error:

image

I get a similar error after clicking Creaste JPD from time series weather file(s) as a separate step.

@cpaulgilman did you rebuild with the latest commits pulled into the branch? I'm not able to replicate that error. Every other branch (ssc, lk, wex) should be patch.

@mjprilliman mjprilliman merged commit c8ef805 into patch Apr 5, 2022
@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes PR and/or issue has been added to release notes for a public release new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants