Re: Volume Size [message #11381] |
Thu, 09 April 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
[A copy of this article was sent to the cited author.]
Whoops, as a long-time IDL user I am still prone to beginner
mistakes. :-( I wrote this:
> Presumably you can distinguish the pores by some "value"
> in the 3D volume. Suppose the pores had values less than
> 10 and the rock (rest of the 3D volume) had values greater
> than 10. Then calculating the percentage volume of the pores
> is as simple as this:
>
> pores = Where(volume LE 10)
> percent_pores = N_Elements(volume[pores])/N_Elements(volume)
And what I *should* have written is this:
percent_pores = FLOAT(N_Elements(volume[pores]))/N_Elements(volume)
Or you will be looking at a 0 percent, always!
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Volume Size [message #11382 is a reply to message #11381] |
Thu, 09 April 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Andy Wales (wales@chrs1.chem.lsu.edu) writes:
> As a newcomer to the world of IDL (I have been using it for three
> weeks!) I would like to know if there is any way that IDL can be used to
> measure the percentage volume of an object. To use a geological example
> - can I find out the percent-volume of the pores in a rock?
>
> Most of our data is stored as 2D 'slices' as .cdf files and then
> constructed into a 3D common block form in IDL
Presumably you can distinguish the pores by some "value"
in the 3D volume. Suppose the pores had values less than
10 and the rock (rest of the 3D volume) had values greater
than 10. Then calculating the percentage volume of the pores
is as simple as this:
pores = Where(volume LE 10)
percent_pores = N_Elements(volume[pores])/N_Elements(volume)
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|