Giter Club home page Giter Club logo

terrain-following's Introduction

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.

terrain-following's People

Contributors

kaiheyamazaki avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

naomikrauzig

terrain-following's Issues

Include in argopy as inner function

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

For python newbies

@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')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.