run_swath2grid, error ub
Opened this issue · 1 comments
Dear Dr. Matzke,
I am trying to extract the cloud frequency and I saw your package that seems that meet all that I need. Thank you for creating it.
Working on your examples in the conversion of hdf to tif I get an error that I cannot solve myself. This is not a file problem since I can convert your images using MRTSwath tool manually.
Using your the example of your package:
run_swath2grid(mrtpath="swath2grid", prmfn="tmpMRTparams.prm", tifsdir=tifsdir, modfn=fns_df$mod35_L2_fns[i], geoloc_fn=fns_df$mod03_fns[i], ul_lon=ul_lon, ul_lat=ul_lat, lr_lon=lr_lon, lr_lat=lr_lat)
I get an error that says:
Error in system(paste("which ", mrtpath, sep = ""), intern = TRUE) :
'which' not found
I work directory is in MRTSwath/bin, therefore, I assume that mrtpath need to be as your example.
Do you have any idea of why I get this error?
Thanks in advance!!
Hi -- wow, I'm glad you found this, I did this as a one-off many years back and it still gets used!
Re: that error, the "system()" command is where R sends a command to your machine's Terminal/Command Prompt.
So, the program is sending something like "which swath2grid" to the command-line outside of R, and the operating system is returning "'which' not found", which suggests that the command "which" doesn't exist in your operating system.
I was using a Mac when I wrote it, I'm not sure what you are using. You might try changing:
run_swath2grid(mrtpath="swath2grid", ...
to
run_swath2grid(mrtpath="/MRTSwath/bin/swath2grid", ...
...or something like that. Or you can type
run_swath2grid
...copy the function code to a new .R file, modify it to find wherever your swath2grid is, and call it run_swath2grid2, and then use something like:
source("run_swath2grid2.R")
...to use that new function.
Cheers,
Nick