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

Home » Public Forums » archive » BYTSCL function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
BYTSCL function [message #91269] Thu, 25 June 2015 04:41 Go to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I am using the BYTSCL function to scale all values of my array and also because I want to be returned in byte type.

For the array A with max = 4745.34 and min = -726643. I used the BYTSCL(A, min=0., max=160.)

For the array B with max = 7.82217e+007 and min = -5.47788e+008 I tried to used only BYTSCL(B) but my image is not good. I guess that's because the max and min values are very large and small respectively?
Re: BYTSCL function [message #91270 is a reply to message #91269] Thu, 25 June 2015 05:09 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> I am using the BYTSCL function to scale all values of my array and also because I want to be returned in byte type.
>
> For the array A with max = 4745.34 and min = -726643. I used the BYTSCL(A, min=0., max=160.)
>
> For the array B with max = 7.82217e+007 and min = -5.47788e+008 I tried to used only BYTSCL(B) but my image is not good. I guess that's because the max and min values are very large and small respectively?

Linear scaling on such images may result in low-contrast images. You may
prefer a log-type scaling to improve the visual result:

http://www.idlcoyote.com/ip_tips/xstretch.php

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: BYTSCL function [message #91276 is a reply to message #91269] Thu, 25 June 2015 07:20 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Thursday, 25 June 2015 04:41:18 UTC-7, g.na...@gmail.com wrote:
> I am using the BYTSCL function to scale all values of my array and also because I want to be returned in byte type.
>
> For the array A with max = 4745.34 and min = -726643. I used the BYTSCL(A, min=0., max=160.)
>
> For the array B with max = 7.82217e+007 and min = -5.47788e+008 I tried to used only BYTSCL(B) but my image is not good. I guess that's because the max and min values are very large and small respectively?

(You didn't say in what way your "image is not good", so we have to guess... please clarify if we are guessing wrong)

Careful with those keywords to BYTSCL(): MIN= and MAX= refer to the *original* data values, which will come out in the result as 0 and 255, respectively (all original values at or below 0 would come out black, values above 160 would come out white). I wonder if you actually want the result that you'd get with simply using BYTSCL(A) and BYTSCL(B), where the extreme values are the only ones that are black or white, everything else in shades of grey.

If you were meaning that 0-160 is the range you want for the output values, then TOP=160 is the keyword to add.

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extraction from *.txt file
Next Topic: HELP with IF statement

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

Current Time: Wed Oct 08 11:37:08 PDT 2025

Total time taken to generate the page: 0.00377 seconds