Skip to content

Commit

Permalink
Compound flood scripts: minor edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
feiye-vims committed Jun 26, 2023
1 parent 0d26ec5 commit 47ad2ce
Show file tree
Hide file tree
Showing 13 changed files with 529 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@

1
97 1
-9.760142196020493088e+01 2.457280308809358971e+01
-9.719131674685566225e+01 2.567826422644326811e+01
-9.708879029801619254e+01 2.616957910380626373e+01
-9.723233029666138805e+01 2.704985125529138656e+01
-9.700677168454633659e+01 2.778682480759870188e+01
-9.641211550159033550e+01 2.821672706908993433e+01
-9.524331110769375641e+01 2.874898697870138520e+01
-9.432057330403429773e+01 2.932218947493107919e+01
-9.343884854785750349e+01 2.946549033563424658e+01
-9.263914638406036772e+01 2.915841882016355768e+01
-9.161388757819098316e+01 2.889229126811926918e+01
-9.126529985604386752e+01 2.866710537315391605e+01
-9.079368105532074651e+01 2.858521950559542901e+01
-9.013751621328864871e+01 2.895370566470213092e+01
-8.980943387597565675e+01 2.917889172642145823e+01
-8.931731143949320995e+01 2.899464878853735073e+01
-8.907124926201522896e+01 2.907653381789119607e+01
-8.876367207473187193e+01 2.952690585474677221e+01
-8.845609590960391699e+01 2.989539188369322531e+01
-8.784094163794650001e+01 2.989539192000983192e+01
-8.724629344732491631e+01 3.001822094579508970e+01
-8.700023138518835708e+01 3.018199195462506168e+01
-8.648760327853212004e+01 3.022293496788138967e+01
-8.607750121270585453e+01 3.016152097559763590e+01
-8.562638815559941463e+01 2.979303498155618968e+01
-8.556487314825714918e+01 2.954737798190259923e+01
-8.507275010376658031e+01 2.926077698704782648e+01
-8.462163707443711758e+01 2.928124899085149124e+01
-8.419103005292011233e+01 2.897417699330792829e+01
-8.355537103061715243e+01 2.823720599578804169e+01
-8.302223801813197213e+01 2.721363399713585451e+01
-8.242759000910389489e+01 2.573968999817375547e+01
-8.234556900755336528e+01 2.492083299822532183e+01
-8.265314600970276615e+01 2.459328999757274303e+01
-8.212001300564678274e+01 2.451140399854498853e+01
-8.113576700198773040e+01 2.469564699949176045e+01
-8.029505700074967933e+01 2.506413299981775111e+01
-8.015152200066776800e+01 2.547356099985221078e+01
-8.013101600071969699e+01 2.610817599986176418e+01
-8.011051100078289267e+01 2.694750499987304693e+01
-8.025404700103430855e+01 2.784824799985722166e+01
-8.054111900158768833e+01 2.881040599981139394e+01
-8.095122100265872689e+01 2.950643499971236494e+01
-8.119728300363736651e+01 3.053000599965696793e+01
-8.088970600266931399e+01 3.147169299978130397e+01
-7.988495500081896239e+01 3.239290699994430867e+01
-7.916727600031001089e+01 3.292516499998191648e+01
-7.828555600007648252e+01 3.335506499999694086e+01
-7.779343300003030492e+01 3.345742199999941846e+01
-7.748585600001578655e+01 3.337553600000015308e+01
-7.744484600001467811e+01 3.384637900000039679e+01
-7.732181500001107111e+01 3.407156500000056809e+01
-7.687070300000354450e+01 3.429675100000091703e+01
-7.658363100000143220e+01 3.431722200000098866e+01
-7.631706400000059887e+01 3.431722200000108813e+01
-7.629655900000059887e+01 3.462429400000105773e+01
-7.566090100000003815e+01 3.507466600000113743e+01
-7.533281900000005749e+01 3.529985100000123310e+01
-7.543534400000002904e+01 3.589352300000140161e+01
-7.580443600000002391e+01 3.679426600000165593e+01
-7.541483900000010010e+01 3.763359500000198210e+01
-7.504574072829456099e+01 3.845245768601355962e+01
-7.475867500000005350e+01 3.890282400000250362e+01
-7.438958300000004442e+01 3.920989600000266506e+01
-7.399998599999983639e+01 3.980356800000292594e+01
-7.389745999999978210e+01 4.037676800000322430e+01
-7.352836799999900563e+01 4.052006800000341258e+01
-7.211351499996558800e+01 4.086808200000309199e+01
-7.123179499984927077e+01 4.097043900000125660e+01
-7.000148799921771570e+01 4.032e+01
-6.7e+01 4.032e+01
-6.7e+01 4.168693999999011623e+01
-6.987845699915324360e+01 4.203495399999465576e+01
-7.030906499951474586e+01 4.256721200000001204e+01
-7.016552899944404942e+01 4.311994000000105842e+01
-6.946835499880648968e+01 4.352936900000029397e+01
-6.848410899689351083e+01 4.391832600000746112e+01
-6.735632799198003795e+01 4.432775500006983549e+01
-6.657713298618337205e+01 4.488048400023984641e+01
-6.514177496430072267e+01 4.528991300117250063e+01
-6.520328996492615659e+01 4.514661300106944708e+01
-6.643359698365361510e+01 4.443011200023294549e+01
-6.651561798381324309e+01 4.402068400016739247e+01
-6.620804097798308874e+01 4.338606900014472956e+01
-6.579793896949486509e+01 4.316088300019809765e+01
-6.501874394946584346e+01 4.344748300065516133e+01
-6.413702391861630758e+01 4.410256900210890763e+01
-6.354237488746175444e+01 4.432775500378577505e+01
-6.206600676035127861e+01 4.471671301309604019e+01
-6.075367857398177307e+01 4.514661303487664412e+01
-5.954387638095681723e+01 4.590405608175452556e+01
-6.327580890945399261e+01 4.631348500674298663e+01
-7.356937799999911931e+01 4.453247000000624922e+01
-9.159338147647954997e+01 3.781783788341427766e+01
-9.817558669773180213e+01 3.194252726997421021e+01
-9.889328412005477276e+01 2.788917210002837521e+01
-9.868820495225116929e+01 2.285319310054591924e+01
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

