Skip to content

Modified generalWrangleRadar.R#1

Open
LaMargna wants to merge 1 commit intomasterfrom
work_on_generalWrangleRadar
Open

Modified generalWrangleRadar.R#1
LaMargna wants to merge 1 commit intomasterfrom
work_on_generalWrangleRadar

Conversation

@LaMargna
Copy link
Collaborator

Commented out some code I blieve not yet needed
Made projection strings global (for now)
Closed open netcdf files when no more needed
added a function “makeCellfunction” that as a function of a netcdf file creates a function mapping the Dutch grid (global SOURCE string) to the polar stereographic coordinate in the TARGET string (not yet obtained from the netcdf)

Commented out some code I blieve not yet needed
Made projection strings global (for now)
Closed open netcdf files when no more needed
added a function “makeCellfunction” that as a function of a netcdf file creates a function mapping the Dutch grid (global SOURCE string) to the polar stereographic coordinate in the TARGET string (not yet obtained from the netcdf)
@LaMargna
Copy link
Collaborator Author

Commented out

library(sp)  
library(raster)

and

coordinates(pointDF)<-~pointX+pointY  
crs(pointDF)<-RDH

I don't think these are needed now (but might be later, so keep the comments). I try to use as minimal code as possible

I changed the references RDH and polar to SOURCE and TARGET, the idea being that we might end up with a more general code. I also defined SOURCE and TARGET globally for now.

I added two more global variables to aide development

exampleNetCDFfile <- "./KNMIdata/PrecipitationRadar/KNMI-Data/RAD_NL25_RAC_MFBS_5min_201501312355.nc"  
filepath <- exampleNetCDFfile

(maybe put the exampleNetCDFfile file itself somewhere else in the tree. I suggest to keep the original name. Odd path anyway now I see it written down: KNMIdata/.../KNMI-Data/....). Can you plaese add a KNMI netCDF file there?

I modified findCells and named that function makeCellfunction. findCells will serve its purpose when we are going to access the NetCDF files directly, for now I think for performance reasons I will focus on precipitation data using a key-value table (time, i, j, value) only.

makeCellfunction returns a function.

Btw: I think we made an error with the y-index (is still in findCells). I think, please check this, that the top row of the matrix is associated with the highest y-values. This is different from the x-values. In fact it may actually be the first column. I think we need to determine which dimension is which in the "variableOfInterest" (whether "y" is the first dimension in the variableOfInterest) from the NetCDF meta data some time.

I left getMetaDataNetCDF intact.

At some places I closed open NetCDF files when (I think) they are no more needed.

@LaMargna LaMargna closed this Jul 11, 2017
@LaMargna
Copy link
Collaborator Author

One error already, the path "KNMIdata/.../KNMI-Data/...." has already changed

@LaMargna LaMargna reopened this Jul 11, 2017
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

Successfully merging this pull request may close these issues.

1 participant