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

Backtracking wind blow model #1243

Open
jacktang opened this issue Mar 6, 2024 · 1 comment
Open

Backtracking wind blow model #1243

jacktang opened this issue Mar 6, 2024 · 1 comment

Comments

@jacktang
Copy link

jacktang commented Mar 6, 2024

Hello,

I try to backtrack the wind blow model. The forward processes is described at https://opendrift.github.io/gallery/example_windblow.html. I used the backwards simulation method. But it couldn't find the possible source(16, 68.5) in the forward process.

image

And the code is quite simple:

o = WindBlow(loglevel=50)
reader_arome = reader_netCDF_CF_generic.Reader('wind-fwd.nc') # wind-fwd.nc is generated from forward process

o.add_reader([reader_arome])

duration = timedelta(hours=48)
start_time = reader_arome.start_time
end_time = start_time + duration

object_type = 26  # 26 = Life-raft, no ballast
outfile = 'wind-init.nc'
ilon = 19  # Incident position
ilat = 70.02
text = [{'s': 'Observation', 'x': ilon, 'y': ilat, 'fontsize': 20, 'color': 'g', 'zorder': 1000}]

# Define domain of possible origin
lons = np.arange(13, 19.5, .1/20)
lats = np.arange(68, 70.5, .1/20)
corners = [lons[0], lons[-1], lats[0], lats[-1]]
lons, lats = np.meshgrid(lons, lats)


o.seed_elements(lon=ilon, lat=ilat, radius=1000, radius_type='uniform', number=30000, time=end_time)
o.run(duration=duration, time_step=-900, time_step_output=3600, outfile=outfile)
od = opendrift.open_xarray(outfile)
density_backwards = od.get_histogram(pixelsize_m=5000).isel(time=-1).isel(origin_marker=0)
density_backwards = density_backwards.where(density_backwards>0)
density_backwards = density_backwards/density_backwards.sum()*100
vmax = density_backwards.max()
o.plot(background=density_backwards, clabel='Probability of origin [%]', text=text, corners=corners, fast=True, markersize=.5, lalpha=.02, vmin=0, vmax=vmax)
os.remove(outfile)

Could you please give me some hits how to fix it? Thanks!

@knutfrode
Copy link
Collaborator

You should change loglevel to 0, so that you can see if something went wrong during simulation.
E.g. you are using a custom file for wind, so something might perhaps be wrong with this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants