[Scilab-users] Using Scinetcdf module
Hello all I am looking to use the sciNetCDF module to work with GMT grid files but have some issues. Reading a GMT grid is not a problem as far as I can tell, so the following does read the file (and z variable), storing the values in the grav array: source = fullfile('Q:\geophys\Gz.grd') grav = ncread(source,'z') Hy = hilbert(grav); // write Hy variable to new file I am having problems with writing out the processed data e.g write a new grid (Gz_Hy.grd) with the Hilbert transform solution filename = fullfile('Q:\geophys\Gz_Hy.grd') ncwrite(filename, 'Hy') // does not work Error return: ncwrite(filename, 'Hy') !--error 77 ncwrite: Wrong number of input argument(s): 3 to 5 expected. at line 5 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) Any advice would be appreciated. Thanks Lester ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] Hilbert transform query
Hello A quick query. How would one define the Hilbert transform of a grid for X and Y directions; looking for two solutions Hx and Hy (for the real values). Thanks Lester ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Hello Harpreet, I altered the code a bit but still get a problem Hy = hilbert(grav); filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename // ncwrite(filename, varname, vardata, [start, [stride]]) ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy Error message: ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy !--error 999 ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not found. at line 6 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) In this case I want to define a variable name Hilb_Hy (although can use any name really) in the netCDF file and write the output of the Hilbert (Hy) transform. Cannot see the solution On 5 February 2016 at 10:15, Harpreet Singh Rathorewrote: > Dear Lester, > > As I can see the error is saying minimum 3 inputs are required. And after > going through the help of the following function, you also have to pass the > value which you have to store in the 'Hy'. You can go through the help files > of ncwrite by typing help ncwrite in the console. > > Regards > Harpreet > > On Fri, Feb 5, 2016 at 3:18 PM, Lester Anderson > wrote: >> >> Hello all >> >> I am looking to use the sciNetCDF module to work with GMT grid files >> but have some issues. >> >> Reading a GMT grid is not a problem as far as I can tell, so the >> following does read the file (and z variable), storing the values in >> the grav array: >> >> source = fullfile('Q:\geophys\Gz.grd') >> grav = ncread(source,'z') >> Hy = hilbert(grav); // write Hy variable to new file >> >> I am having problems with writing out the processed data e.g write a >> new grid (Gz_Hy.grd) with the Hilbert transform solution >> >> filename = fullfile('Q:\geophys\Gz_Hy.grd') >> ncwrite(filename, 'Hy') // does not work >> >> Error return: >> >> ncwrite(filename, 'Hy') >>!--error 77 >> ncwrite: Wrong number of input argument(s): 3 to 5 expected. >> at line 5 of exec file called by : >> exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) >> >> Any advice would be appreciated. >> >> Thanks >> Lester >> ___ >> users mailing list >> users@lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > > > > -- > Thanks and Regards > Harpreet Singh > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Hi Simon, Hy is a matrix and the input grid used has dimensions of 601 x 601 (x,y). Reading the data in is fine and the matrix is as expected in the variable browser. grav = ncread(source,'z') is all fine with a 601 x 601 matrix Create variable Hilb_Hy: nccreate(filename,'Hilb_Hy','Dimensions',list('r',601,'c',601)) !--error 999 nccreate: nc_def_var() returned the error -42: NetCDF: String match to name in use. Do you have an example grid to test the read and write function. Would it help to send you a copy of the grid file? Thanks On 5 February 2016 at 10:46, Harpreet Singh Rathorewrote: > Hey > > You have not created the variable in the file. First you have to create a > variable in the following file using the command nccreate(filename, > 'Hilb_Hy', 'Dimensions', list('r', no_row, 'c', no_column); after that you > can pass the ncwrite command and you have to pass like this > ncwrite(filename, 'Hilb_Hy',Hy) as Hy is a matrix. > > Regards > Harpreet Singh > > On Fri, Feb 5, 2016 at 4:01 PM, Lester Anderson > wrote: >> >> Hello Harpreet, >> >> I altered the code a bit but still get a problem >> >> Hy = hilbert(grav); >> filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename >> // ncwrite(filename, varname, vardata, [start, [stride]]) >> ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from >> Hy >> >> Error message: >> >> ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from >> Hy >> !--error 999 >> ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not >> found. >> at line 6 of exec file called by : >> exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) >> >> In this case I want to define a variable name Hilb_Hy (although can >> use any name really) in the netCDF file and write the output of the >> Hilbert (Hy) transform. >> >> Cannot see the solution >> >> >> >> On 5 February 2016 at 10:15, Harpreet Singh Rathore >> wrote: >> > Dear Lester, >> > >> > As I can see the error is saying minimum 3 inputs are required. And >> > after >> > going through the help of the following function, you also have to pass >> > the >> > value which you have to store in the 'Hy'. You can go through the help >> > files >> > of ncwrite by typing help ncwrite in the console. >> > >> > Regards >> > Harpreet >> > >> > On Fri, Feb 5, 2016 at 3:18 PM, Lester Anderson >> > wrote: >> >> >> >> Hello all >> >> >> >> I am looking to use the sciNetCDF module to work with GMT grid files >> >> but have some issues. >> >> >> >> Reading a GMT grid is not a problem as far as I can tell, so the >> >> following does read the file (and z variable), storing the values in >> >> the grav array: >> >> >> >> source = fullfile('Q:\geophys\Gz.grd') >> >> grav = ncread(source,'z') >> >> Hy = hilbert(grav); // write Hy variable to new file >> >> >> >> I am having problems with writing out the processed data e.g write a >> >> new grid (Gz_Hy.grd) with the Hilbert transform solution >> >> >> >> filename = fullfile('Q:\geophys\Gz_Hy.grd') >> >> ncwrite(filename, 'Hy') // does not work >> >> >> >> Error return: >> >> >> >> ncwrite(filename, 'Hy') >> >>!--error 77 >> >> ncwrite: Wrong number of input argument(s): 3 to 5 expected. >> >> at line 5 of exec file called by : >> >> exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) >> >> >> >> Any advice would be appreciated. >> >> >> >> Thanks >> >> Lester >> >> ___ >> >> users mailing list >> >> users@lists.scilab.org >> >> http://lists.scilab.org/mailman/listinfo/users >> > >> > >> > >> > >> > -- >> > Thanks and Regards >> > Harpreet Singh >> > >> > ___ >> > users mailing list >> > users@lists.scilab.org >> > http://lists.scilab.org/mailman/listinfo/users >> > >> ___ >> users mailing list >> users@lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > > > > -- > Thanks and Regards > Harpreet Singh > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Hilbert transform query
Le 05/02/2016 10:56, Lester Anderson a écrit : Hello A quick query. How would one define the Hilbert transform of a grid for X and Y directions; looking for two solutions Hx and Hy (for the real values). Can you explain more precisely what you expect? Do you want to apply Hilbert transform to each column and to each rows or to perform a 2D Hilbert transform? Serge Thanks Lester ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Hilbert transform query
Hi Serge, I am working with grid data, so looking for the 2D Hilbert, the results I think should appear similar to doing a directional derivative, where X highlights features with N-S trends and E-W for Y. Lester On 5 February 2016 at 12:24, Serge Steerwrote: > Le 05/02/2016 10:56, Lester Anderson a écrit : >> >> Hello >> >> A quick query. How would one define the Hilbert transform of a grid >> for X and Y directions; looking for two solutions Hx and Hy (for the >> real values). > > Can you explain more precisely what you expect? > Do you want to apply Hilbert transform to each column and to each rows or > to perform a 2D Hilbert transform? > Serge >> >> >> Thanks >> Lester >> ___ >> users mailing list >> users@lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users >> > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Hi Simon, Sorted it now: source = fullfile('Q:\geophys\Gz.grd') grav = ncread(source,'z') // read the gravity data from GMT grid Hy = hilbert(grav); // do some math on the grid filename = fullfile('Q:\geophys\Gz_Hy_testprog.grd') nccreate(filename,'Hilb_Hy','Dimensions',list('r',601,'c',601)) // define variable Hilb_Hy and grid dimensions ncwrite(filename, 'Hilb_Hy',Hy) // write variable Hilb_Hy with data from Hy One query is how to make it store the Longitude and Latitude values rather than a cartesian? From GMT the grdinfo results for the original grid are: grdinfo gz.grd gz.grd: Title: Grid computed inside Mirone gz.grd: Command: gz.grd: Remark: File written from Matlab gz.grd: Gridline node registration used [Geographic grid] gz.grd: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5 gz.grd: x_min: 5.008 x_max: 15.008333 x_inc: 0.01667 name: longitude [degrees_east] nx: 601 gz.grd: y_min: -5.9916667 y_max: 4.008 y_inc: 0.01667 name: latitude [degrees_north] ny: 601 gz.grd: z_min: -48.2753601074 z_max: 143.910430908 name: z [unknown] gz.grd: scale_factor: 1 add_offset: 0 gz.grd: format: classic The computed grid results from Scilab give: grdinfo Gz_Hy_testprog5.grd Gz_Hy_testprog5.grd: Title: Gz_Hy_testprog5.grd: Command: Gz_Hy_testprog5.grd: Remark: Gz_Hy_testprog5.grd: Gridline node registration used [Cartesian grid] Gz_Hy_testprog5.grd: Grid file format: nd = GMT netCDF format (64-bit float), COARDS, CF-1.5 Gz_Hy_testprog5.grd: x_min: 0 x_max: 600 x_inc: 1 name: nx: 601 Gz_Hy_testprog5.grd: y_min: 0 y_max: 600 y_inc: 1 name: ny: 601 Gz_Hy_testprog5.grd: z_min: NaN z_max: NaN name: Hilb_Hy Gz_Hy_testprog5.grd: scale_factor: 1 add_offset: 0 Gz_Hy_testprog5.grd: format: netCDF-4 chunk_size: 0,0 shuffle: off deflation_level: 0 Do you have to assign variables for the X, Y and Z. Thanks On 5 February 2016 at 13:03, Simon Marchettowrote: > The error message means that the variable is already created, you cannot > create it twice. > > Delete the file, and try again. > > > An example of grid writing, taken from the ncwrite() help page: > > nccreate(filename, 'mat', 'Dimensions', list('r', 3, 'c', 4)); > ncwrite(filename, 'mat', [1 2 3 4; 5 6 7 8; 9 10 11 12]); > > And to read it: > > ncread(filename, 'mat'); > > Simon > > > Le 05/02/2016 12:26, Lester Anderson a écrit : >> >> Hi Simon, >> >> Hy is a matrix and the input grid used has dimensions of 601 x 601 >> (x,y). Reading the data in is fine and the matrix is as expected in >> the variable browser. >> >> grav = ncread(source,'z') is all fine with a 601 x 601 matrix >> >> Create variable Hilb_Hy: >> >> nccreate(filename,'Hilb_Hy','Dimensions',list('r',601,'c',601)) >> !--error >> 999 >> nccreate: nc_def_var() returned the error -42: NetCDF: String match to >> name in use. >> >> Do you have an example grid to test the read and write function. >> >> Would it help to send you a copy of the grid file? >> >> Thanks >> >> On 5 February 2016 at 10:46, Harpreet Singh Rathore >> wrote: >>> >>> Hey >>> >>> You have not created the variable in the file. First you have to create a >>> variable in the following file using the command nccreate(filename, >>> 'Hilb_Hy', 'Dimensions', list('r', no_row, 'c', no_column); after that >>> you >>> can pass the ncwrite command and you have to pass like this >>> ncwrite(filename, 'Hilb_Hy',Hy) as Hy is a matrix. >>> >>> Regards >>> Harpreet Singh >>> >>> On Fri, Feb 5, 2016 at 4:01 PM, Lester Anderson >>> wrote: Hello Harpreet, I altered the code a bit but still get a problem Hy = hilbert(grav); filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename // ncwrite(filename, varname, vardata, [start, [stride]]) ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy Error message: ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy !--error 999 ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not found. at line 6 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) In this case I want to define a variable name Hilb_Hy (although can use any name really) in the netCDF file and write the output of the Hilbert (Hy) transform. Cannot see the solution On 5 February 2016 at 10:15, Harpreet Singh Rathore wrote: > > Dear Lester, > > As I can see the error is saying minimum 3 inputs are required. And > after > going through the help of the following function, you also have to pass > the > value which you have to store in the 'Hy'. You can go through the
Re: [Scilab-users] Using Scinetcdf module
The error message means that the variable is already created, you cannot create it twice. Delete the file, and try again. An example of grid writing, taken from the ncwrite() help page: nccreate(filename, 'mat', 'Dimensions', list('r', 3, 'c', 4)); ncwrite(filename, 'mat', [1 2 3 4; 5 6 7 8; 9 10 11 12]); And to read it: ncread(filename, 'mat'); Simon Le 05/02/2016 12:26, Lester Anderson a écrit : Hi Simon, Hy is a matrix and the input grid used has dimensions of 601 x 601 (x,y). Reading the data in is fine and the matrix is as expected in the variable browser. grav = ncread(source,'z') is all fine with a 601 x 601 matrix Create variable Hilb_Hy: nccreate(filename,'Hilb_Hy','Dimensions',list('r',601,'c',601)) !--error 999 nccreate: nc_def_var() returned the error -42: NetCDF: String match to name in use. Do you have an example grid to test the read and write function. Would it help to send you a copy of the grid file? Thanks On 5 February 2016 at 10:46, Harpreet Singh Rathorewrote: Hey You have not created the variable in the file. First you have to create a variable in the following file using the command nccreate(filename, 'Hilb_Hy', 'Dimensions', list('r', no_row, 'c', no_column); after that you can pass the ncwrite command and you have to pass like this ncwrite(filename, 'Hilb_Hy',Hy) as Hy is a matrix. Regards Harpreet Singh On Fri, Feb 5, 2016 at 4:01 PM, Lester Anderson wrote: Hello Harpreet, I altered the code a bit but still get a problem Hy = hilbert(grav); filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename // ncwrite(filename, varname, vardata, [start, [stride]]) ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy Error message: ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy !--error 999 ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not found. at line 6 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) In this case I want to define a variable name Hilb_Hy (although can use any name really) in the netCDF file and write the output of the Hilbert (Hy) transform. Cannot see the solution On 5 February 2016 at 10:15, Harpreet Singh Rathore wrote: Dear Lester, As I can see the error is saying minimum 3 inputs are required. And after going through the help of the following function, you also have to pass the value which you have to store in the 'Hy'. You can go through the help files of ncwrite by typing help ncwrite in the console. Regards Harpreet On Fri, Feb 5, 2016 at 3:18 PM, Lester Anderson wrote: Hello all I am looking to use the sciNetCDF module to work with GMT grid files but have some issues. Reading a GMT grid is not a problem as far as I can tell, so the following does read the file (and z variable), storing the values in the grav array: source = fullfile('Q:\geophys\Gz.grd') grav = ncread(source,'z') Hy = hilbert(grav); // write Hy variable to new file I am having problems with writing out the processed data e.g write a new grid (Gz_Hy.grd) with the Hilbert transform solution filename = fullfile('Q:\geophys\Gz_Hy.grd') ncwrite(filename, 'Hy') // does not work Error return: ncwrite(filename, 'Hy') !--error 77 ncwrite: Wrong number of input argument(s): 3 to 5 expected. at line 5 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) Any advice would be appreciated. Thanks Lester ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -- Thanks and Regards Harpreet Singh ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -- Thanks and Regards Harpreet Singh ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Dear Lester, As I can see the error is saying minimum 3 inputs are required. And after going through the help of the following function, you also have to pass the value which you have to store in the 'Hy'. You can go through the help files of ncwrite by typing *help ncwrite* in the console. Regards Harpreet On Fri, Feb 5, 2016 at 3:18 PM, Lester Andersonwrote: > Hello all > > I am looking to use the sciNetCDF module to work with GMT grid files > but have some issues. > > Reading a GMT grid is not a problem as far as I can tell, so the > following does read the file (and z variable), storing the values in > the grav array: > > source = fullfile('Q:\geophys\Gz.grd') > grav = ncread(source,'z') > Hy = hilbert(grav); // write Hy variable to new file > > I am having problems with writing out the processed data e.g write a > new grid (Gz_Hy.grd) with the Hilbert transform solution > > filename = fullfile('Q:\geophys\Gz_Hy.grd') > ncwrite(filename, 'Hy') // does not work > > Error return: > > ncwrite(filename, 'Hy') >!--error 77 > ncwrite: Wrong number of input argument(s): 3 to 5 expected. > at line 5 of exec file called by : > exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) > > Any advice would be appreciated. > > Thanks > Lester > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- Thanks and Regards Harpreet Singh ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Hello Lester , As explained in the ncwrite() help page, you have to create first the variable with nccreate() before writing it. As Hy is probably a matrix, you may have to specify also its dimensions as argument of nccreate(). And eventually its type, if it is not double. See the documentation for help. About your script: ncwrite(filename, 'Hilb_Hy','Hy') With this, you write the string 'Hy' into the variable 'Hilb_Hy', I don't think that's what you want to do. Regards, Simon Le 05/02/2016 11:31, Lester Anderson a écrit : Hello Harpreet, I altered the code a bit but still get a problem Hy = hilbert(grav); filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename // ncwrite(filename, varname, vardata, [start, [stride]]) ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy Error message: ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from Hy !--error 999 ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not found. at line 6 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) In this case I want to define a variable name Hilb_Hy (although can use any name really) in the netCDF file and write the output of the Hilbert (Hy) transform. Cannot see the solution On 5 February 2016 at 10:15, Harpreet Singh Rathorewrote: Dear Lester, As I can see the error is saying minimum 3 inputs are required. And after going through the help of the following function, you also have to pass the value which you have to store in the 'Hy'. You can go through the help files of ncwrite by typing help ncwrite in the console. Regards Harpreet On Fri, Feb 5, 2016 at 3:18 PM, Lester Anderson wrote: Hello all I am looking to use the sciNetCDF module to work with GMT grid files but have some issues. Reading a GMT grid is not a problem as far as I can tell, so the following does read the file (and z variable), storing the values in the grav array: source = fullfile('Q:\geophys\Gz.grd') grav = ncread(source,'z') Hy = hilbert(grav); // write Hy variable to new file I am having problems with writing out the processed data e.g write a new grid (Gz_Hy.grd) with the Hilbert transform solution filename = fullfile('Q:\geophys\Gz_Hy.grd') ncwrite(filename, 'Hy') // does not work Error return: ncwrite(filename, 'Hy') !--error 77 ncwrite: Wrong number of input argument(s): 3 to 5 expected. at line 5 of exec file called by : exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) Any advice would be appreciated. Thanks Lester ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -- Thanks and Regards Harpreet Singh ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Using Scinetcdf module
Hey You have not created the variable in the file. First you have to create a variable in the following file using the command nccreate(filename, 'Hilb_Hy', 'Dimensions', list('r', no_row, 'c', no_column); after that you can pass the ncwrite command and you have to pass like this ncwrite(filename, 'Hilb_Hy',Hy) as Hy is a matrix. Regards Harpreet Singh On Fri, Feb 5, 2016 at 4:01 PM, Lester Andersonwrote: > Hello Harpreet, > > I altered the code a bit but still get a problem > > Hy = hilbert(grav); > filename = fullfile('Q:\geophys\Gz_Hy.grd') // set output filename > // ncwrite(filename, varname, vardata, [start, [stride]]) > ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from > Hy > > Error message: > > ncwrite(filename, 'Hilb_Hy','Hy') // write variable Hilb_Hy with data from > Hy > !--error 999 > ncwrite: nc_inq_varid() returned the error -49: NetCDF: Variable not found. > at line 6 of exec file called by : > exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) > > In this case I want to define a variable name Hilb_Hy (although can > use any name really) in the netCDF file and write the output of the > Hilbert (Hy) transform. > > Cannot see the solution > > > > On 5 February 2016 at 10:15, Harpreet Singh Rathore > wrote: > > Dear Lester, > > > > As I can see the error is saying minimum 3 inputs are required. And after > > going through the help of the following function, you also have to pass > the > > value which you have to store in the 'Hy'. You can go through the help > files > > of ncwrite by typing help ncwrite in the console. > > > > Regards > > Harpreet > > > > On Fri, Feb 5, 2016 at 3:18 PM, Lester Anderson > > wrote: > >> > >> Hello all > >> > >> I am looking to use the sciNetCDF module to work with GMT grid files > >> but have some issues. > >> > >> Reading a GMT grid is not a problem as far as I can tell, so the > >> following does read the file (and z variable), storing the values in > >> the grav array: > >> > >> source = fullfile('Q:\geophys\Gz.grd') > >> grav = ncread(source,'z') > >> Hy = hilbert(grav); // write Hy variable to new file > >> > >> I am having problems with writing out the processed data e.g write a > >> new grid (Gz_Hy.grd) with the Hilbert transform solution > >> > >> filename = fullfile('Q:\geophys\Gz_Hy.grd') > >> ncwrite(filename, 'Hy') // does not work > >> > >> Error return: > >> > >> ncwrite(filename, 'Hy') > >>!--error 77 > >> ncwrite: Wrong number of input argument(s): 3 to 5 expected. > >> at line 5 of exec file called by : > >> exec('Q:\geophys\Lester\SCILAB_work\netcdf1.sce', -1) > >> > >> Any advice would be appreciated. > >> > >> Thanks > >> Lester > >> ___ > >> users mailing list > >> users@lists.scilab.org > >> http://lists.scilab.org/mailman/listinfo/users > > > > > > > > > > -- > > Thanks and Regards > > Harpreet Singh > > > > ___ > > users mailing list > > users@lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users > > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- Thanks and Regards Harpreet Singh ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users