PYROMS status

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

PYROMS status

#1 Unread post by kate »

Last week there was a request for documentation on the ROMS wiki for pyroms. Fair enough - one is expected to get by on the incomplete set of examples provided. However, I should say that things are in flux. Pyroms is in Python 2.x which is now quite dated. The plan is to abandon both the Pyroms name (for the sake of Rob Hetland) and to switch to Python 3.x. I ran everything through the 2to3 Python converter and we created a new repository. This is just the tip of the iceberg, though, with more changes coming, probably git submodules and other restructuring. This is not the time to be documenting it. Plus, since it is hosted on github, we should document it there - including features which might show up for models other than ROMS.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: PYROMS status

#2 Unread post by kate »

And here's a page for something I haven't advertised enough for dealing with the ocean.in file:
https://github.com/ESMG/PyCNAL/wiki/pyc ... x-ocean_in

zsurenj
Posts: 9
Joined: Fri Apr 24, 2015 4:06 pm
Location: Zhongshan university

Re: PYROMS status

#3 Unread post by zsurenj »

Hi,Kate
Thanks your hard work for PyCNAL. I can install PyCNAL in my macOS10.12, but when I make "python make_grid.py" in the path "examples/stuff", an error appears as the following:
Traceback (most recent call last):
File "make_grid.py", line 59, in <module>
hgrd = bry.grd
AttributeError: 'BoundaryInteractor' object has no attribute 'grd'

which will appear only when I want to use the graphical interface, that is to say I comment out the following codes:
map.drawcoastlines()
xp, yp = map(lonp, latp)
bry = pycnal.hgrid.BoundaryInteractor(xp, yp, beta, shp=(Mp+3,Lp+3), proj=map)
hgrd = bry.grd

May be the code file hgrid.py have some bug?

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: PYROMS status

#4 Unread post by kate »

The interactive grid stuff is meant to be used in an "ipython --pylab" session so that the interactive windows pop up. It is also meant to be executed one line at a time, via cut and paste from another window. Could you try that?

zsurenj
Posts: 9
Joined: Fri Apr 24, 2015 4:06 pm
Location: Zhongshan university

Re: PYROMS status

#5 Unread post by zsurenj »

Thanks your reply. when the interactive grid stuff is used in an "ipython --pylab" session,the interactive windows pop up, and I can move the grid corners interactively.
But when I run the line code "hgrd = bry.grd" from examples/stuff/make_grid.py, the error is still there:
AttributeError: 'BoundaryInteractor' object has no attribute 'grd'
Can you give me some suggestions for this issue? I will appreciate.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: PYROMS status

#6 Unread post by kate »

I went to a Python workshop last year in which I heard about "technical debt" for the first time. It applies here - having some responsibility for code I didn't write, code that's not really covered by my explicit job tasks. Anyway, digging into the code, I find this:

Code: Select all

    Key commands:
     
        t : toggle visibility of verticies
        d : delete a vertex
        i : insert a vertex at a point on the polygon line 
     
        p : set vertex as beta=1 (a Positive turn, marked with green triangle)
        m : set vertex as beta=1 (a Negative turn, marked with red triangle)
        z : set vertex as beta=0 (no corner, marked with a black dot) 
     
        G : generate grid from the current boundary using gridgen
        T : toggle visability of the current grid 
I'm betting you didn't hit "G" and that's why the grd object doesn't exist yet in the bry structure. You can always see what is in bry with dir(bry) in ipython.

bilge.tutak
Posts: 20
Joined: Wed Jun 04, 2014 1:45 pm
Location: Istanbul Technical University

Re: PYROMS status

#7 Unread post by bilge.tutak »

And just an addition to Kate,
With my grid generation runs using pyroms, due to some reason, it requires my mouse pointer to be within the boundary where the grid will be generated.
kate wrote:I went to a Python workshop last year in which I heard about "technical debt" for the first time. It applies here - having some responsibility for code I didn't write, code that's not really covered by my explicit job tasks. Anyway, digging into the code, I find this:

Code: Select all

    Key commands:
     
        t : toggle visibility of verticies
        d : delete a vertex
        i : insert a vertex at a point on the polygon line 
     
        p : set vertex as beta=1 (a Positive turn, marked with green triangle)
        m : set vertex as beta=1 (a Negative turn, marked with red triangle)
        z : set vertex as beta=0 (no corner, marked with a black dot) 
     
        G : generate grid from the current boundary using gridgen
        T : toggle visability of the current grid 
I'm betting you didn't hit "G" and that's why the grd object doesn't exist yet in the bry structure. You can always see what is in bry with dir(bry) in ipython.

zsurenj
Posts: 9
Joined: Fri Apr 24, 2015 4:06 pm
Location: Zhongshan university

Re: PYROMS status

#8 Unread post by zsurenj »

It's very happy to report I worked past my grid issue according to above suggestion. It is first time for me to apply PyNCAL successfully. Thank you so much for your help!

Post Reply