1
88 1
-9.782193084198110000e+01 2.478850450073023026e+01
-9.754159186045797014e+01 2.501846931009681185e+01
-9.735960456169166832e+01 2.541194002225282844e+01
-9.718254695558353262e+01 2.569386677924923745e+01
-9.714572256755873525e+01 2.595976548577143816e+01
-9.723070386698931600e+01 2.645388316339304779e+01
-9.738632137267826749e+01 2.694252050671047272e+01
-9.732400235605325634e+01 2.740582474520460821e+01
-9.718085961742279721e+01 2.781513100647466530e+01
-9.681577941081155814e+01 2.817529597318771550e+01
-9.652150715841533213e+01 2.834900663798702425e+01
-9.596318197672142958e+01 2.862162192383318882e+01
-9.539311281689253974e+01 2.885683026602260526e+01
-9.491001961456824176e+01 2.925876931918775625e+01
-9.445514126555711698e+01 2.949845254967295816e+01
-9.395248342457466606e+01 2.965589452153079009e+01
-9.357637104824253527e+01 2.973010164304542258e+01
-9.317459616978672443e+01 2.975002175404947380e+01
-9.252341641918383175e+01 2.955619100517964881e+01
-9.222236771057343674e+01 2.953352789456023686e+01
-9.210129691874053037e+01 2.958765554157406186e+01
-9.200067916691193659e+01 2.967700944451310363e+01
-9.172505694715761138e+01 2.963707061585792601e+01
-9.157095910024433749e+01 2.949843148340157484e+01
-9.124791181998841694e+01 2.920945459998694815e+01
-9.084975495894715891e+01 2.911881243142321551e+01
-9.057309665143840505e+01 2.920293114956932712e+01
-9.035321593794255080e+01 2.923534329176316149e+01
-9.013842317360349909e+01 2.915864267368514007e+01
-8.999428152226086297e+01 2.935981595810311617e+01
-8.985058777858834844e+01 2.942084266293291250e+01
-8.942472368797095328e+01 2.914368818326398269e+01
-8.921372946448266816e+01 2.909022363268496036e+01
-8.911248001649815365e+01 2.914577486748424207e+01
-8.926980466654657675e+01 2.933276028527795631e+01
-8.953989030127949889e+01 2.948776849251648358e+01
-8.958770381856740528e+01 2.956525217965239349e+01
-8.939060002148103479e+01 2.976574754369590892e+01
-8.933860667313892634e+01 2.986079400404799955e+01
-8.939232904261193369e+01 3.002699701796974097e+01
-8.953594588963265721e+01 3.005549210715095043e+01
-8.966542210709864946e+01 2.998980795752719786e+01
-8.978814584452592840e+01 3.012232607430146203e+01
-8.946870391159208680e+01 3.014596936967535967e+01
-8.930379320428754397e+01 3.027289182604676299e+01
-8.900502063748523085e+01 3.034418408255022115e+01
-8.857874635977265143e+01 3.030061032688917066e+01
-8.809623704864324623e+01 3.033154039183656181e+01
-8.802501196861022947e+01 3.056907140897730812e+01
-8.789874697077230792e+01 3.034511941921267919e+01
-8.775340223454011834e+01 3.025083026988169266e+01
-8.720639460104500529e+01 3.030381951847730804e+01
-8.669107222303033211e+01 3.038365718732831056e+01
-8.612295370998427302e+01 3.027349945795603858e+01
-8.556641023231023269e+01 3.005681556619625638e+01
-8.529270242086715825e+01 2.969966436548420319e+01
-8.501642540475906173e+01 2.966322494460888848e+01
-8.439282003882355809e+01 2.985089855258697966e+01
-8.401057431406476894e+01 2.995502948509635743e+01
-8.359600078543471113e+01 2.978327544241157199e+01
-8.327125334762109787e+01 2.934019921125171493e+01
-8.281528608965852811e+01 2.905841299979536885e+01
-8.270383245966253583e+01 2.864579567826170603e+01
-8.283913187972684966e+01 2.810295484288515411e+01
-8.282214918978306173e+01 2.776874093144901678e+01
-8.258620393349433186e+01 2.718878911462780223e+01
-8.225544663392471989e+01 2.653559009193235241e+01
-8.212900802378828757e+01 2.634847542717850999e+01
-8.194879590455529694e+01 2.633156533220476092e+01
-8.171575017929426110e+01 2.576830568900643570e+01
-8.146345768695761080e+01 2.572167574548958768e+01
-8.122781984513162001e+01 2.530575665547930342e+01
-8.108624750644639789e+01 2.503395598109110409e+01
-8.062776102091079622e+01 2.509733035447997196e+01
-8.030050717440929020e+01 2.525164542434173143e+01
-8.019901565417187328e+01 2.553973502589324696e+01
-8.007933247471184757e+01 2.673366960324988639e+01
-8.018698637463883472e+01 2.719524991458561303e+01
-8.053905328869349489e+01 2.815117199651991342e+01
-8.053560852665424363e+01 2.850676733293487075e+01
-8.101032950475720895e+01 2.924880660221410267e+01
-8.127890178040216540e+01 2.989516562154147650e+01
-8.146179195148538099e+01 3.064826223872979938e+01
-8.136623662467358997e+01 3.112443563025903970e+01
-8.104212919446162289e+01 3.181194638355706772e+01
-8.049657328803348832e+01 3.231500993144578615e+01
-8.091457448419257048e+01 3.824882563596677443e+01
-1.076787642588825378e+02 3.091785019754685493e+01
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

