reshape_SINMOD: Subset a SINMOD file to depth-averaged water velocities in an...

View source: R/SEDIMENT functions.R

reshape_SINMODR Documentation

Subset a SINMOD file to depth-averaged water velocities in an area.

Description

This function is a wrapper for system calls to NCO functions. A single SINMOD netcdf file contains a large grid covering the Arctic with extra variables we don't need. This function crops the spatial extent, performs a weighted average across depth layers, and limits to variables 'u_east' and 'v_north'.

Usage

reshape_SINMOD(path, file, out_dir, window)

Arguments

path

a character string directing to the source file location.

file

the name of a netcdf file to process.

out_dir

a character string directing to the folder the new files should be written to.

window

a named list containing 'xmin', 'xmax', 'ymin', 'ymax', the indices of the window to crop to.

Details

Performing the reshaping directly on the netcdf files means I can host a small subset locally on my machine. This avoids costly queries to the idrive later on. These files can also then be concatenated into a single netcdf file, allowing data to be read into R pixel by pixel, unlike saving a clipped dataframe as a .rds object.

Value

A netcdf file containing depth averaged UV water velocities cropped to the target window.

See Also

Other water movements: get_bed_shear_stress(), get_tides_ts(), get_waves_ts(), sample_tides_year(), sample_waves()


Jack-H-Laverick/MiMeMo.tools documentation built on March 6, 2023, 3:44 p.m.