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

Automate v-grid generation #147

Closed
Tracked by #165
saeed-moghimi-noaa opened this issue Apr 22, 2024 · 9 comments
Closed
Tracked by #165

Automate v-grid generation #147

saeed-moghimi-noaa opened this issue Apr 22, 2024 · 9 comments
Assignees

Comments

@saeed-moghimi-noaa
Copy link

No description provided.

@saeed-moghimi-noaa
Copy link
Author

Perhaps connecting to our colleagues from Portugal regarding their work.

@felicio93
Copy link
Collaborator

INFO:
lsc2 script: vgrid_lsc2

Tasks:
1 - Reduce the dependence on pylib
2 - Coordinate implementation under PYSCHISM
3 - ...

@felicio93
Copy link
Collaborator

I updated the vgrid_lsc2 notebook.
Now it only uses numpy and pyschism (no pylib dependencies)

@felicio93
Copy link
Collaborator

felicio93 commented May 21, 2024

Slip the script into functions. Will coordinate with Soroosh on how to proceed.

@felicio93
Copy link
Collaborator

Created:
set_m_grid(self) # set master grid
set_lsc2_att(self, gr3, crs=None) # set lsc2 attributes
write(self, path, overwrite=False) # write vgrid.in lsc2 file

as part of the Vgrid class (child class LSC2) on PySCHISM.

The user can now:

  1. create a LSC2 object:
    lsc2_obj = pyschism.mesh.vgrid.LSC2(hsm, nv, h_c, theta_b, theta_f)

  2. set a master grid:
    lsc2_obj.set_m_grid()

  3. set a lsc2 grid by passing the hgrid:
    lsc2_obj.set_lsc2_att({PATH_TO_gr3})

  4. set a lsc2 grid by passing the hgrid:
    lsc2_obj.write({PATH})

Next:
Meet with Soroosh to discuss pull request

@saeed-moghimi-noaa
Copy link
Author

Hi @felicio93
Please consider doc string and possible additions for read the doc if it applies to pyschism. Thanks

@felicio93
Copy link
Collaborator

felicio93 commented May 24, 2024

@SorooshMani-NOAA,

I made the changes we discussed on our last meetings, including:

  1. Change the name of the functions from "set" to "calc"
  2. Allow calc_lsc2_att to take either a gr3 file or gr3 object
  3. I also added a new function make_m_plot, for allowing quick master grid visualization

I then added test to a preexisting test file (pyschism\tests_mesh\test_vgrid). I added the following tests:

  1. setUp # for setting up a dummy hgrid, and the lsc2 attributes
  2. test_LSC2
  3. test_calc_m_grid
  4. test_make_m_plot
  5. test_calc_lsc2_att
  6. test_lsc2_write

vgrid.py
test_vgrid.py

Please let me know if you think we are ready to include Fei in the discussion and make the pull request.

@felicio93
Copy link
Collaborator

Pull request initiated: schism-dev/pyschism#127

@felicio93
Copy link
Collaborator

felicio93 commented May 30, 2024

Pull request accepted by VIMS. @saeed-moghimi-noaa, should we close this ticket?

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