Skip to content

Commit

Permalink
improve ext
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Jan 11, 2024
1 parent e7a0b01 commit 0cc058c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ext/RbaseTerraExt/RbaseTerraExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ export RbaseTerraExt
module RbaseTerraExt

using DataFrames
using RCall, NetCDFTools
using RCall
using NetCDFTools
import NetCDFTools: exact_extract, coverage_fraction


function init_pkgs()
R"""
Expand Down Expand Up @@ -61,7 +64,7 @@ date = nc_date(f);
# heatmap(data[:, :, 1]', yflip=true);
```
"""
function NetCDFTools.exact_extract(data, lon, lat, shp, date=nothing; plot=false)
function exact_extract(data, lon, lat, shp, date=nothing; plot=false)
cellx = diff(lon[1:2])[1]
celly = diff(lat[1:2])[1]

Expand Down Expand Up @@ -112,7 +115,7 @@ fout = "Z:/ERA5/ChinaHI_hourly/OUTPUT/ChinaDaily_ERA5_HI_ALL_2022_masked.nc"
nc_write!(fout, data2, ncvar_dim(f))
```
"""
function NetCDFTools.coverage_fraction(f, shp; union=false)
function coverage_fraction(f, shp; union=false)
init_pkgs()

info = R"""
Expand Down

0 comments on commit 0cc058c

Please sign in to comment.