Re: [thredds] ncml/THREDDS Aggregation of Swath Data follow up

  • To: Michael McDonald <mcdonald@xxxxxxxxxxxxx>
  • Subject: Re: [thredds] ncml/THREDDS Aggregation of Swath Data follow up
  • From: Antonio S. Cofiño <cofinoa@xxxxxxxxx>
  • Date: Thu, 14 May 2020 13:50:57 +0200
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><tt>Michael,</tt></p>
    <p><tt>I'm commenting  inline. </tt><tt><br>
      </tt></p>
    <div class="moz-cite-prefix"><tt>On 12/5/20 0:14, Michael McDonald
        wrote:</tt><tt><br>
      </tt></div>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">Antonio,
While the "along_track" is the UNLIMITED dimension in all of these
swath files. Our attempts to just use this as the dimension for the
joinExisting aggregation does not throw any issues wrt THREDDS at
catalog init time, but when you actually try to load/use this dataset
it does not work and fails with the message in Panoply,</pre>
    </blockquote>
    <p><tt>Yes, that is normal when the error it's not in the
        aggregation itself but is in the data aggregated. Usually
        aggregation are not evaluated until their aggregated data are no
        accessed. </tt><tt><br>
      </tt></p>
    <p><tt>Instead of using Panoply to access the aggregation using TDS
        in between, test the aggregation itself using a ncml file, and
        open it from Panoply. </tt><tt><br>
      </tt></p>
    <p><tt>This will allow you to check if the aggregation it's working.
        The NCML tab on the ToolsUI it's very useful. </tt><tt><br>
      </tt></p>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">

"There was an error preparing the data: Failed creating the data
handler: Could not read lon axis array."
</pre>
    </blockquote>
    <p><tt>I don't from which part of Panoply it's this error coming
        from. Usually the exception stacktrace it's providing more
        useful info. </tt><tt><br>
      </tt></p>
    <p><tt><br>
      </tt></p>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">


e.g., joinExisting aggregation on along_track (fails with: Could not
read lon axis array.)
<a class="moz-txt-link-freetext" 
href="http://tds.coaps.fsu.edu/thredds/dodsC/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily_TESTjoinExisting-along_track.html";>http://tds.coaps.fsu.edu/thredds/dodsC/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily_TESTjoinExisting-along_track.html</a>

 &lt;netcdf xmlns=<a class="moz-txt-link-rfc2396E" 
href="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>"http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";</a>&gt;
    &lt;aggregation type="joinExisting" dimName="along_track"&gt;
      &lt;scan 
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009"
suffix=".nc" subdirs="false" /&gt;
    &lt;/aggregation&gt;
  &lt;/netcdf&gt;

</pre>
    </blockquote>
    <p><tt>Try to use "static" aggregation instead of dynamic (i.e.
        scan) aggregation:</tt><tt><br>
      </tt></p>
    <p><tt>&lt;netcdf
        xmlns=<a class="moz-txt-link-rfc2396E" 
href="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>"http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";</a>&gt;<br>
          &lt;aggregation type="joinExisting" dimName="along_track"&gt;<br>
            &lt;netcdf
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009324.nc"/&gt;<br>
            &lt;netcdf
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009325.nc"/&gt;<br>
          &lt;/aggregation&gt;<br>
        &lt;/netcdf&gt;<br>
      </tt></p>
    <p>the reason, it's because the scan element doesn't guaranteed the
      file order: </p>
    <p><a
href="https://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles()">https://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles()</a></p>
    <p>The ToolsUI NCML aggregation panel tab can show tha files
      agregated and their order. <br>
    </p>
    <p>You <img src="cid:part2.48D04669.A43A1047@gmail.com" alt=""></p>
    <p>The netcdf-java/panoply it's classifying the dataset as
      curviliner, because the time coordinates has not been explicitly
      declared on variables. <br>
    </p>
    <p>Yo can fix that adding the time to the coordinates attribute (I
      have removed also the actual_range attribute for the time
      variable):</p>
    <p><tt>&lt;netcdf
        xmlns=<a class="moz-txt-link-rfc2396E" 