1
46 1
-8.048928650039832178e+01 3.227008846172262935e+01
-7.989260890234626800e+01 3.264381376812333002e+01
-7.941954553313249221e+01 3.297828653048026126e+01
-7.923922872805712814e+01 3.306216122336018515e+01
-7.916673832823730095e+01 3.315515790631467752e+01
-7.910876975694748126e+01 3.339640030497714207e+01
-7.888765073857615562e+01 3.362993343462726870e+01
-7.865402481057284945e+01 3.377938662439957085e+01
-7.828515102509119572e+01 3.386741045298854402e+01
-7.802004745459218782e+01 3.383537543525831381e+01
-7.788088485485695855e+01 3.385165006206131721e+01
-7.790634947774587715e+01 3.391575959937281226e+01
-7.775966289484028948e+01 3.418444546226683656e+01
-7.748628895854191967e+01 3.442973010166616632e+01
-7.712312717001998408e+01 3.459836979450405892e+01
-7.670139839003050497e+01 3.466323070733447054e+01
-7.659825241800164974e+01 3.459990427180075301e+01
-7.649607248093190037e+01 3.458178293090288946e+01
-7.642758129557051916e+01 3.469910720492691780e+01
-7.606241507926569057e+01 3.497468551531686387e+01
-7.566267764060452805e+01 3.518464607905161756e+01
-7.546561419454484110e+01 3.522439884844919789e+01
-7.540458267320846630e+01 3.565178623201529717e+01
-7.554954202202192448e+01 3.595538702773972517e+01
-7.583497467100808365e+01 3.657497544706806281e+01
-7.594299473595445704e+01 3.687181994945478891e+01
-7.585671546972488954e+01 3.708599725886935516e+01
-7.562489564518999430e+01 3.740448667142256056e+01
-7.533504136064613022e+01 3.794265973282713844e+01
-7.508193879915289415e+01 3.830539709886655686e+01
-7.461717929680993677e+01 3.916512858332438896e+01
-7.418035111435519013e+01 3.953801171004356974e+01
-7.398074431111538729e+01 4.003441749456466425e+01
-7.393308010666254404e+01 4.038966548280145474e+01
-7.387177792071923932e+01 4.051194852936622937e+01
-7.350575932704909121e+01 4.057245809807616155e+01
-7.263318736901798900e+01 4.076477366362301780e+01
-7.184539938890051758e+01 4.104329861604092855e+01
-7.041608102375172962e+01 4.131840255192751243e+01
-6.993720533396106021e+01 4.162787762763397126e+01
-6.984079525476329309e+01 4.186268652064790530e+01
-7.003787955245284991e+01 4.211050568051889798e+01
-7.049847970909966932e+01 4.271765331279753042e+01
-7.551363668806983753e+01 4.224912106833051695e+01
-8.086588389879713645e+01 4.069144640587840911e+01
-8.273594636229749710e+01 3.512614806209300156e+01
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pyschism.mesh import Hgrid
from pyschism.mesh.gridgr3 import Shapiro

