comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: hist_2d, contour
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: hist_2d, contour [message #66574 is a reply to message #66573] Wed, 27 May 2009 05:13 Go to previous messageGo to previous message
Nicolas Aunai is currently offline  Nicolas Aunai
Messages: 5
Registered: May 2009
Junior Member
David Fanning wrote:
> Nicolas Aunai writes:
>
>> I have a problem trying to contour the return value of HIST_2D.
>> my code is the following :
>
> I think the first thing I would try would be setting
> the MIN and MAX keywords in HIST_2D. My experience with
> IDL is that when you let it decide what to do, unexpected
> results are the rule. :-)
>
> Cheers,
>
> David


OH !

the following code does what I want :


tstudy = 8.0
!p.multi = [0,1,1,0]
window,2,retain=2

bin = 0.05
eci = MIN(ec(*,0)) + bin*lindgen(1+(max(ec(*,0))-min(ec(*,0)))/bin)
ecf = MIN(ec(*,tstudy)) +
bin*lindgen(1+(max(ec(*,tstudy))-min(ec(*,tstudy)))/bin)
;distr = HIST_2D(ec(*,0) , ec(*,tstudy), bin1=bin, bin2=bin)


distr = HIST_2D(ec(*,0) , ec(*,tstudy), bin1=bin, bin2=bin,
min1=min(ec(*,0)), max1=max(ec(*,0)), min2=min(ec(*,tstudy)), $
max2=max(ec(*,tstudy)))




just like you said I have just set the min1,min2,max1,max2 values... to
what I thought were the DEFAULT values (this is what the help says...)


I get :



IDL> help,eci,ecf,distr
ECI FLOAT = Array[132]
ECF FLOAT = Array[135]
DISTR LONG = Array[132, 135]



while the previous code :



IDL> tstudy = 8.0
IDL> !p.multi = [0,1,1,0]
IDL> window,2,retain=2
IDL>
IDL> bin = 0.05
IDL> eci = MIN(ec(*,0)) + bin*lindgen(1+(max(ec(*,0))-min(ec(*,0)))/bin)
IDL> ecf = MIN(ec(*,tstudy)) +
bin*lindgen(1+(max(ec(*,tstudy))-min(ec(*,tstudy)))/bin)
IDL> distr = HIST_2D(ec(*,0) , ec(*,tstudy), bin1=bin, bin2=bin)


gives :

ECI FLOAT = Array[132]
ECF FLOAT = Array[135]
DISTR LONG = Array[132, 137]



so the help is wrong ? :-)





last question :

should I do :

eci = MIN(ec(*,0)) + bin*lindgen(ceil((max(ec(*,0))-min(ec(*,0)))/bin))

or


eci = MIN(ec(*,0)) + bin*lindgen(1+(max(ec(*,0))-min(ec(*,0)))/bin)


??





thx a lot for your help
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: hist_2d, contour
Next Topic: Re: ROTATE MODEL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 10:04:52 PDT 2025

Total time taken to generate the page: 2.55902 seconds