Skip to content

Commit 10499f2

Browse files
committed
Moving seabed_tools to main FAModel folder (and deleting submodule)
- The remaining functions in seabed_tools are either 1) used as helper functions to scripts like project.py to process different things, or 2) the main getDepthFromBathymetry functions - Did not want to merge the functions into geography.py because that would create a project.py import dependence on the geography module - So, we left those functions there and moved seabed_tools to the same directory as geography and helpers.py - - At some point, the getDepthFromBathymetry functions can merge into something like helpers.py (like MoorPy), but going to leave it as import sbt for now - Also, turbine.py uses the getInterpNum function, independent of anything seabed related, so that can likely eventually be a general helpers function - Note: geography functions still also have a dependence on sbt.getDepthFromBathymetry - processBoundary has a dependence on geography functions, but it doesn't need to - Updated all the other import dependencies elsewhere
1 parent 699e72d commit 10499f2

File tree

15 files changed

+15
-58
lines changed

15 files changed

+15
-58
lines changed

famodel/design/layout_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
from famodel.mooring.mooring import Mooring
12-
from famodel.seabed.seabed_tools import getDepthFromBathymetry
12+
from famodel.seabed_tools import getDepthFromBathymetry
1313
from famodel.project import Project
1414
from famodel.design.fadsolvers import dsolve2
1515

famodel/geography.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
import geopandas as gpd
1313
from shapely.geometry import Point, Polygon, LineString
1414

15-
16-
17-
18-
import famodel.seabed.seabed_tools as sbt
19-
20-
21-
15+
import famodel.seabed_tools as sbt
2216

2317
from pyproj import CRS
2418
from pyproj.aoi import AreaOfInterest
2519
from pyproj.database import query_utm_crs_info
2620

2721

22+
# =============================================================================
23+
# COORDINATE REFERENCE SYSTEMS & TRANSFORMATIONS
24+
# =============================================================================
2825

2926
def getLatLongCRS(epsg_code=4326):
3027
'''Returns a coordinate reference system (CRS) object from the pyproj package of a 'wordly' CRS with units of latitude and longitude
@@ -250,8 +247,9 @@ def convertMeters2LatLong(xs, ys, centroid, latlong_crs, target_crs, mesh=False)
250247

251248
return longs, lats
252249

253-
254-
250+
# =============================================================================
251+
# BATHYMETRY & GEOSPATIAL DATA PROCESSING
252+
# =============================================================================
255253

256254
def getMapBathymetry(gebcofilename):
257255

@@ -417,8 +415,9 @@ def getLeaseAndBathymetryInfo(lease_name, bathymetry_file, bath_ncols=100, bath_
417415

418416

419417

420-
421-
418+
# =============================================================================
419+
# FILE I/O & DATA FORMAT CONVERSION
420+
# =============================================================================
422421

423422
def processGeotiff(filename, lat, lon, outfilename="processGeotiff.txt", **kwargs):
424423
'''Process a geotiff file containing bathymetry (or other info)
@@ -504,9 +503,6 @@ def processGeotiff(filename, lat, lon, outfilename="processGeotiff.txt", **kwarg
504503

505504

506505

507-
508-
509-
510506
def getSoilType(x, y, centroid, latlong_crs, custom_crs, soil_file):
511507
"""Function to return the name of the soil below a specific x/y coordinate by creating shapely polygons based on the shapefile data.
512508
It loops through all polygons in the shapefile and if the x/y position is contained in that polygon, it returns the soil of that polygon."""

famodel/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
pass
1818

1919
#from shapely.geometry import Point, Polygon, LineString
20-
from famodel.seabed import seabed_tools as sbt
20+
import famodel.seabed_tools as sbt
2121
from famodel.mooring.mooring import Mooring
2222
from famodel.platform.platform import Platform
2323
from famodel.anchors.anchor import Anchor

famodel/seabed/README.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

famodel/seabed/__init__.py

Whitespace-only changes.

famodel/seabed/images/humboldt.PNG

-108 KB
Binary file not shown.

famodel/seabed/images/mapview.PNG

-54.5 KB
Binary file not shown.
-134 KB
Binary file not shown.
-77.1 KB
Binary file not shown.
-48.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)