Hi, We'll be making an FAQ about Argo float files, as they are an important data source, but are in a form that's not quite transparent for Ferret's use. The Argo float data has a particular form for netCDF files. When you open the data and do a "SHOW DATA" command, you'll see a number of descriptive variables, location and time variables, and then the data the float has measured, on a 2-D grid. Picking out just the TEMP variable from the output of SHOW DATA: yes? use 20011217_profThe dimensions N_LEVELS and N_PROF don't have coordinate variables associated with them in the Argo float files, so there are no directional attributes to use in assigning the direction for these axes. When it initializes the file, Ferret has put them on the x and z axes, which is not where we'd like to work with them. Ferret has functions that will help: yes? show func *transpose* We will want to define a depth axis and use depth information from the dataset to translate levels to depths. Use Ferret's ZAXREPLACE function which takes our input variable, a z-axis definition, and a variable that relates depth and z-levels, to translate the levels to depths. yes? show func zaxreplacetrans_temp, defined above, will be argument 1 to the function ZAXREPLACE. Now what depth information is in the file? There is a variable PRES_ADJUSTED. Look at its attributes: yes? show attributes pres_adjustedPRES_ADJUSTED tells what pressure corresponds to each zlevel for each profile. Use pressure as a proxy for depth. PRES_ADJUSTED is on the same grid as TEMP, so transpose it as well. This will be the second argument to the function ZAXREPLACE. yes? let trans_pres_adj = transpose_xz(pres_adjusted)What z axis do we want to use? You mentioned an axis from ocean-atlas datasets. We can open up an ocean atlas dataset, and use its Z axis. yes? use "http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/nodc.woa98/temperat/annual/otemp.anal1deg.nc"Define a variable zz which is the z-depths from the variable OTEMP, and define the z-axis regridding. yes? let zz = z[gz=OTEMP[d=2]]Now clean up some details. The function TRANSPOSE_XZ returns the result on an ABSTRACT x axis, and so that is also the x axis of the result from ZAXREPLACE. We'll define a new axis, just exactly the length of the incoming N_PROF axis. yes? show grid temp_on_zPut the result on this axis, so its grid is number-of-profiles and pressure. yes? let temp_prof_z = temp_on_z[gx=profile_number@asn]We'd also like to keep the original attributes, such as the title and units, from the file variable TEMP yes? set att/like=temp temp_prof_zThere are some other details there which Ferret can work with - notice that there are LONGITUDE, LATITUDE and JULD variables which contain a location and time for each profile. Those could be used in Ferret scripts as well. Also, notice that at the end of the list of variables in the "SHOW DATA" output, there are grids that look like this: HISTORY_INSTITUTION Institution which performed act 1:0 ... 1:4 ... ... ... It turns out that these files have a "record axis" dimension whose length is zero. There is no data in the files associated with these variables, and so Ferret should just note that and not list these among the dataset variables. -Ansley On 2/13/2016 10:03 PM, Venu wrote:
|