if __name__ == '__main__':
hgrid = Hgrid.open('./hgrid.gr3', crs='EPSG:4326')

shapiro_max = 0.5
threshold_slope = 0.5
depths = [-99999, 20, 50] # tweaks in shallow waters
shapiro_vals1 = [0.2, 0.2, 0.05] # tweaks in shallow waters
regions = [
f'./coastal_0.2.cpp.reg',
f'./coastal_0.5_1.cpp.reg',
f'./coastal_0.5_2.cpp.reg'
] # tweaks in regions, the order matters
shapiro_vals2 = [0.2, 0.5, 0.5] # tweaks in regions, the order matters
i_set_add_s = [0, 0, 0]

shapiro = Shapiro.slope_filter(
hgrid, shapiro_vals1, depths, shapiro_max, threshold_slope,
regions, shapiro_vals2, i_set_add_s, lonc=-77.07, latc=24.0)
shapiro.write('shapiro.gr3', overwrite=True)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD_1983_UTM_Zone_18N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-75.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Intersecting SCHISM land boundary and NWM river segments and set sources/sinks a

Step 2: Relocate
(for v6) Relocating sources to match the resolved river channels in the SCHISM grid.
this generates "relocate_map.txt", needed by the operational forecast.

Step 3: Constant_sinks
set constant sinks, including pumps in cities and background sinks.
this generates "pump_sinks.txt", needed by the operational forecast.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python3

from schism_py_pre_post.Grid.SourceSinkIn import source_sink, SourceSinkIn
from schism_py_pre_post.Grid.SMS import lonlat2cpp
from schism_py_pre_post.Timeseries.TimeHistory import TimeHistory
from schism_py_pre_post.Grid.Hgrid_extended import read_schism_hgrid_cached
from spp_essentials.Hgrid_extended import read_schism_hgrid_cached
import numpy as np
from scipy import spatial
import pickle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
import pandas as pd

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import setuptools
import io

with io.open('README.md','r', encoding='utf8') as fh:
long_description = fh.read()

setuptools.setup(
name='stofs3d_atlantic_preproc',
version='0.0.1',
description='Python tools for generating inputs for STOFS3D-ATL',
long_description=long_description,
long_description_content_type="text/markdown",
url='',
project_urls = {
"Issues": ""
},
license='MIT',
packages=[
'',
],
package_data={},
install_requires=[
'numpy',
'pandas',
'gdal>=3.6.0',
'shapely>=2.0.0',
'geopandas>=0.12.0',
],
)
Loading

0 comments on commit 47ad2ce

Please sign in to comment.