href="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>"http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";</a>&gt;<br>
          &lt;aggregation type="joinExisting" dimName="along_track"&gt;<br>
            &lt;netcdf
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009324.nc"/&gt;<br>
            &lt;netcdf
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009325.nc"/&gt;<br>
          &lt;variable name="time"&gt;<br>
            &lt;remove name="actual_range" type="attribute" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="eastward_wind"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="northward_wind"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="wind_speed"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="wind_to_direction"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="wind_to_direction"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="simplified_wvc_quality_flag"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="rain_impact"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;variable name="distance_from_coast"&gt;<br>
            &lt;attribute name="coordinates" value="time lon lat" /&gt;<br>
          &lt;/variable&gt;<br>
          &lt;/aggregation&gt;<br>
        &lt;/netcdf&gt;<br>
      </tt></p>
    <p>Then the dataset it's been classified as SWATH: <br>
    </p>
    <p><img src="cid:part3.B8AE5CF5.437BD1A7@gmail.com" alt=""></p>
    <p>If the time it's *not* added as coordinate, then the netcd-java
      is detecting as *just* curvilinear horizontal projection. <br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">
This *simplified* product is a collection of multiple quikscat swath
passes in a 24 hour period to assemble a full coverage of the globe.

orbit_file_source:
<a class="moz-txt-link-freetext" 
href="https://podaac-opendap.jpl.nasa.gov/opendap/allData/quikscat/L2B12/v4.0/";>https://podaac-opendap.jpl.nasa.gov/opendap/allData/quikscat/L2B12/v4.0/</a>

Which looks like this for a single day.
<a class="moz-txt-link-freetext" 
href="http://tds.coaps.fsu.edu/thredds/wms/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009325.nc?STYLES=&amp;SERVICE=WMS&amp;FORMAT=image%2Fpng&amp;REQUEST=GetMap&amp;HEIGHT=512&amp;WIDTH=1024&amp;VERSION=1.1.1&amp;BBOX=-180.0%2C-80.0%2C180.0%2C90.0&amp;LAYERS=wind&amp;SRS=EPSG%3A4326&amp;TRANSPARENT=TRUE";>http://tds.coaps.fsu.edu/thredds/wms/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily/2009/QSCAT_12_2009325.nc?STYLES=&amp;SERVICE=WMS&amp;FORMAT=image%2Fpng&amp;REQUEST=GetMap&amp;HEIGHT=512&amp;WIDTH=1024&amp;VERSION=1.1.1&amp;BBOX=-180.0%2C-80.0%2C180.0%2C90.0&amp;LAYERS=wind&amp;SRS=EPSG%3A4326&amp;TRANSPARENT=TRUE</a>


