Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • CSTools CSTools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • External
  • CSToolsCSTools
  • Issues
  • #141
Closed
Open
Issue created Nov 07, 2023 by Eva Rifà@erifarovMaintainer

Improve CST_SaveExp

Hi @aho,

I have changed a bit the function CST_SaveExp in the branch develop-SaveCube. Some improvements were needed regarding adding 'global_attrs' and saving correctly 'time_bounds'. However, there are other changes regarding the code that I'll explain briefly below.

I have created a file with some examples that I have used to tests the developments: UseCase4_CST_SaveExp. They are the tests I mention below.

New development

  1. Now the saving is done by ArrayToNc. Before, the library ncdf4 was used.
  2. Added development for allowing to save arrays with Dates that only have either 'ftime_dim' or 'sdate_dim' (you can see tests 1.4 and 4).
  3. Added parameter units_hours_since: description here. Optional, only used when single_file is TRUE due to having multiple time dimensions in the same file. You can see Tests 4.
  4. Added parameter global_attrs: description here. You can see tests 1.6.
  5. Allow saving 'time_bnds'. You can see Test 4.
  6. Reorganized the initial checks and improved unit test.
  7. Improved documentation.

When it does not work

  • The function can save data from Start and then it is readable by Start. Also the function saves data from Load and it's readable by Start. However, I couldn't manage to read the saved data from Load with Load (see Test 5).

Testing
I think that it would be good if you can take a look on the tests I have checked. Since there are infinite possibilities, the most important things to test are the ones regarding time values:

  • The development regarding 'time_bounds' (some examples are in these lines).
  • The time units need to be checked carefully for both cases: single_file = TRUE and single_file = FALSE.

Could you test the development? If @vagudets you think you can test first the development regarding 'time bounds' (only if you have time) and then @aho can take a final look it would be great. However, any other way is fine.

Best,
Eva

FYI @nperez and @nmilders

Edited Dec 01, 2023 by Eva Rifà
Assignee
Assign to
Time tracking