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

Delft 3D Timestep to Seconds Function #155

Closed
wants to merge 177 commits into from

Conversation

browniea
Copy link
Contributor

@browniea browniea commented Feb 16, 2022

Adding on to the PR #Delft3D io functions this PR outputs the time output based on the time step in function convert_time, d3d. get_layer_data and d3d.get_all_data_points. A function to get all timestamps 'get_all_timestamps' will return an array of all the timestamps for a data set.

Additions:
-get_all_timestamps : inputs netcdf4 dataframe and returnas all the time stamps for that data set
-convert_time : converts a time_index to a time_stamp in seconds or vice versa

Changes in 'get_layer_data`

  • 'cords_to_layers' dictionary
  • depth output z : z=[bottom_depth*Layer_percentages[layer_index]]-water_level
  • updated interpolation for bottom_depth and water_level in wdim coordinate system

Changes in 'get_all_data_points`

  • 'cords_to_layers' dictionary
  • depth z is pulled from 'get_layer_data` and takes into account water level

browniea and others added 30 commits March 2, 2021 12:04
* changing path to data following organizational update

* Reorganized headers

Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Copy link
Contributor

@ssolson ssolson left a comment

Choose a reason for hiding this comment

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

Emily, it looks like you did not add any new tests for the new functions? Currently, this PR is reducing coverage by 1%. Let's add some more tests. This simple function should have little to no impact on the repository's coverage.

except:
idx = (np.abs(times - time_stamp)).argmin()
QoI= idx
print(f'ERROR: invalid time_stamp. Closest time_stamp found {times[idx]}')
Copy link
Contributor

Choose a reason for hiding this comment

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

no underscore in time stamp.

Browning and others added 25 commits March 7, 2022 18:43
Include the last day of the year when using years parameter. Fixes MHKiT-Software#154.
…ware#161)

* Bug fix: remove timezone replace for astimezone

* add pytz to required packages
* Plot each col in DataFrame individually

* Remove numpy and pandas version requirements
* Working version of Gaussian Copula

* Create dedicated function for iso probs and quantiles

* Contour plots worsk for single and multiple contours

* Gumbel Copula.

* Clayton Copula

* Rosenblatt Copula

* Guass and gumbel general copula

* Add support for nonparametric gaussian, clayton, and gumbel copulas

* Require statsmodel for nonparametric KDE copulas

* Small changes

* Fix bug in KDE log transformation

* Adding docstrings

* All doc strings updated

* Add markers option to contours plotting

* Add Copula tests comparing to WDRTresults

* Fix x1, x2 pts bug in KDE contour, clean up

* Example showing the calculation of all copla methods and comparing to WDRT results

* Simplifications and lanuguage cleanup

* Add statsmodel

* Add testing data files

* In plot envrionmental contors convert x1,x2 to values if a Series is passed

* Docstring typo corrections

* Corrected notebook description typos.

* module and example for short-term extreme distributions

* docstrings for short-term extreme functions

* fixes MHKiT-Software#140 Speedup surface elevation calculation.

* correction to surface_elevation

* elevation

* minor fixes based on review comments

* add environmental_contours to init

* Remove WDRT functionality

* All WDRT contour functionality can be called from one function

* Rework tests for new contour functions setup and location

* Move all contour example into this file

* Update to work with new structure.

* Remove all commented out wdrt functions from resource

* No changes made. Reverting back.

* Have PCA method use general fit. Adds PCAmethod to fit method but can also accept the PCA dictionary. General Docstring Cleanup

* Update discussion around the use of the copula method.

* Remove copula stand alone notebook

* minor formmating changes

* Remove test bugs created from merge with origin

* Import env contours into resource module and adjust test, examples, ect to function with tthe new structure

* Uncommented tests

* Remove reference to import the env contours module

* fixing minor typo

* Move env contours to _file and adjust package to handle new structure

* Minor formatting cleanup

* Cleanup unsed packages and variables

* intial mler upload

* formalize functions

* add tests and example

* sampling rate to averaging period

* rename MLER example

* working

* merging

* WDRT functions and examples finalized. Missing tests.

* integrate mler into extreme

* fixes tests?

* fix tests

* fix tests

* fix full sea state example?

* test contour samples

* test sample full seastate

* random seed

* test long term extreme

* expand MLER functionality

* test short-term extremes

* fix mler tests

* MLER test error

* mler fix 2

* update formats and asserts

* further cleanup of countours.py for consistency, typos, and pep8

* run tests?

* fix test?

* change lists to np.array so they pass the assert statements

* clean extreme.py for consistency, pep8

* points_per_interval should be int

* typing in examples

* full sea state example: make it easier to follow, add more explanation, and use consistent naming

* contour example: make it easier to follow, add more explanation, and use consistent naming

* Alias ste function and minor formatting.

* naming convention

* rename example

* ste example

* allow weights to be np.array

* allow weights to be np.ndarray

Co-authored-by: ssolson <[email protected]>
Co-authored-by: ssolson <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: hivanov-nrel <[email protected]>
* input output files
+ testing

* Code update

* Test reformatting

* Testing paths

* dependency switch from h5netcdf to netcdf4

* Code cleanup

* Test import fix

* Minor docstring edits

* Add dolfyn test data

* Test fixes for mhkit

* Removing uneeded test files, improving consistency

* Not sure why these files didn't upload

* Organizational changes and clarifications. Request for additional clarification

* Dolfyn codebase updates

* Dolfyn example notebooks update

* Testing updates

* Update example datafile

* Latest dolfyn v0.13.0 updates

* Name change

* input output files
+ testing

* Code update

* Organizational changes and clarifications. Request for additional clarification

* Dolfyn codebase updates

* fix bug and make faster. Un-hard-code default seed/phase.

* fix tests

* delete commented out tests

* retrigger checks

* Checkpoint push

* New dolfyn data files

* Reorganize dolfyn testing

* pytest install for warnings tests

* Final update for IO

* Remove future updates

* Ensure file compression runs

* Update numpy dependency

* trying numpy v1.22

* changing numpy requirements

* Remake unittest test cases

* Save format options

* Add dolfyn view to notebooks

* Decode remaining binary ad2cp variables

* DOLfYN 1.0.0 dependency

Co-authored-by: jmcvey3 <[email protected]>
Co-authored-by: ssolson <[email protected]>
Co-authored-by: Michelen <[email protected]>
Co-authored-by: jmcvey3 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
@ssolson
Copy link
Contributor

ssolson commented Apr 11, 2022

Superceeded by #168

@ssolson ssolson closed this Apr 11, 2022
@browniea browniea deleted the d3d branch September 8, 2022 18:25
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

Successfully merging this pull request may close these issues.

6 participants