ariesteam / aries

http://www.ariesonline.org
GNU General Public License v3.0
6 stars 1 forks source link

puget successional stage classification broken #6

Closed kbagstad closed 13 years ago

kbagstad commented 13 years ago

Ciao Ferd -

First of two big new problems as I continue struggling to get results for Puget Sound and San Pedro by the end of the week (uggh). Successional stage in the Puget Sound models was definitely working before, and while I swapped out a new data layer, it still works correctly when you: rank -d ecology:SuccessionalStage core.contexts.beta/viewshed256. However any model -d or -o statement (e.g., model -o pugetcarbon.nc core.models.carbon-puget/successional-stage core.contexts.beta/viewshed throws the following error:

java.lang.NullPointerException
        at org.integratedmodelling.corescience.implementations.datasources.MemObjectContextualizedDatasource.getDataAsDoubles(MemObjectContextualizedDatasource.java:173)
        at org.integratedmodelling.corescience.metadata.Metadata.getImageData(Metadata.java:682)
        at org.integratedmodelling.modelling.visualization.ObservationListing.listCategories(ObservationListing.java:86)
        at org.integratedmodelling.modelling.visualization.ObservationListing.dump(ObservationListing.java:72)
        at org.integratedmodelling.modelling.commands.ModelCommand.execute(ModelCommand.java:218)
        at org.integratedmodelling.thinklab.command.CommandManager.submitCommand(CommandManager.java:144)
        at org.integratedmodelling.thinklab.commandline.Shell.startConsole(Shell.java:114)
        at org.integratedmodelling.thinklab.shell.ShellApplication.startApplication(ShellApplication.java:130)
        at org.java.plugin.boot.Boot.boot(Boot.java:346)
        at org.java.plugin.boot.Boot.main(Boot.java:243)

The defmodel statement again is painfully simple, and rank -d looks fine, so assume we're left with a classification issue? This is preventing me from running most of the Puget Sound models, which I'm supposed to present at USSEE next week...

(defmodel successional-stage SuccessionalStage
     (classification (ranking ecology:SuccessionalStage)
            #{5 6}                             OldGrowth
            4                                  LateSuccession
            3                                  MidSuccession
            2                                  PoleSuccession
            1                                  EarlySuccession
            #{21 22 23 24 25 26 27 28 40 41}   NoSuccession))
fvilla commented 13 years ago

Fixed in dev (classification worked fine, only a data conversion problem when writing/displaying).

kbagstad commented 13 years ago

Model -d looks fine, and model -o works for both successional-stage and models it depends on. However if you model -o successional stage, the output netCDF gives only values of 0 or nodata when there are clearly data there. Try model -o succtest3.nc core.models.flood-puget/successional-stage core.contexts.beta/chehalis to see if you can replicate.

kbagstad commented 13 years ago

Well, damned if I know what's up with this thing. At Gary's suggestion I looked at the .xml (in common.xml) and tried switching it from a ranking to a numeric-coding (which is probably more correct). Now I can't even get it to rank -d. Great, I really do break things worse when I touch them!

fvilla commented 13 years ago

The reason for outputting 0s was that the concept is an ordered ranking in the ontology but its subclasses only rank lexicographically partially - there is a No concept but the others have unrelated names. The thinklab.ordering configuration wasn't implemented so that didn't help and the only concept available was the No = 0, everything else was output as nodata instead of the order of the concept. Now the ordering specifications in config are honored and the concepts show in visualizations (output of -d is not affected).