Updated parse_data to deal with more than 200 directional bins aand zeros#21
Updated parse_data to deal with more than 200 directional bins aand zeros#21ajsmale wants to merge 1 commit intoopenearth:masterfrom
Conversation
…l as spectra with all zeros
Codecov Report
@@ Coverage Diff @@
## master #21 +/- ##
==========================================
- Coverage 76.53% 76.08% -0.45%
==========================================
Files 9 9
Lines 1189 1196 +7
Branches 248 250 +2
==========================================
Hits 910 910
- Misses 168 174 +6
- Partials 111 112 +1
Continue to review full report at Codecov.
|
|
Hi Alfons, Thanks for the improvement. The fix seems appropriate, but seems to work only up to 400 bins. I think it is trivial to make the fix work for an unlimited number of bins. Untested example code: Further, I have some minor requests regarding readability and testing (see also the code snippet above). Readability
Testing
AcknowledgmentFinally, can you add a line to Bas |
Updated parse_data to deal with more than 200 directional bins as well as spectra with all zeros
Apparently a maximum of 200 directional bins is written by SWAN to one line (this is hardcoded somewhere, not part of a swan input/use settings. With more than 200 bins, the data is written in multiple lines. Code changes allows for this.
Furthermore, if for some reason all data is zero (or more specifically all integer), the np.asarray makes and integer array, which does not allow multiplication with the floating value of factor f. Changed np.asarray to also hardcode float64.