Maxent fatal error when reading clamping file

444 views
Skip to first unread message

Julian Ramirez (CIAT)

unread,
Oct 1, 2008, 12:10:08 PM10/1/08
to Maxent
There's an error when using projection files for some special cases.

I'm working with version 3.2.1 and performing analyses on several
species to determine climate change impact. Working at 2.5 minutes of
resolution and the analyses are global. There's a part of the MaxEnt
algorythm producing a division by zero (or something similar) when
projecting species predicted distribution and the program is writing a
"?" (which is the unicode value corresponding to a Not-a-Number value)
in the clamping file instead of writing a NODATA value (or zero); so
when the program is re-reading the clamping files it tries to convert
the "?" symbol to a float, which generates a java-error and the
program just crashes.

Is there an special reason for this to be occurring? should I discard
the species (due to lack of data or something like this) or is it a
problem on the code?

Mónica_Almeida

unread,
Oct 13, 2008, 11:58:38 AM10/13/08
to Maxent
Hi!

Im also working with Maxent, version 3.2.1, and trying to make a
projection, and it gives the same error message, when reading the
"clamping.ASC":

Fatal Error: java.lang.NumberFormatException: For input string: "?"
java.lang.NumberFormatException: For input string: "?"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at density.GridIO.readASC(GridIO.java:288)
at density.GridIO.readGrid(GridIO.java:36)
at density.Runner.makePicture(Runner.java:657)
at density.Runner.start(Runner.java:497)
at density.GUI$7.construct(GUI.java:392)
at density.SwingWorker$2.run(SwingWorker.java:108)
at java.lang.Thread.run(Unknown Source)

Once i tried to make the same projection with only 2 environmental
layers, just to try the program, and i had no problems that time.

Any sugestions?

Mónica Almeida


On Oct 1, 12:10 pm, "Julian Ramirez (CIAT)"

Julian Ramirez

unread,
Oct 13, 2008, 5:35:21 PM10/13/08
to Max...@googlegroups.com
Hi Monica,

As I heard from Stephen P. they're working in a new version of MaxEnt to mainly fix this bug. However, I have modified a small part of the MaxEnt's java source code in the read GridIO class (which is the one causing the conflict).

I changed:

localPrintWriter.print(localNumberFormat.format(paramGrid.eval(j, k)));

to

if(!Double.isNaN(paramGrid.eval(j, k)))
     localPrintWriter.print(localNumberFormat.format(paramGrid.eval(j, k)));
  else
     localPrintWriter.print(paramGrid.getNODATA_value());

You can wait for the official fixed version from Phillips et al, or if you want I could send you my home-fixed version.

Regards,

Julián R. V.

Steven Phillips

unread,
Oct 13, 2008, 5:43:22 PM10/13/08
to Max...@googlegroups.com
Hi all,

We've just posted a new version of Maxent on the download site,

www.cs.princeton.edu/~schapire/maxent

The main change is a fix for that bug. The other significant changes
are:

Response curve thumbnails now all use the same 0-1 y-axis scale.

Data is extracted from environmental grids in a new (more memory
efficient) way, which means that the random sample of background and
the partition of samples into training / test will appear to use a
different random seed than before.

-- Steven


Date: Mon, 13 Oct 2008 08:58:38 -0700 (PDT)
From: =?ISO-8859-1?Q?M=F3nica=5FAlmeida?= <almeida...@gmail.com>

Mónica_Almeida

unread,
Oct 13, 2008, 5:58:44 PM10/13/08
to Maxent
Thanks Julian for your reply and help, and Steven for the new
version! :)

Hope this resolves the problem!

Mónica Almeida

On Oct 13, 10:43 pm, Steven Phillips <phill...@research.att.com>
wrote:
> Hi all,
>
> We've just posted a new version of Maxent on the download site,
>
>    www.cs.princeton.edu/~schapire/maxent
>
> The main change is a fix for that bug.  The other significant changes
>  are:
>
> Response curve thumbnails now all use the same 0-1 y-axis scale.
>
> Data is extracted from environmental grids in a new (more memory
> efficient) way, which means that the random sample of background and
> the partition of samples into training / test will appear to use a
> different random seed than before.
>
> -- Steven
>
>    Date: Mon, 13 Oct 2008 08:58:38 -0700 (PDT)
>    From: =?ISO-8859-1?Q?M=F3nica=5FAlmeida?= <almeida.mon...@gmail.com>
Reply all
Reply to author
Forward
0 new messages