Re: [netcdf-java] Aggregation with timeUnitsChange="true"

Roland-

The values will be relative to the time unit and if that has changed, then so will the values. Are the time units different between the original files and the aggregation? If you look at the actual "dates" described by the values, are they correct?

Since you are only aggregating on the time dimension, that's all that gets changed, hence time_bnds stays with the original values. I'm not sure if that's a feature or a bug. ;-)

Don

On 12/10/13 8:31 AM, Roland Schweitzer - NOAA Affiliate wrote:
Hi,

This will run a little long, so thanks for bearing with me.

I pulled down these 6 files:

ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/tas_CLIVAR_atm_monthly.198204-198303.nc
ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/tas_CLIVAR_atm_monthly.198304-198403.nc
ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/tas_CLIVAR_atm_monthly.198404-198503.nc

ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/zg_CLIVAR_atm_monthly.198204-198303.nc
ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/zg_CLIVAR_atm_monthly.198304-198403.nc
ftp://nomads.gfdl.noaa.gov/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly/zg_CLIVAR_atm_monthly.198404-198503.nc

If I build the  aggregation using this XML

<?xml version="1.0"?>
<catalog
xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0";
xmlns:xlink="http://www.w3.org/1999/xlink"; name="CLIVAR Datasets">
   <service name="ipcc" base="" serviceType="compound">
     <service name="ipcc_odap" serviceType="OpenDAP"
base="/thredds/dodsC/"/>
     <service name="wcs" serviceType="WCS" base="/thredds/wcs/"/>
     <service name="wms" serviceType="WMS" base="/thredds/wms/"/>
     <service name="ncss" serviceType="NetcdfSubset"
base="/thredds/ncss/grid/"/>
     <service name="ncml" serviceType="NCML" base="/thredds/ncml/"/>
     <service name="uddc" serviceType="UDDC" base="/thredds/uddc/"/>
     <service name="iso" serviceType="ISO" base="/thredds/iso/"/>
   </service>
   <dataset name="GFDL CM2.1 Seasonal-Interannual Experimental Forecast">
     <dataset name="CM2.1U_CDAef_v1.0_apf">
       <dataset name="r1">
         <dataset name="atmos">
           <dataset ID="CM2.1U_CDAef_v1.0_apf r1 Atmosphere"
name="CM2.1U_CDAef_v1.0_apf r1 Atmosphere"
urlPath="CM2.1U_CDApf_v1.0_r1Atmos_wo_vars">
             <dataType>Grid</dataType>
             <property name="viewer"
value="http://data1.gfdl.noaa.gov:8380/lasV7/getUI.do?data_url=http://data1.gfdl.noaa.gov:8380/thredds/dodsC/CM2.1U_CDApf_v1.0_r1Atmos,
Visualize with Live Access Serve
r"/>
             <serviceName>ipcc</serviceName>
             <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
               <aggregation type="union">
                 <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
                   <aggregation dimName="time" type="joinExisting"
timeUnitsChange="true">
                     <scan
location="/home/users/rhs/clivar/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly"
suffix="tas_*.nc"/>
                   </aggregation>
                 </netcdf>
                 <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
                   <aggregation dimName="time" type="joinExisting"
timeUnitsChange="true">
                     <scan
location="/home/users/rhs/clivar/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly"
suffix="zg_*.nc"/>
                   </aggregation>
                 </netcdf>
               </aggregation>
             </netcdf>
           </dataset>
         </dataset>
       </dataset>
     </dataset>
   </dataset>
</catalog>

I get a time axis and a time_bnds that looks like this:

Dataset {
     Float64 time[time = 36];
     Float64 time_bnds[time = 36][bnds = 2];
} CM2.1U_CDApf_v1.0_r1Atmos_wo_vars;
---------------------------------------------
time[36]
28.0, 58.5, 89.0, 119.5, 150.5, 181.0, 211.5, 242.0, 272.5, 303.5, 333.0, 
362.5, 393.0, 423.5, 454.0, 484.5, 515.5, 546.0, 576.5, 607.0, 637.5, 668.5, 
698.5, 728.5, 759.0, 789.5, 820.0, 850.5, 881.5, 912.0, 942.5, 973.0, 1003.5, 
1034.5, 1064.0, 1093.5

time_bnds[36][2]
[0], 0.0, 30.0
[1], 30.0, 61.0
[2], 61.0, 91.0
[3], 91.0, 122.0
[4], 122.0, 153.0
[5], 153.0, 183.0
[6], 183.0, 214.0
[7], 214.0, 244.0
[8], 244.0, 275.0
[9], 275.0, 306.0
[10], 306.0, 334.0
[11], 334.0, 365.0
[12], 0.0, 30.0
[13], 30.0, 61.0
[14], 61.0, 91.0
[15], 91.0, 122.0
[16], 122.0, 153.0
[17], 153.0, 183.0
[18], 183.0, 214.0
[19], 214.0, 244.0
[20], 244.0, 275.0
[21], 275.0, 306.0
[22], 306.0, 335.0
[23], 335.0, 366.0
[24], 0.0, 30.0
[25], 30.0, 61.0
[26], 61.0, 91.0
[27], 91.0, 122.0
[28], 122.0, 153.0
[29], 153.0, 183.0
[30], 183.0, 214.0
[31], 214.0, 244.0
[32], 244.0, 275.0
[33], 275.0, 306.0
[34], 306.0, 334.0
[35], 334.0, 365.0

