Hot answers tagged

7

The database with the negative longitude angles is storing longitude as eastings and westings, whereas the other database is storing everything as eastings. It appears you prefer your data as eastings and westings. Your methodology for changing eastings greater than 180 degrees to westings is correct: where the longitude angle is greater than 180 subtract ...


6

These days I use: ncgeodataset. The routine allows for the extraction of a subset of data without having to load the entire file or even an array into Matlab. It is great for large datasets.


5

Here is a link to a colored inversion operator design code written and provided by Peter Zahuczki. This code requires that you provide a P-impedance log amplitude spectrum; he uses the open-source interpretation software OpendTect to compute this spectrum. Peter has a easy to follow tutorial on how to use his code with OpendTect. Good luck!


4

There are two stages to what you want here. 1. Converting point data to gridded data First off, since you want to plot regular cells rather than the actual data that you have, you need to covert your point data to cells in some way. The best way to do this may depend on the data itself, but one way would be to interpolate, perhaps using something along the ...


4

What kind of plot do you want? Lat = [25.5 26.5 33.5 34.5 35.5 36.5 41.5 42.5]; Lon = [89.5 91.5 78.5 79.5 83.5 84.5 75.5 76.5]; Rain = [110 120 122 135 114 116 145 120 110 110]; figure(); plot3(Lat,Lon,Rain,'o') will give you a scatter plot with Lat being the x, Lon being the y, and rain being the z. Also note that because your ...


3

The latitude and longitude of each pixel is not stored in the HDF file. But using metadata=hdfinfo('file_name.hdf'); You can get the info to generate those latitudes and longitudes. In metadata.Attibutes you will find this among other things: GridName="MOD_CMG_Snow_5km" XDim=7200 YDim=3600 UpperLeftPointMtrs=(-180000000.000000,90000000....


3

You aren't supposed to do link only answers, but that is really all this questions deserves. Did you look on Google? I did. https://people.sc.fsu.edu/~jburkardt/m_src/shallow_water_1d/shallow_water_1d.html http://personalpages.manchester.ac.uk/staff/paul.connolly/teaching/practicals/shallow_water_equations.html http://sanders.eng.uci.edu/matlabcodes.html ...


2

Here is an example using contourf. The trick is in sampling the 3D arrays appropriately: x=linspace(0,pi,20); y=linspace(0,pi,10); t=0:10:120; [X3d,Y3d,T3d]=meshgrid(x,y,t); [X2d,T2dx]=meshgrid(x,t); [Y2d,T2dy]=meshgrid(y,t); dat3d=7*sin(X3d)+5*cos(Y3d)+T3d/max(T3d(:))+rand(size(X3d)); dat2dx=7*sin(X2d)+5*cos(y(5))+T2dx/max(T2dx(:))+rand(size(X2d)); % ...


2

In Matlab if you have the mapping toolbox you can simply do: lon2=wrapTo180(lon2); And your approach is totally right, but if you have to do it more often or with other dataset with diferent conventions you can set up functions analogous to those in the maping toolbox. Such as: function lon = wrapTo180(lon) q = (lon < -180) | (180 < lon); ...


2

I have been using the routines in nctoolbox (also check here) that do all the slicing (vertical, horizontal, following a track). The repository is in GitHub. The one you should looking at is vsliceg.m. You can follow the logic there or develop your own.


1

I would: Compute (U,V) transport on the model's C grid. This is easy if the model returns a batotropic velocity. Define a set of points S along the transect. The points should have spacing comparable to the model's horizontal resolution. Interpolate (U,V) transport to S. Find the component of (U,V) perpendicular to your transect. Iterate over model outputs....


1

Do you get much different results if you do both ways? I think if you want the kinetic energy spectrum, use your second method. Some separately compute velocity and KE spectra, e.g., figure 2 of http://journals.ametsoc.org/doi/pdf/10.1175/2009JPO4330.1 (DP Wang et al, JPO, Apr 2010). Comparing velocity and KE spectra, the KE spectra looks similar to the ...


1

So, I know this question was asked a long time ago. But in the spirit of Stack Exchange, I will post my answer for future users perhaps. The Greens functions (i.e., analytical solutions) The first thing to be aware of are the various solutions to the wave equations change for the (1) source type and (2) the dimension. The source type Assuming acoustic ...


1

Did you try inpainting methods? Inpainting methods try to replace missing data using the existent data. I suggest you check the inpaint_nans.m function in fileexchange. For example [x,y] = meshgrid(0:.01:1); z0 = exp(x+y); znan = z0; znan(20:50,40:70) = NaN; znan(30:90,5:10) = NaN; znan(70:75,40:90) = NaN; z = inpaint_nans(znan); figure,imagesc(...


1

Try something like this: [x_grid,y_grid] = meshgrid(1:100,1:100); z_grid=griddata(x_data,y_data,z_data,x_grid(:),y_grid(:),'v4'); You can change the method of interpolation if you prefer something else. See: http://www.mathworks.com/help/matlab/ref/griddata.html


Only top voted, non community-wiki answers of a minimum length are eligible