rustychris / stomel

Spatial tools for ocean modeling in python
GNU General Public License v2.0
10 stars 6 forks source link

Grid alignment #3

Open fdongyu opened 7 years ago

fdongyu commented 7 years ago

Hi Dr. Holleman, I apologize for opening an issue here. This grid generation tool is great. I read your paper about grid alignment. This seems really important when there exists deep channels. There seems to be no guidance in the tutorial about how to align the grid. I tried by myself by adding a line to map and treat the line as an island, something like this: rings=[boundary,island]. But this did not work. Attached is the figure that shows the map. boundary

I was wondering if you can give me some hints about the grid alignment. Thank you so much for your help. Below is part of the script I am using, bg_scale = 800np.ones(len(bg)) inner_scale = 200np.ones(len(inner)) lin_scale=constrained_delaunay.ConstrainedXYZField.from_polylines([bg, inner],[bg_scale,inner_scale]) rings = [boundary, island]

p = paver.Paving(rings=rings, density=lin_scale) p.pave_all()

rustychris commented 7 years ago

I am assuming you've been able to generate a grid without the island for alignment -- if not, that's certainly a good starting point before exploring alignment.

Internal curves for alignment should be specified in the 'degenerates' parameter to Paving. I have mostly tested this with isolated polylines. You'll have the best luck if the polyline ends at least a few cells from the outside boundary. The northern end of your channel may need to be trimmed back to give some spaced between it and the boundary.

Best, Rusty

On Fri, Feb 10, 2017 at 9:58 AM, fdongyu notifications@github.com wrote:

Hi Dr. Holleman, I apologize for opening an issue here. This grid generation tool is great. I read your paper about grid alignment. This seems really important when there exists deep channels. There seems to be no guidance in the tutorial about how to align the grid. I tried by myself by adding a line to map and treat the line as an island, something like this: rings=[boundary,island]. But this did not work. Attached is the figure that shows the map. [image: boundary] https://cloud.githubusercontent.com/assets/10620053/22837622/07294864-ef87-11e6-95e4-989a98a93bae.png

I was wondering if you can give me some hints about the grid alignment. Thank you so much for your help. Below is part of the script I am using,

bg_scale = 800 np.ones(len(bg)) inner_scale = 200np.ones(len(inner)) lin_scale=constrained_delaunay.ConstrainedXYZField.from_polylines([bg, inner],[bg_scale,inner_scale]) rings = [boundary, island]

p = paver.Paving(rings=rings, density=lin_scale) p.pave_all()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rustychris/stomel/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AFPmE6u64QlncZyObw2VeyItgoqYUQ49ks5rbKVEgaJpZM4L9rAH .

fdongyu commented 7 years ago

That works perfectly! Thanks a lot.

Best, Dongyu