euroargodev / terrain-following Goto Github PK
View Code? Open in Web Editor NEWThis is the terrain-following interpolation algorithm documented in Yamazaki+(2020) https://doi.org/10.1029/2019JC015406.
This is the terrain-following interpolation algorithm documented in Yamazaki+(2020) https://doi.org/10.1029/2019JC015406.
This is a readme file for the terrain-following interpolation algorithm documented in Yamazaki+(2020) https://doi.org/10.1029/2019JC015406. The codes are originally designed to be applied for Argo data in *_prof.nc format fetched from Argo Global Data Assembly Center. interpolation_v2.py ...the interpolation algorithm with some plotting function. This is slightly modified from Yamazaki+(2020) for clarity of the scheme and customizability. Test trajectory data (testData.csv) is included in this folder, which can be directly loaded to interpolation_v2.py. The result of interpolation for test data is shown in two .png files. Following codes would help pre-processing of the trajectory data: nc2csv.py ...extract trajectory data and position quality flag (qpos) from netcdf file in the Argo profile format (*_prof.nc). process.py ...change id for data seeming sequential as trajectory by id-cast but problematic in lon-lat coords. For a trial, you can interpolate testData.csv with the GEBCO 1arcmin topography (GRIDONE_1D.nc), which you may find at: https://drive.google.com/drive/folders/14RizKyM064OsjEo5J0u0RtzdveD_mU-j?usp=sharing The result of interpolation is presented in two .png files, in which interpolated positions (green) seem to follow the isobaths. (Yellow points are linearly interpolated positions, while not all position-lacking data have linearly interpolated positions by default.) This scheme is slightly modified from Yamazaki+(2020), such that the "backward revision" for interpolated positions obtained by forwarding interpolation (Fig.A, panels c-d) is replaced with the "weighted average" for the forwarding and backwarding interpolations, with a weighting function defined from inverted distances from the first and last points of the interpolation section. This modification greatly reduces "asymmetry" in interpolated positions, which can result in sharp artificial curves near the end of the interpolation section to connect to the positioned point. By customizing the weighting function and tuning parameters (the length of search range and the searching resolution), you may optimize the scheme for your purpose. Correspondence: Kaihe Yamazaki ([email protected]) written in 2019 September, modified in 2022 July.
Hi folks,
Great method you developed here !
Do you mind if we integrate this into the argopy software ?
The new API could look like this:
from argopy import DataFetcher as ArgoDataFetcher
ds = ArgoDataFetcher(mode='expert').float(2900114).load().data
ds = ds.argo.traj_interp_terrain_following()
and the data set would have new LAT_INTERP/LON_INTERP variables with interpolated values
Getting topographic data would be made by argopy as well, so thta users wouldn't have to manage this
Since you work with panda dataframe this could be made quite easily I guess
@KaiheYamazaki (this is not really an issue, I just dont know were eles to put this for my Euro-Argo RISE colleagues!)
Dear all, I know that there are a lot of python newbies so I am just writing here how I use the code
How do I run this code
terrain-following
This is the terrain-following interpolation algorithm documented in Yamazaki+(2020) https://doi.org/10.1029/2019JC015406.
Copy the prof.nc files to the toolbox folder
_this is the folder where I copied the repository _
\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\CodeProjects\terrain-following
Open spyder (in the base environment)
Execute
runfile('nc2csv.py')
runfile('process.py')
runfile('interpolation_v2.py')
Export the results to the desired csv file (I prefer to do it file by file, but it works on many files at the same time)
df.to_csv(path+'TrajectoryCSVinterppos_7900549.csv')
The google drive link to access the gebco data
https://drive.google.com/file/d/1eFhJAV4sruQmOC3e4nK-FUJ8e6MJUnPo/view?usp=sharing
is not working.
But the file should be available here
https://www.gebco.net/data_and_products/gridded_bathymetry_data/#global
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.