liamtoney / infresnel Goto Github PK
View Code? Open in Web Editor NEWComputation of the Fresnel number for infrasound applications
Home Page: https://infresnel.rtfd.io
License: MIT License
Computation of the Fresnel number for infrasound applications
Home Page: https://infresnel.rtfd.io
License: MIT License
This relationship predicts insertion loss using the Fresnel number. Should add some discussion of the limitations of this relationship. Add the Maekawa (1968) reference to the references list, too.
Once this is done, the README should be updated to point to the notebook file(s) and Binder link.
Could start with a simple, general test of calculate_paths()
.
Not a Number (NaN; e.g., np.nan
) values can make their way into input DEMs for infresnel in a few ways. There are no SRTM data at high latitudes (beyond 60° N and 56° S), so the automatic DEM downloader may return NaN values (check this!). Also, a user-supplied DEM may have NaN values either because it contains holes (yikes) or because it has a non-rectangular geometry in the UTM projection (more likely; see the Yasur DEM for example). I see three cases to address:
dem_file=None
and we are totally beyond the SRTM latitude range. We should error out here.For case (3) above, even without holes in the DEM we still have the challenge of fitting the RectBivariateSpline
, which cannot have any NaN values in the input z
. Currently we just replace NaN with 0 everywhere to get around this. However, this is not the best idea since it produces large discontinuities ("cliffs") in elevation where the spline fitting becomes extremely unstable. This can cause the evaluated elevation profiles to have artifacts — which bleeds into the path length computations.
Even though we can skip computing paths for receivers located in NaN regions, receivers just on the edge of the valid (non-NaN) portion of the DEM can still experience edge effects. There are two approaches we can take to avoid this behavior, both which only apply for case (3):
scipy.interpolate.griddata()
. This basically matches the area around the valid portion with similar values. This is obviously not valid far from the valid region, but it should be very effective in stabilizing the spline fitting process. This is slow. It might make sense to downsample the evaluation points xi
for speed, then upsample them to the DEM resolution before adding as the "background" to the DEM to fill the NaN values. This is significantly more work and adds complexity to the code.We can see if this is successful to suppress artifacts; if not then the second of the two approaches above may need to be implemented.
I get an incorrect UTM geodetic(?) CRS for a scenario in Italy. It seems to come from
infresnel/infresnel/infresnel.py
Line 93 in e2ae2b9
where
utm_crs = _estimate_utm_crs(15.2122, 38.7946, datum_name='WGS 84')
which should return a CRS of 33 but instead returns one of 37.
Basically, we should implement a "safety buffer" around the valid-elevation-data borders of such DEMs. I.e., we don't want to compute paths for points near that border. This is mainly relevant for calculate_paths_grid()
.
Not a hugely critical issue since it's usually pretty obvious when this happens. Applying e.g. vmax=np.nanpercentile(path_length_differences, 99)
when creating an image plot works pretty well to suppress these artificially high outliers.
Perhaps just editing the tolerance in this part of the code is enough? E.g. increasing to 2 * mean_resolution
or something... easy to try this out
The main computational expense involved in the code is the DEM interpolation step. There may be ways to expedite this that don't take too much effort to implement.
Docstrings are already formatted for this.
Using Joblib, likely... ostensibly simple to do this.
Sometimes (usually when running infresnel to produce grids) a ZeroDivisionError
occurs. The error is raised during this line:
Line 26 in f0e50fc
Evidently, sometimes the quantity d[-1] - d[0]
is 0. This can occur when the profile spacing (which is currently automatically determined from the DEM spacing) is larger than the requested grid spacing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.