Our *end goal* is to have a virtually aggregated collection of all
this simplified daily swath data from 1999 to 2009 for ingestion as an
OPeNDAP/WMS dataset into a web-based data visualizer like OWGIS
(<a class="moz-txt-link-freetext" 
href="https://owgis.org/";>https://owgis.org/</a>), so that users can pick the 
date(s) they want,
and view this in a web GUI.
</pre>
    </blockquote>
    <p>The above agregation it's the same kind of dataset, but with all
      time steps aggregated. It will be an actual bit swath.<br>
    </p>
    <p>This a second order problem, but you will find some performance
      problems due to the aggregation needs to read each file on the
      aggregation, to find the size and the corresponding coordinates
      values. If you use the static approach you can add both on the
      ncml (or in third party file). <br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">

We tried to use joinNew to aggregate all these like files on a new
dimension "T" and populate the time info using the filename
(dateFormatMark="QSCAT_#HH_yyyyDDD") and get the same error (fails
with: Could not read lon axis array.)


e.g., joinNew aggregation on new dimension T
<a class="moz-txt-link-freetext" 
href="http://tds.coaps.fsu.edu/thredds/dodsC/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily_TESTjoinNew-time-lon-lat.html";>http://tds.coaps.fsu.edu/thredds/dodsC/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily_TESTjoinNew-time-lon-lat.html</a>

&lt;netcdf xmlns=<a class="moz-txt-link-rfc2396E" 
href="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>"http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";</a>&gt;
&lt;aggregation dimName="T" type="joinNew"&gt;
&lt;variableAgg name="time"/&gt;
&lt;variableAgg name="lon"/&gt;
&lt;variableAgg name="lat"/&gt;
&lt;variableAgg name="eastward_wind"/&gt;
&lt;variableAgg name="northward_wind"/&gt;
&lt;variableAgg name="wind_speed"/&gt;
&lt;variableAgg name="wind_to_direction"/&gt;
&lt;variableAgg name="simplified_wvc_quality_flag"/&gt;
&lt;variableAgg name="rain_impact"/&gt;
&lt;variableAgg name="distance_from_coast"/&gt;
&lt;scan dateFormatMark="QSCAT_#HH_yyyyDDD"
location="/Net/data/qscat/data/nc_L2B_v4p0_12/nc_L2B_12_daily/2009"
suffix=".nc" subdirs="false" /&gt;
&lt;/aggregation&gt;
&lt;/netcdf&gt;


Any ideas what we are doing wrong in THREDDS, or is the issue in the
data files we simplified?

</pre>
    </blockquote>
    <p>It's not at the THREDDS itself, it's a problem on the dataset
      attributes and aggregations. Another problem will be if this big
      SWATH it's been accesible and usable from the Panoply tool or the
      WMS service. <br>
    </p>
    <p>Hope this helps. <br>
    </p>
    <p>Antonio</p>
    <pre class="moz-signature" cols="72">--
Antonio S. Cofiño
Dep. de Matemática Aplicada y 
        Ciencias de la Computación
Universidad de Cantabria
<a class="moz-txt-link-freetext" 
href="http://www.meteo.unican.es";>http://www.meteo.unican.es</a></pre>
    <p><br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
cite="mid:CAGZ4aURRNQGaEFqB_jEfxs71LT2=g6DaRtXgxQVkLNBLQma9uw@xxxxxxxxxxxxxx">
      <pre class="moz-quote-pre" wrap="">
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
Ian,,

What aggregation are you expecting? just on the 'along_track' dimension?

Antonio
On 5/5/20 19:46, Ian Dimitri wrote:

Hello All,

Adding onto Michael's existing thread, I am working closely with him attempting 
to figure out the issue we are having with the aggregation of swath data that 
has a two-dimensional grid with track and cross-track coordinates. We have 
tried using FMRC, joinExisting, and joinNew file aggregation methods within 
THREDDS, all with no success.

We tried using many different aggregations methods
that exist within the ncWMS2 interface. We have tried doing the simple wildcard 
aggregation attempt by using the wildcard character (e.g. 
/ASCAT/nc_L2B_25_daily/2020/*.nc).

We have also tried to use the "Dynamic Services" that is also available through 
ncWMS2, but that also did not seem to work with the multi-dimensional swath 
data that we are
trying to aggregate.

Finally another method we tried was through geoserver, where we attempted to 
use the image mosaic option that it has but that option also proved to be a 
dead end.

None of the methods mentioned above worked properly, and we are wondering if 
anyone has had any success aggregating swath data with the methods, and would 
like to share any
special steps that had to be taken to make said method work. Are there any 
other methods I did not mention above that could possibly be able to aggregate 
the multi-demensional swath data?

Any insight or help would be appreciated

unaggregated data
<a class="moz-txt-link-freetext" 
href="http://tds.coaps.fsu.edu/thredds/catalog/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily/catalog.html";>http://tds.coaps.fsu.edu/thredds/catalog/coaps/qscat/nc_L2B_v4p0_12/nc_L2B_12_daily/catalog.html</a>

attempted aggregation with joinNew
<a class="moz-txt-link-freetext" 
href="http://tds.coaps.fsu.edu/thredds/satellite_testing.html?dataset=joinnew-TEST-coaps-qscat-nc_L2B_v4p0_12-nc_L2B_12_daily";>http://tds.coaps.fsu.edu/thredds/satellite_testing.html?dataset=joinnew-TEST-coaps-qscat-nc_L2B_v4p0_12-nc_L2B_12_daily</a>
</pre>
      </blockquote>
    </blockquote>
  </body>
</html>

PNG image

PNG image

  • 2020 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: