Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vrt_dsn column and use warper for all read #128

Open
mdsumner opened this issue Nov 21, 2022 · 3 comments
Open

add vrt_dsn column and use warper for all read #128

mdsumner opened this issue Nov 21, 2022 · 3 comments

Comments

@mdsumner
Copy link
Member

altimetry_antarctica_daily_files
amps_d1_icefiles
amps_d1files
amps_d2files
amps_model_files
ccmp_files
chla_johnsonfiles
chlafiles
cpolarfiles
cpolarfiles_old
currentsfiles
derivaadcfiles
derivicefiles
fasticefiles
ghrsstfiles
icefiles
nsidc_north_monthly_files
nsidc_south_monthly_files
oc_sochla_files
ocfiles
rapid_responsefiles
salfiles
sshfiles
sstfiles
windfiles

@mdsumner
Copy link
Member Author

mdsumner commented Feb 14, 2023

here is an example of the new read scheme

 files <- sstfiles()
## these are fully expanded VRT chunks (but with GDAL 3.7 we'll replace with vrt:// syntax)
f <- files$vrt_dsn[1:10]
a <- lapply(f, vapour:::gdal_raster_data, target_ext  = c(100, 220, -60, -10))

Each element now has its target extent, dimension, projection (use arguments target_dim, target_ext, target_crs above)

vapour:::imfun(a[[1]])

image

When we only specify extent it's not aligned to the source (but happens to be here because we chose aligned numbers).

x <- a[[1]]
vaster::x_res(attr(x, "dimension"), attr(x, "extent"))
[1] 0.25
vaster::y_res(attr(x, "dimension"), attr(x, "extent"))
[1] 0.25

If we say "_dsn" rather than "_data" we get a file name (or specify one)

 files <- sstfiles()
## these are fully expanded VRT chunks (but with GDAL 3.7 we'll replace with vrt:// syntax)
f <- files$vrt_dsn[1:10]
a <- lapply(f, vapour:::gdal_raster_dsn, target_ext  = c(100, 220, -60, -10))

image

TODO:

  • the file target stuff needs to be able to add multiple bands to a single tif (or netcdf maybe)
  • if only extent is provided we should align to source
  • other cases, by argument "align" ?

@mdsumner mdsumner changed the title add vrt_dsn column to files funs add vrt_dsn column and use warper for all read Feb 14, 2023
@mdsumner
Copy link
Member Author

this is now started for readsst() and sstfiles() in branch 'gdal-new-world' - it works for daily and monthly, but still a bit live in terms of working out various issues

@mdsumner
Copy link
Member Author

there's now no special need for 'lon180', just give it what you want (we can't reproject with the raadtools functions, I'm not sure that's going to be a good idea - review once rolled out over other funs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant