NullPointerException during aggregation

John Caron caron at unidata.ucar.edu
Tue Nov 14 16:57:56 MST 2006


Hi Jon, sorry its taken so long to reply:

regExp should work, it looks like you need regExp="NATL.*" or something (I never remember regexp expressions for more than 24 hours), as it is, it will only match a file named NATL.

Ill try to deal more greacefully with the error.

Jon Blower wrote:
> Hi,
> 
> As a follow-up question, should it be possible to use the regExp
> option in the <scan> element to only attempt to match filenames that
> match a given regular expression?  I tried to do this with the example
> below, i.e.:
> 
> <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
>   <aggregation dimName="time" type="joinNew">
>     <variableAgg name="temperature"/>
>     <variableAgg name="salinity"/>
>     <scan location="/path/to/files/" suffix=".nc" regExp="NATL"
> dateFormatMark="NATL_1_#ddMMyyyy" />
>   </aggregation>
> </netcdf>
> 
> but it gave a different NullPointerException (in
> AggregationNew.java:51, version 2.2.17), which seems to be because the
> aggregation is not picking up any files at all.  Should regexps work
> with joinNew?
> 
> Thanks, Jon
> 
> 
> On 07/11/06, Jon Blower <jdb at mail.nerc-essc.ac.uk> wrote:
> 
>> Hi John,
>>
>> Yes, this problem is still evident in 2.2.17 (I downloaded the
>> toolsUI-2.2.17.jar file).
>>
>> Thanks, Jon
>>
>> On 03/11/06, John Caron <caron at unidata.ucar.edu> wrote:
>> > Hi Jon:
>> >
>> > Can you check if you get the same error in the latest 2.2.17 release?
>> > I have fixed some bugs in aggregation, but im not sure if thats one 
>> of them.
>> >
>> > thanks
>> >
>> > Jon Blower wrote:
>> > > Hi all,
>> > >
>> > > I'm having problems working with NcML aggregations and the 2.2.16
>> > > version of the Java NetCDF libraries.  I would like to aggregate
>> > > files:
>> > >
>> > > NATL_1_28082006.nc
>> > > NATL_1_29082006.nc
>> > > NATL_1_30082006.nc
>> > > ...
>> > >
>> > > along the time dimension.  I tried an NcML file like this:
>> > >
>> > > <netcdf 
>> xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
>> > >   <aggregation dimName="time" type="joinNew">
>> > >     <variableAgg name="temperature"/>
>> > >     <variableAgg name="salinity"/>
>> > >     <scan location="/path/to/files/" suffix=".nc"
>> > > dateFormatMark="NATL_1_#ddMMyyyy" />
>> > >   </aggregation>
>> > > </netcdf>
>> > >
>> > > This gave me a NullPointerException:
>> > >
>> > > java.lang.NullPointerException
>> > >     java.util.Calendar.setTime(Calendar.java:1032)
>> > >     java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
>> > >     java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
>> > >     java.text.DateFormat.format(DateFormat.java:314)
>> > >     
>> ucar.nc2.units.DateFormatter.toDateTimeStringISO(DateFormatter.java:184)
>> > >
>> > >     ucar.nc2.ncml.Aggregation.crawlDirectory(Aggregation.java:817)
>> > >
>> > > I think I know why this is.  There are other files in the same
>> > > directory of the form "NATL_120_28082006.nc" and I think the
>> > > aggregator is trying to match these.  Can I arrange it so that only
>> > > files that match the pattern "NATL_1_#ddMMyyyy.nc" are aggregated, 
>> and
>> > > all others are simply ignored?
>> > >
>> > > I am reluctant to change the directory structure of my data because
>> > > other applications may depend on it.
>> > >
>> > > Thanks in advance,
>> > > Jon
>> > >
>> >
>> > 
>> =============================================================================== 
>>
>> > To unsubscribe netcdf-java, visit:
>> > http://www.unidata.ucar.edu/mailing-list-delete-form.html
>> > 
>> =============================================================================== 
>>
>> >
>> >
>>
>>
>> -- 
>> --------------------------------------------------------------
>> Dr Jon Blower              Tel: +44 118 378 5213 (direct line)
>> Technical Director         Tel: +44 118 378 8741 (ESSC)
>> Reading e-Science Centre   Fax: +44 118 378 6413
>> ESSC                       Email: jdb at mail.nerc-essc.ac.uk
>> University of Reading
>> 3 Earley Gate
>> Reading RG6 6AL, UK
>> --------------------------------------------------------------
>>
> 
> 

==============================================================================
To unsubscribe netcdf-java, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================



More information about the Netcdf-java mailing list