# Tag Info

19

For very quick visual comparison I would use Cube Browser or ncview together with a command line tool like the Climate Data Operators. For quick production of nice looking graphics (and animations) Panoply really makes good job. For further analysis or special graphics keep following your approach and script with things like MATLAB, Python (e.g. with Iris), ...

17

The writers of netCDF, UNIDATA, maintain a pretty extensive list of visualisation software on the netCDF website. It even mentions an Excel add-in, for the masochistic, presumably. Over the years, I've found Ferret to be reliable with CF compliant files (and non-compliant ones, for that matter) and useful for interactive quick looks and simple ...

13

Your uwnd variable holds 32 bit floats and has shape (1,73,144) corresponding to time, lat, lon and is located in the Dataset you have called 'U'. One way to put this in a numpy array is: uwind = np.zeros((lat,lon), np.float) uwind = U.variables['uwnd'][1,:,:] The first line sets the size of the uwind array, which is helpful from a performance standpoint ...

12

I second ncview for taking a quick look at NetCDF files. I would also recommend trying Unidata's Integrated Data Viewer (IDV). It is great for overlaying geophysical fields in 3-D from different sources. Besides NetCDF, it supports many other formats. It also comes with a pre-loaded listing of various observational and model data repositories through ...

12

I made some pictures on my tablet to explain everything a bit better. Sorry that they are not that nice. Shuffle If we do not us shuffle, we store on value (float, double, integer, short integer, ...) after another. Thus, each variable itself is stored contiguously in memory. The first bit of a second value follows the last bit of the first value. If we ...

11

The modern language you are looking for is called modern Fortran 2018. Fortran 2008 and 2018 have everything a numerical computing project would need and so many features that many other languages mentioned here lack (including extremely pleasant array-syntax which has inspired all other languages such as MATLAB, Python, R, Julia, ..., even C++ numerical ...

11

Just to add my point of view; Using ncks you can do many things, i.e. differentiate, get ratio, extract some vars, slice on the dimension etc.. If you want to make some binary operations on netcdf files consider ncbo. For huge files I prefer to cut down what I want at the first place, it does opendap remote as well. Hate matlab so I moved to NCL (NCAR) ...

11

Normally I use the following softwares for a quick view of my NetCDF files: NASA Panoply (Panoply netCDF, HDF and GRIB Data Viewer): java based, very good in opening HDF, NetCDF, GRIBs... CDO functions as shaded, contour, etc. (very basic but useful from command-line) MATLAB and R with their basic functions

10

A CDL file is basically a text output from a netcdf file. If you want to know the contents of a netcdf file but don't have the time (or ability) to use programs built to read/write netcdf, you can use the simple text output of "ncdump" and then read/write it with a basic text editor. You can also use "ncgen" to regenerate a netcdf file based on the new CDL ...

7

As a former Fortran programmer I did a small online review several weeks ago into current trends for scientific programming. To begin with, despite its age and its sometimes archaic style of programming, because of its huge legacy, Fortran isn't being directed to the trash can in a hurry. It's going to be used for a long time to come. Like you, others have ...

7

I changed your model solution a little bit; but it's like Ingvar Lukas wrote in his answer: you redefined xi and yi in the process, so when you later on define the netCDF values for lat and lon you try to fill small 1D arrays with a 2D array. That is the source of your error. import numpy as np from scipy.interpolate import griddata import xarray as xr ...

6

You have a shape mismatch, as you are overwritingxi and yi using np.meshgrid, then assigning wrong dimensions with dim_lat and dim_lon and eventually trying to fill latitude and longitude with your initial values of length 6. Try modifying the grid preparation and interpolation # prepare a grid for interpolation xi = np.arange(6.0, 14.0, 0.001) yi = np....

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.

6

4

While I don't know the specifics of ocean modeling, unless there there is a "standard" in which nodes are organized and written (Ie X,Y,Z), there will always be coding required. Furthermore, the way a a data file is written always depends on how tasks in the model are delegated to the processor: Is the model designed to be run on a personal PC or a Beowulf ...

4

You can convert the image to NetCDF data using gdal_translate. The command line looks something like: gdal_translate -ot Int16 -of netCDF jpeg_filename nc_filename You can use ncl example: click here

3

It should be noted that NetCDF data just describes the format that the data is in. One dataset that I know of (IBTrACS) contains data that is not gridded data, and also contains a landmask. But this is besides your question. To rephrase your question: How can I determine the orientation of the coastline in a gridded dataset? Well, one way is using ...

3

For processing large data it is a good practice to call data into RAM in slices(Either by spliting time axis or spatial domain). In the interest of earth sciences python packages Xarray, iris, netCDF4 and h5py are few of the great tools for handling huge hierarchical data. For handling data in a labeled fashion Xarray and Iris will be useful while netCDf4 ...

2

After some trial n error I figured it out using the following shell script #!/bin/bash day_number () { year=$1 leap="false" if [$((year % 4)) -ne 0 ] ; then : elif [ $((year % 400)) -eq 0 ] ; then leap="true" elif [$((year % 100)) -eq 0 ] ; then : else leap="true" fi if [ "\$leap" == "true" ]; then echo 366 else echo 365 fi } for ...

2

The simple answer is that you just subtract the nearest value from the glacial isostatic adjustment (GIA) model. The values provided by Peltier in your netCDF file are in a grid that is 1 degree x 1 degree. So with the lat/lon position from the tidal gauge sea level data, you choose the closest value to your station and apply the correction. In the PSMSL GIA ...

2

tl;dr I would suggest considering the borehole measurements as a vertical profile. In terms of the CF Convention it would be a featureType profile, which is described in the discrete sampling geometries section. I didn't include all reference to the relevant sections in the CF Conventions below. Just comment if import things are missing. Example netCDF ...

2

When I visit that link, the first option at the top ("Data Product") defaults to inst3_3d_asm_Np, which is atmospheric variables in pressure levels. I suspect you need to change that dropdown option to inst1_2d_asm_Nx, which is surface and near-surface variables. The list is shows me for that option is, DISPH = zero plane displacement height PS = surface ...

2

You can try the R package eixport, with wrf_put # example # Read the array emissions, CO <- wrf_get(file = "Path_to_WRFCHEMI", name = "E_CO") # Change the values, here you should use your data CO[] = rnorm(length(CO)) # Inyect your emissions into the wrfchemi wrf_put(file = "Path_to_WRFCHEMI", name = "E_CO", POL = CO) How to deal with the speciation (...

1

Right now, I think that Julia makes the cut, because it provides a great tradeoff between "fast scripting" and "high-performance scientific computing". But I am willing to hear other people's opinions, perhaps I have overlooked something.

1

One option is to not load the entire file at a time. You can 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.

1

There are two issues (and one optimization) with/for the code above: Array indexing starts with 0 (not 1) in Python. Therefore, it should be if data[0,m] == countries[i,j]: because you are interested in the first row; m goes from 0 to 1 (for m in xrange(0,1):) but it should go from 0 to number_of_countries so that all columns of the energy are iterated. ...

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