In each of the of the original files the time coordinate looks like this:

time = 15, 45.5, 76, 106.5, 137.5, 168, 198.5, 229, 259.5, 290.5, 320, 349.5 ;

So I would expect the aggregation time axis to start with 15.  Based on some 
emails in the list archive, I'm pretty sure the time_bnds is a known issue.  So 
the main questions how are the values for the time axis calculated?

This is all being done with:

Implementation-Vendor: UCAR/Unidata
Implementation-Title: THREDDS Data Server (TDS)
Implementation-Version: 4.3.20

And for completeness, I know I can get close to what I want by defining
the time coordinate and time bounds myself, but it seems like a lot of
extra work.

<?xml version="1.0"?>
<catalog
xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0";
xmlns:xlink="http://www.w3.org/1999/xlink"; name="CLIVAR Datasets">
   <service name="ipcc" base="" serviceType="compound">
     <service name="ipcc_odap" serviceType="OpenDAP"
base="/thredds/dodsC/"/>
     <service name="wcs" serviceType="WCS" base="/thredds/wcs/"/>
     <service name="wms" serviceType="WMS" base="/thredds/wms/"/>
     <service name="ncss" serviceType="NetcdfSubset"
base="/thredds/ncss/grid/"/>
     <service name="ncml" serviceType="NCML" base="/thredds/ncml/"/>
     <service name="uddc" serviceType="UDDC" base="/thredds/uddc/"/>
     <service name="iso" serviceType="ISO" base="/thredds/iso/"/>
   </service>
   <dataset name="GFDL CM2.1 Seasonal-Interannual Experimental Forecast">
     <dataset name="CM2.1U_CDAef_v1.0_apf">
       <dataset name="r1">
         <dataset name="atmos">
           <dataset ID="CM2.1U_CDAef_v1.0_apf r1 Atmosphere"
name="CM2.1U_CDAef_v1.0_apf r1 Atmosphere"
urlPath="CM2.1U_CDApf_v1.0_r1Atmos">
             <dataType>Grid</dataType>
             <property name="viewer"
value="http://data1.gfdl.noaa.gov:8380/lasV7/getUI.do?data_url=http://data1.gfdl.noaa.gov:8380/thredds/dodsC/CM2.1U_CDApf_v1.0_r1Atmos,
Visualize with Live Access Serve
r"/>
             <serviceName>ipcc</serviceName>
             <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
               <aggregation type="union">
                 <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
                   <variable name="time" shape="time" type="float">
                     <attribute name="units" value="days since
1982-04-01 00:00:00"/>
                     <attribute name="bounds" value="tbnds"/>
                     <attribute name="_CoordinateAxisType" value="Time"/>
                     <values start="15" increment="30.5"/>
                   </variable>
                   <variable name="time_bnds" shape="time bnds"
type="float">
                     <values>
                        0  30
                        30  61
                        61  91
                        91  122
                        122  153
                        153  183
                        183  214
                        214  244
                        244  275
                        275  306
                        306  334
                        334  365
                        365  395
                        395  426
                        426  456
                        456  487
                        487  518
                        518  548
                        548  579
                        579  609
                        609  640
                        640  671
                        671  700
                        700  731
                        731  761
                        761  792
                        792  822
                        822  853
                        853  884
                        884  914
                        914  945
                        945  975
                        975  1006
                        1006  1037
                        1037  1065
                        1065  1096
                     </values>
                   </variable>
                   <aggregation dimName="time" type="joinExisting"
timeUnitsChange="true">
                     <scan
location="/home/users/rhs/clivar/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly"
suffix="tas_*.nc"/>
                   </aggregation>
                 </netcdf>
                 <netcdf
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
                   <variable name="time" shape="time" type="float">
                     <attribute name="units" value="days since
1982-04-01 00:00:00"/>
                     <attribute name="bounds" value="tbnds"/>
                     <attribute name="_CoordinateAxisType" value="Time"/>
                     <values start="15" increment="30.5"/>
                   </variable>
                   <variable name="time_bnds" shape="time bnds"
type="float">
                     <values>
                        0  30
                        30  61
                        61  91
                        91  122
                        122  153
                        153  183
                        183  214
                        214  244
                        244  275
                        275  306
                        306  334
                        334  365
                        365  395
                        395  426
                        426  456
                        456  487
                        487  518
                        518  548
                        548  579
                        579  609
                        609  640
                        640  671
                        671  700
                        700  731
                        731  761
                        761  792
                        792  822
                        822  853
                        853  884
                        884  914
                        914  945
                        945  975
                        975  1006
                        1006  1037
                        1037  1065
                        1065  1096
                     </values>
                   </variable>
                   <aggregation dimName="time" type="joinExisting"
timeUnitsChange="true">
                     <scan
location="/home/users/rhs/clivar/gfdl_cm2_1/CM2.1U_CDAef_v1.0_apf/r1/pp/atmos/ts/monthly"
suffix="zg_*.nc"/>
                   </aggregation>
                 </netcdf>
               </aggregation>
             </netcdf>
           </dataset>
         </dataset>
       </dataset>
     </dataset>
   </dataset>
</catalog>




_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: 
http://www.unidata.ucar.edu/mailing_lists/


--
Don Murray
NOAA/ESRL/PSD and CIRES
303-497-3596
http://www.esrl.noaa.gov/psd/people/don.murray/



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