Re: hist_norm [message #73306] |
Wed, 03 November 2010 09:04 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paulo Penteado writes:
> I found it curious that though the mentioned hist.pro (not the
> hist.pro from JHUAPL, by the way), though using histogram() (as one
> would expect) comes with the comment
>
> "This is a radical departure from the IDL HISTOGRAM function, which is
> for something else, as far as anyone can tell."
I think it is the result of frustration. I felt exactly
the same way when I was building the Histoplot procedure. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: hist_norm [message #73307 is a reply to message #73306] |
Wed, 03 November 2010 08:51  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 3, 12:27 pm, David Fanning <n...@dfanning.com> wrote:
> le.dav...@tiscali.it writes:
>> Anyway, I downloaded all the required files (I suppose that because
>> now I don't have any error or warning), nevertheless the graphical
>> result is something far from the expected histogram.
>
> I can well believe it. :-)
>
> Depending upon why you are using Hist_Norm anyway, you
> might be interested in downloading yet *another* library
> and giving Histoplot a shot. A "normalized" histogram
> plot can be created by setting the FREQUENCY keyword:
I found it curious that though the mentioned hist.pro (not the
hist.pro from JHUAPL, by the way), though using histogram() (as one
would expect) comes with the comment
"This is a radical departure from the IDL HISTOGRAM function, which is
for something else, as far as anyone can tell."
|
|
|
Re: hist_norm [message #73308 is a reply to message #73307] |
Wed, 03 November 2010 08:08  |
jeanh
Messages: 79 Registered: November 2009
|
Member |
|
|
>>> for k=0, howmanyt-1, 1 do begin
>
> Thanks very much. "howmanyt" is something like 10^5.
>
> Anyway, I downloaded all the required files (I suppose that because
> now I don't have any error or warning), nevertheless the graphical
> result is something far from the expected histogram.
Be careful with the data type... you need longs, not integers! (for k
and howmanyt)
Jean
|
|
|
Re: hist_norm [message #73309 is a reply to message #73308] |
Wed, 03 November 2010 07:27  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
le.davide@tiscali.it writes:
> Anyway, I downloaded all the required files (I suppose that because
> now I don't have any error or warning), nevertheless the graphical
> result is something far from the expected histogram.
I can well believe it. :-)
Depending upon why you are using Hist_Norm anyway, you
might be interested in downloading yet *another* library
and giving Histoplot a shot. A "normalized" histogram
plot can be created by setting the FREQUENCY keyword:
Histoplot, data, /Frequency
You can learn more about it here:
http://www.dfanning.com/graphics_tips/histoplot.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: hist_norm [message #73310 is a reply to message #73309] |
Wed, 03 November 2010 07:05  |
le.davide
Messages: 18 Registered: November 2010
|
Junior Member |
|
|
On Nov 3, 1:00 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> On Nov 2, 9:28 pm, le.dav...@tiscali.it wrote:
>
>
>
>> Hi folks,
>> I am trying to use "hist_norm.pro" in a code like that (my first
>> time):
>
>> pro istog, howmanyt
>
>> t = fltarr(howmanyt)
>> N = 20.
>> for k=0, howmanyt-1, 1 do begin
>> t[k] = total(randomu(seed, N))
>> endfor
>
>> a = intarr(howmanyt) + 1
>> hist_norm, t, condition = a
>> end
>
>> I can't figure out why it does not work. Can you help me?
>> Thanks in advance.
>
> On an unrelated note, because my IDL optimization neurons cringe at
> unnecessary for loops, you might want to replace the first part of
> that with:
>
> N = 20L
> t = rebin(randomu(seed, N*howmanyt), howmanyt) * N
>
> Whether that makes any difference depends on how large howmanyt is.
>
> -Jeremy.
Thanks very much. "howmanyt" is something like 10^5.
Anyway, I downloaded all the required files (I suppose that because
now I don't have any error or warning), nevertheless the graphical
result is something far from the expected histogram.
|
|
|
Re: hist_norm [message #73314 is a reply to message #73310] |
Tue, 02 November 2010 22:00  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Nov 2, 9:28 pm, le.dav...@tiscali.it wrote:
> Hi folks,
> I am trying to use "hist_norm.pro" in a code like that (my first
> time):
>
> pro istog, howmanyt
>
> t = fltarr(howmanyt)
> N = 20.
> for k=0, howmanyt-1, 1 do begin
> t[k] = total(randomu(seed, N))
> endfor
>
> a = intarr(howmanyt) + 1
> hist_norm, t, condition = a
> end
>
> I can't figure out why it does not work. Can you help me?
> Thanks in advance.
On an unrelated note, because my IDL optimization neurons cringe at
unnecessary for loops, you might want to replace the first part of
that with:
N = 20L
t = rebin(randomu(seed, N*howmanyt), howmanyt) * N
Whether that makes any difference depends on how large howmanyt is.
-Jeremy.
|
|
|
|
Re: hist_norm [message #73316 is a reply to message #73315] |
Tue, 02 November 2010 19:54  |
le.davide
Messages: 18 Registered: November 2010
|
Junior Member |
|
|
The library is "misc" (which contains all the files above)?
On Nov 2, 10:51 pm, le.dav...@tiscali.it wrote:
> Could you tell me which is the library and where can I find it?
> Thanks.
>
> On Nov 2, 10:48 pm, David Fanning <n...@dfanning.com> wrote:
>
>> le.dav...@tiscali.it writes:
>>> This seems to be a long chain... I added the file "defined.pro", as
>>> you suggested. Hence, it turned out that I was missing something else:
>>> "hist.pro". Now I have "hist.pro" and:
>
>> Yes, it's a library. Better get them all and put
>> them on your IDL path. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>
|
|
|
Re: hist_norm [message #73317 is a reply to message #73316] |
Tue, 02 November 2010 19:51  |
le.davide
Messages: 18 Registered: November 2010
|
Junior Member |
|
|
Could you tell me which is the library and where can I find it?
Thanks.
On Nov 2, 10:48 pm, David Fanning <n...@dfanning.com> wrote:
> le.dav...@tiscali.it writes:
>> This seems to be a long chain... I added the file "defined.pro", as
>> you suggested. Hence, it turned out that I was missing something else:
>> "hist.pro". Now I have "hist.pro" and:
>
> Yes, it's a library. Better get them all and put
> them on your IDL path. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: hist_norm [message #73318 is a reply to message #73317] |
Tue, 02 November 2010 19:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
le.davide@tiscali.it writes:
> This seems to be a long chain... I added the file "defined.pro", as
> you suggested. Hence, it turned out that I was missing something else:
> "hist.pro". Now I have "hist.pro" and:
Yes, it's a library. Better get them all and put
them on your IDL path. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: hist_norm [message #73319 is a reply to message #73318] |
Tue, 02 November 2010 19:47  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 3, 12:37 am, le.dav...@tiscali.it wrote:
> This seems to be a long chain... I added the file "defined.pro", as
> you suggested. Hence, it turned out that I was missing something else:
> "hist.pro". Now I have "hist.pro" and:
>
> 1.when I compile it I get:
> % 1 Compilation error(s) in module HIST.
>
> str(nbins_guess,form="(I)")+' bins, for ' + $
> ^
> % Syntax error.
> At: /Users/davide/IDLWorkspace71/Default/astron/pro/hist.pro, Line
> 110
> % 1 Compilation error(s) in module HIST.
>
> 2. IDL> istog, 1000
> % Attempt to call undefined procedure/function: 'HIST'.
> % Execution halted at: HIST_NORM 92 /Users/davide/
> IDLWorkspace71/Default/astron/pro/hist_norm.pro
> % ISTOG 10 /Users/davide/
> IDLWorkspace71/Default/Default/istog.pro
> % $MAIN$
Now you are missing
http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/str.pro
It is a fair guess that you will encounter other dependencies.
|
|
|
Re: hist_norm [message #73321 is a reply to message #73319] |
Tue, 02 November 2010 19:37  |
le.davide
Messages: 18 Registered: November 2010
|
Junior Member |
|
|
This seems to be a long chain... I added the file "defined.pro", as
you suggested. Hence, it turned out that I was missing something else:
"hist.pro". Now I have "hist.pro" and:
1.when I compile it I get:
% 1 Compilation error(s) in module HIST.
str(nbins_guess,form="(I)")+' bins, for ' + $
^
% Syntax error.
At: /Users/davide/IDLWorkspace71/Default/astron/pro/hist.pro, Line
110
% 1 Compilation error(s) in module HIST.
2. IDL> istog, 1000
% Attempt to call undefined procedure/function: 'HIST'.
% Execution halted at: HIST_NORM 92 /Users/davide/
IDLWorkspace71/Default/astron/pro/hist_norm.pro
% ISTOG 10 /Users/davide/
IDLWorkspace71/Default/Default/istog.pro
% $MAIN$
On Nov 2, 10:16 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Nov 3, 12:10 am, le.dav...@tiscali.it wrote:
>
>> Hi, thanks for your quick answer.
>> I found hist_norm.pro here:http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/
>> it does not work in the sense that if I run the small code showed in
>> the first post I get:
>> % Variable is undefined: DEFINED.
>> % Execution halted at: HIST_NORM 69 /Users/davide/
>> IDLWorkspace71/Default/astron/pro/hist_norm.pro
>> % ISTOG 10 /Users/davide/
>> IDLWorkspace71/Default/Default/istog.pro
>> % $MAIN$
>
>> instead of an histogram.
>
> You seem to be missing
>
> http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/defined.pr o
|
|
|
Re: hist_norm [message #73322 is a reply to message #73321] |
Tue, 02 November 2010 19:16  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 3, 12:10 am, le.dav...@tiscali.it wrote:
> Hi, thanks for your quick answer.
> I found hist_norm.pro here:http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/
> it does not work in the sense that if I run the small code showed in
> the first post I get:
> % Variable is undefined: DEFINED.
> % Execution halted at: HIST_NORM 69 /Users/davide/
> IDLWorkspace71/Default/astron/pro/hist_norm.pro
> % ISTOG 10 /Users/davide/
> IDLWorkspace71/Default/Default/istog.pro
> % $MAIN$
>
> instead of an histogram.
>
You seem to be missing
http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/defined.pr o
|
|
|
Re: hist_norm [message #73323 is a reply to message #73322] |
Tue, 02 November 2010 19:10  |
le.davide
Messages: 18 Registered: November 2010
|
Junior Member |
|
|
Hi, thanks for your quick answer.
I found hist_norm.pro here: http://sprg.ssl.berkeley.edu/~fastsw/idlUtil/misc/
it does not work in the sense that if I run the small code showed in
the first post I get:
% Variable is undefined: DEFINED.
% Execution halted at: HIST_NORM 69 /Users/davide/
IDLWorkspace71/Default/astron/pro/hist_norm.pro
% ISTOG 10 /Users/davide/
IDLWorkspace71/Default/Default/istog.pro
% $MAIN$
instead of an histogram.
On Nov 2, 9:46 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Nov 2, 11:28 pm, le.dav...@tiscali.it wrote:
>
>
>
>> Hi folks,
>> I am trying to use "hist_norm.pro" in a code like that (my first
>> time):
>
>> pro istog, howmanyt
>
>> t = fltarr(howmanyt)
>> N = 20.
>> for k=0, howmanyt-1, 1 do begin
>> t[k] = total(randomu(seed, N))
>> endfor
>
>> a = intarr(howmanyt) + 1
>> hist_norm, t, condition = a
>> end
>
>> I can't figure out why it does not work. Can you help me?
>> Thanks in advance.
>
> You need to say more. In what way does it not work? Where does
> hist_norm come from? (hist_norm is not in the IDL standard library)
|
|
|
Re: hist_norm [message #73326 is a reply to message #73323] |
Tue, 02 November 2010 18:46  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 2, 11:28 pm, le.dav...@tiscali.it wrote:
> Hi folks,
> I am trying to use "hist_norm.pro" in a code like that (my first
> time):
>
> pro istog, howmanyt
>
> t = fltarr(howmanyt)
> N = 20.
> for k=0, howmanyt-1, 1 do begin
> t[k] = total(randomu(seed, N))
> endfor
>
> a = intarr(howmanyt) + 1
> hist_norm, t, condition = a
> end
>
> I can't figure out why it does not work. Can you help me?
> Thanks in advance.
You need to say more. In what way does it not work? Where does
hist_norm come from? (hist_norm is not in the IDL standard library)
|
|
|