<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello<br>
<br>
I have an annoyingly simple problem. I want to plot salinity on an
isopycnal surface for about 75 oceanographic stations (where there
are depth profiles) arranged on an irregularly spaced, ragged grid.
The data are in a flat netcdf file that cannot be read by the
Climate Data Operators.<br>
<br>
------------------------------------<br>
<br>
smcc@jaguar:/data/dynamic_data/projects/projects2018/visualization/data$
ncdump -h CalCOFI_temp_sal_on_26.5_isopycnal_by_cruise.nc<br>
netcdf CalCOFI_temp_sal_on_26.5_isopycnal_by_cruise {<br>
dimensions:<br>
row = 62 ;<br>
sta_id_strlen = 11 ;<br>
variables:<br>
char sta_id(row, sta_id_strlen) ;<br>
sta_id:_Encoding = "ISO-8859-1" ;<br>
sta_id:coordinates = "time latitude longitude" ;<br>
sta_id:description = "8-digit CalCOFI line and station
designation" ;<br>
sta_id:ioos_category = "Identifier" ;<br>
sta_id:long_name = "Line and Station" ;<br>
int r_depth(row) ;<br>
r_depth:actual_range = 125, 271 ;<br>
r_depth:coordinates = "time latitude longitude" ;<br>
r_depth:description = "Reported Depth the bottle was
tripped" ;<br>
r_depth:ioos_category = "Identifier" ;<br>
r_depth:long_name = "Reported Bottle Depth" ;<br>
r_depth:units = "meters" ;<br>
float r_temp(row) ;<br>
r_temp:actual_range = 7.83f, 9.04f ;<br>
r_temp:coordinates = "time latitude longitude" ;<br>
r_temp:description = "Reported Temperature of water at the
depth the bottle was tripped" ;<br>
r_temp:ioos_category = "Temperature" ;<br>
r_temp:long_name = "Reported Temperature" ;<br>
r_temp:units = "degree C" ;<br>
float r_salinity(row) ;<br>
r_salinity:actual_range = 33.975f, 34.215f ;<br>
r_salinity:coordinates = "time latitude longitude" ;<br>
r_salinity:description = "Practical Salinity Scale, 1978
(UNESCO, 1981a)" ;<br>
r_salinity:ioos_category = "Salinity" ;<br>
r_salinity:long_name = "Reported Salinity" ;<br>
r_salinity:units = "psu" ;<br>
float r_sigma(row) ;<br>
r_sigma:actual_range = 26.475f, 26.525f ;<br>
r_sigma:coordinates = "time latitude longitude" ;<br>
r_sigma:ioos_category = "Other" ;<br>
r_sigma:long_name = "Reported Potential Density of water" ;<br>
float latitude(row) ;<br>
latitude:_CoordinateAxisType = "Lat" ;<br>
latitude:actual_range = 30.186f, 36.709f ;<br>
latitude:axis = "Y" ;<br>
latitude:ioos_category = "Location" ;<br>
latitude:long_name = "Latitude" ;<br>
latitude:standard_name = "latitude" ;<br>
latitude:units = "degrees_north" ;<br>
float longitude(row) ;<br>
longitude:_CoordinateAxisType = "Lon" ;<br>
longitude:actual_range = -124.637f, -117.533f ;<br>
longitude:axis = "X" ;<br>
longitude:ioos_category = "Location" ;<br>
longitude:long_name = "Longitude" ;<br>
longitude:standard_name = "longitude" ;<br>
longitude:units = "degrees_east" ;<br>
double time(row) ;<br>
time:_CoordinateAxisType = "Time" ;<br>
time:actual_range = 1365319440., 1367199780. ;<br>
time:axis = "T" ;<br>
time:description = "Time" ;<br>
time:ioos_category = "Time" ;<br>
time:long_name = "Time" ;<br>
time:standard_name = "time" ;<br>
time:time_origin = "01-JAN-1970 00:00:00" ;<br>
time:units = "seconds since 1970-01-01T00:00:00Z" ;<br>
<br>
// global attributes:<br>
:acknowledgment = "University of California, San Diego
Scripps Institution" ;<br>
:cdm_data_type = "Point" ;<br>
:Conventions = "COARDS, CF-1.6, Unidata Dataset Discovery
v1.0" ;<br>
:date_issued = "2013-07-17" ;<br>
:date_modified = "2013-07-17" ;<br>
:Easternmost_Easting = -117.533f ;<br>
:featureType = "Point" ;<br>
:geospatial_lat_max = 36.709f ;<br>
:geospatial_lat_min = 30.186f ;<br>
:geospatial_lat_units = "degrees_north" ;<br>
:geospatial_lon_max = -117.533f ;<br>
:geospatial_lon_min = -124.637f ;<br>
:geospatial_lon_units = "degrees_east" ;<br>
:history = "2018-04-22T00:58:55Z (source database)\n",<br>
"2018-04-22T00:58:55Z <a class="moz-txt-link-freetext"
href="http://oceanview.pfeg.noaa.gov/erddap/tabledap/siocalcofiHydroBottleReport.ncCF?sta_id%2Cr_depth%2Cr_temp%2Cr_salinity%2Cr_sigma%2Clatitude%2Clongitude%2Ctime&r_sigma%3E=26.475&r_sigma%3C=26.525&time%3E=2013-03-01T12%3A52%3A58Z&time%3C=2013-05-01T12%3A52%3A58Z">http://oceanview.pfeg.noaa.gov/erddap/tabledap/siocalcofiHydroBottleReport.ncCF?sta_id%2Cr_depth%2Cr_temp%2Cr_salinity%2Cr_sigma%2Clatitude%2Clongitude%2Ctime&r_sigma%3E=26.475&r_sigma%3C=26.525&time%3E=2013-03-01T12%3A52%3A58Z&time%3C=2013-05-01T12%3A52%3A58Z</a>"
;<br>
:id = "siocalcofiHydroBottleReport_3bf6_a84f_a01b" ;<br>
:infoUrl = <a class="moz-txt-link-rfc2396E"
href="http://www.calcofi.org/new.data/index.php/reporteddata/2013-09-30-23-23-27/database-tables-description">"http://www.calcofi.org/new.data/index.php/reporteddata/2013-09-30-23-23-27/database-tables-description"</a>
;<br>
:institution = "UCSD SIO" ;<br>
:license = "The data may be used and redistributed for free
but is not intended\n",<br>
"for legal use, since it may contain inaccuracies.
Neither the data\n",<br>
"Contributor, ERD, NOAA, nor the United States
Government, nor any\n",<br>
"of their employees or contractors, makes any warranty,
express or\n",<br>
"implied, including warranties of merchantability and
fitness for a\n",<br>
"particular purpose, or assumes any legal liability for
the accuracy,\n",<br>
"completeness, or usefulness, of this information." ;<br>
:Northernmost_Northing = 36.709f ;<br>
:project = "CalCOFI" ;<br>
:publisher_email = <a class="moz-txt-link-rfc2396E"
href="mailto:jwilkinson@ucsd.edu">"jwilkinson@ucsd.edu"</a> ;<br>
:publisher_name = "James Wilkinson" ;<br>
:sourceUrl = "(source database)" ;<br>
:Southernmost_Northing = 30.186f ;<br>
:standard_name_vocabulary = "CF-11" ;<br>
:subsetVariables = "sta_id" ;<br>
:summary = "SIO Hydrographic data" ;<br>
:time_coverage_end = "2013-04-29T01:43:00Z" ;<br>
:time_coverage_start = "2013-04-07T07:24:00Z" ;<br>
:title = "CalCOFI SIO Hydrographic Bottle Report data" ;<br>
:Westernmost_Easting = -124.637f ;<br>
<br>
----------------------------------------------------<br>
To obtain enough salinity points on the density surface (26.5 for
example), I selected the data based on a small range of densities
(+/- 0.025). This means that at a few (time,lat,long) stations there
is more than one density point in the range. Consequently, I obtain
some (time,lat,long) stations where there is more than one salinity
selected for the isopycnal, and this causes the contour plot to
fail.<br>
<br>
Here is my question:<br>
Since I cannot use CDO with this netcdf file (it is not the right
format of netcdf), can I select and eliminate the duplicates
efficiently in NCL? <br>
------------------------------------------------<br>
I was thinking something like this?<br>
<br>
in258 =
addfile("../data/CalCOFI_temp_sal_on_25.8_isopycnal_by_cruise.nc","r")<br>
s258 = in258->r_salinity ; read all
salinities<br>
lat3 = in258->latitude<br>
lon3 = in258->longitude<br>
time3 = in258->time<br>
; printVarSummary(s258)<br>
; printVarSummary(lat3)<br>
; printVarSummary(lon3)<br>
; print(time3)<br>
; print(get_unique_values(time3))<br>
<br>
x = (/ (/time3/),(/lat3/),(/lon3/),(/s258/) /)<br>
print(x)<br>
x1D = ndtooned(x)<br>
print(x1D)<br>
i1D = ind(get_unique_values(x1D(0,??))); need to index the
original position of unique times<br>
exit()<br>
i = ind_resolve(i1D, dimsizes(x) )<br>
--------------------------------------------------<br>
<br>
The plot I am working on is here: <br>
<a class="moz-txt-link-rfc2396E"
href="https://my.pcloud.com/publink/show?code=XZLSJf7ZOh5xn41l5yVWQTzpE2Y5zyTG0LeX">"https://my.pcloud.com/publink/show?code=XZLSJf7ZOh5xn41l5yVWQTzpE2Y5zyTG0LeX"</a><br>
<br>
The NCL code is here:<br>
<a class="moz-txt-link-rfc2396E"
href="https://my.pcloud.com/publink/show?code=XZMSJf7Za13geSDAd0hh0ppltNa2PHkfYBUk">"https://my.pcloud.com/publink/show?code=XZMSJf7Za13geSDAd0hh0ppltNa2PHkfYBUk"</a><br>
<br>
The data are here:<br>
<a class="moz-txt-link-rfc2396E"
href="https://my.pcloud.com/publink/show?code=XZASJf7Z5CO19wADqnbAHt5NQa10RhaXr91X">"https://my.pcloud.com/publink/show?code=XZASJf7Z5CO19wADqnbAHt5NQa10RhaXr91X"</a><br>
<br>
Thanks in advance,<br>
Sam<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>email signature</title>
Sam McClatchie (fisheries oceanographer)<br>
& Elena Turin (accounting & auditing)<br>
FishOcean Enterprises<br>
38 Upland Rd, Huia, Auckland 0604, New Zealand<br>
cell: 027 752 8495<br>
<span style="text-decoration: underline;"><a
href="http://www.fishocean.info">Internet</a></span><br>
<img style="width: 150px; height: 149px;" alt=""
src="cid:part8.A7615CE3.C43F8140@fishocean.info" class=""><br>
<br>
"The time has come", the tui said,<br>
"to talk of many things:<br>
Of songs - and ferns - and flowering flax,<br>
of Pukekos and dreams ..."<br>
<br>
(not Lewis Carroll) </div>
</body>
</html>