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

SwanSpecFile.__init__() fails reading locations from header when location names are present #84

Open
dpzimmer opened this issue May 15, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dpzimmer
Copy link

Often SWAN 2D ASCII spectra may contain location names present in the coordinate definition section of the header.

See https://swanmodel.sourceforge.io/online_doc/swanuse/node50.html

"Note that if the file is used for input for SWAN (but not generated by SWAN) and the user so desires, the names of locations can be written behind the two coordinates; these names are ignored by SWAN when reading the file (see remark on format above)."

To allow for this, a fix such as below is required to swan.py:

            for ip in locs:
                # xy = [float(val) for val in ip.split()]
                # self.x.append(xy[0])
                # self.y.append(xy[1])
                xy = ip.split()
                self.x.append(float(xy[0]))
                self.y.append(float(xy[1]))

@rafa-guedes
Copy link
Collaborator

Thank you @dpzimmer, we would welcome some pull request on this!

@rafa-guedes rafa-guedes added bug Something isn't working help wanted Extra attention is needed labels Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants