Hyrdra Statistics

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Hyrdra Statistics

Post by joleenf »

I am trying to use the statistics from hydra in a script. I have a FlatField object that has missing values that should be NaN. When I run the statistics, I would like to know the number of points without counting the values that are missing. In the jython shell of McIDAS-V the code would be

Code: Select all

import edu.wisc.ssec.mcidasv.data.hydra.Statistics as Statistics;
a = the_visad.FlatField  with values of temperature and NaN

statsField = Statistics(a)

statsField.numGoodPoints



This does not work when linking to the hydra library via a jython shell without running of McIDAS-V. How do I get at that information?

Joleen
User avatar
tomw
Posts: 296
Joined: Tue Dec 23, 2008 3:40 pm

Re: Hyrdra Statistics

Post by tomw »

Be certain that you have the "commons-math3-3.2.jar" file in your classpath, since this is where all the stats code is located. It is part of the McIDAS-V distribution and is located in the installation McIDAS-V-System directory.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Hyrdra Statistics

Post by joleenf »

Hi Tom,

It is in my classpath. Other hyrdra functionality does work:

Code: Select all

statsField.mean()
statsField.max()
statsField.variance()


methods all work. However, the attributes (?) .numGoodPoints and .descriptiveStats do not.

Joleen
User avatar
mhiley
Posts: 90
Joined: Mon Jan 23, 2012 10:22 pm

Re: Hyrdra Statistics

Post by mhiley »

Hi Joleen,

Do you see any error message when you try to print numGoodPoints?

Also FWIW, numGoodPoints is actually an array of integers with length determined by the number of range components in your flatfield. Probably not the cause of the problem, but maybe worth mentioning.

-Mike
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Hyrdra Statistics

Post by joleenf »

Hi Mike,

I saw that it was an array, but I don't think that is the problem. Could it be an attribute that was added by Tom and is not part of the math commons library?

http://commons.apache.org/proper/common ... index.html

AttributeError: 'edu.wisc.ssec.mcidasv.data.hydra.Statistics' object has no attribute 'numGoodPoints'

Joelen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: Hyrdra Statistics

Post by Rick »

Hi Joleen,

We have created an inquiry to resolve you issue.

http://mcidas.ssec.wisc.edu/inquiry-v/in ... quiry=1474

Rick
Post Reply