Re: sigma_filter calling sequence [message #73891] |
Sun, 05 December 2010 09:16 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
burton449 writes:
> The only problem is with the Iterate (/ITERATE) option of this script.
> It doesnt work because of lack of memory in arrays. Im not sure if
> there is a way to fix that? What do you think David?
I think memory is cheap and that everyone who wants to work with
large data sets should be using 64-bit operating systems by now. :-)
> By the way, I have to mention that other scripts are necessary to run
> the NASA's sigma_filter.pro
Yes, in general if you get a program from a library, you
are going to need other programs from that same library.
Better to just get the whole darn thing and install it
somewhere on your IDL path. Although NOT where you seem
to be putting these programs, in the IDL bin directory
structure! That's a really bad place. I'd choose somewhere
else. :-)
http://www.dfanning.com/code_tips/installcoyote.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: sigma_filter calling sequence [message #73892 is a reply to message #73891] |
Sun, 05 December 2010 08:47  |
burton449
Messages: 15 Registered: December 2010
|
Junior Member |
|
|
On Dec 4, 8:04 pm, David Fanning <n...@dfanning.com> wrote:
> burton449 writes:
>> Ok!
>> the script and the image are in the directory d:\
>> the image is a .tif
>
>> In IDL command line I typed the calling sequence with those
>> parameters:
>
>> Result = sigma_filter( image.tif, 5, 2 )
>
>> I want the box_widht to be of 5 and the N_sigma to be 2.
>
>> The error i got is:
>
>> % Syntax error.
>> IDL> Result = sigma_filter( image.tif, 5, 2 )
>> % Expression must be a structure in this context: IMAGE.
>> % Execution halted at: $MAIN$
>
>> If try to show the path of the image like d:\\image.tif the error
>> message is:
>> % Illegal character in program text.
>
> The "image" in the command has to be the image itself,
> not the name of the file containing an image. So, you have
> to read the image data out of the image file.
>
> IDL> image = Read_Tiff('myimagefile.tif')
> IDL> Help, image
>
> Try that and see what happens. :-)
>
> 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.")
Thank you David,
It works fine now.
The only problem is with the Iterate (/ITERATE) option of this script.
It doesnt work because of lack of memory in arrays. Im not sure if
there is a way to fix that? What do you think David?
By the way, I have to mention that other scripts are necessary to run
the NASA's
sigma_filter.pro
You will need: filter_image.pro convolve.pro and pfs_gaussian.pro
all the scripts are available in NASA's website at this adress:
http://idlastro.gsfc.nasa.gov/contents.html
Greetings,
Max
|
|
|
Re: sigma_filter calling sequence [message #73895 is a reply to message #73892] |
Sat, 04 December 2010 17:04  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
burton449 writes:
> Ok!
> the script and the image are in the directory d:\
> the image is a .tif
>
> In IDL command line I typed the calling sequence with those
> parameters:
>
> Result = sigma_filter( image.tif, 5, 2 )
>
> I want the box_widht to be of 5 and the N_sigma to be 2.
>
> The error i got is:
>
> % Syntax error.
> IDL> Result = sigma_filter( image.tif, 5, 2 )
> % Expression must be a structure in this context: IMAGE.
> % Execution halted at: $MAIN$
>
> If try to show the path of the image like d:\\image.tif the error
> message is:
> % Illegal character in program text.
The "image" in the command has to be the image itself,
not the name of the file containing an image. So, you have
to read the image data out of the image file.
IDL> image = Read_Tiff('myimagefile.tif')
IDL> Help, image
Try that and see what happens. :-)
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: sigma_filter calling sequence [message #73896 is a reply to message #73895] |
Sat, 04 December 2010 15:55  |
burton449
Messages: 15 Registered: December 2010
|
Junior Member |
|
|
On Dec 4, 5:47 pm, David Fanning <n...@dfanning.com> wrote:
> burton449 writes:
>> I would like to use the sigma_filter.pro on an image in IDL 7.1.
>
>> Im a new user and I dont understand how the calling sequence works.
>> The documentation of the filter says that the calling sequence is:
>
>> Result = sigma_filter( image, box_width, N_sigma=(#), /ALL,/MON )
>
>> Can someone help me? I try it in IDL command Line without any success.
>
> Please send us the syntax of the command you used,
> and the error message. Otherwise we have to guess
> among about 100 things you could have done wrong.
>
> Good questions get good answers. :-)
>
> 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.")
Ok!
the script and the image are in the directory d:\
the image is a .tif
In IDL command line I typed the calling sequence with those
parameters:
Result = sigma_filter( image.tif, 5, 2 )
I want the box_widht to be of 5 and the N_sigma to be 2.
The error i got is:
% Syntax error.
IDL> Result = sigma_filter( image.tif, 5, 2 )
% Expression must be a structure in this context: IMAGE.
% Execution halted at: $MAIN$
If try to show the path of the image like d:\\image.tif the error
message is:
% Illegal character in program text.
Thank you for your help,
Max
|
|
|
Re: sigma_filter calling sequence [message #73897 is a reply to message #73896] |
Sat, 04 December 2010 14:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
burton449 writes:
> I would like to use the sigma_filter.pro on an image in IDL 7.1.
>
> Im a new user and I dont understand how the calling sequence works.
> The documentation of the filter says that the calling sequence is:
>
> Result = sigma_filter( image, box_width, N_sigma=(#), /ALL,/MON )
>
> Can someone help me? I try it in IDL command Line without any success.
Please send us the syntax of the command you used,
and the error message. Otherwise we have to guess
among about 100 things you could have done wrong.
Good questions get good answers. :-)
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: sigma_filter calling sequence [message #84609 is a reply to message #73895] |
Sun, 05 December 2010 08:36  |
burton449
Messages: 15 Registered: December 2010
|
Junior Member |
|
|
On Dec 4, 8:04 pm, David Fanning <n...@dfanning.com> wrote:
> burton449 writes:
>> Ok!
>> the script and the image are in the directory d:\
>> the image is a .tif
>
>> In IDL command line I typed the calling sequence with those
>> parameters:
>
>> Result = sigma_filter( image.tif, 5, 2 )
>
>> I want the box_widht to be of 5 and the N_sigma to be 2.
>
>> The error i got is:
>
>> % Syntax error.
>> IDL> Result = sigma_filter( image.tif, 5, 2 )
>> % Expression must be a structure in this context: IMAGE.
>> % Execution halted at: $MAIN$
>
>> If try to show the path of the image like d:\\image.tif the error
>> message is:
>> % Illegal character in program text.
>
> The "image" in the command has to be the image itself,
> not the name of the file containing an image. So, you have
> to read the image data out of the image file.
>
> IDL> image = Read_Tiff('myimagefile.tif')
> IDL> Help, image
>
> Try that and see what happens. :-)
>
> 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.")
Thank you David,
It works fine now.
I have to mention that other scripts are necessary to run the NASA's
sigma_filter.pro
You will need: filter_image.pro convolve.pro and pfs_gaussian.pro
all the scripts are available in NASA's website at this adress:
http://idlastro.gsfc.nasa.gov/contents.html
Greetings,
Max
|
|
|
Re: sigma_filter calling sequence [message #84610 is a reply to message #73895] |
Sun, 05 December 2010 07:44  |
burton449
Messages: 15 Registered: December 2010
|
Junior Member |
|
|
On Dec 4, 8:04 pm, David Fanning <n...@dfanning.com> wrote:
> burton449 writes:
>> Ok!
>> the script and the image are in the directory d:\
>> the image is a .tif
>
>> In IDL command line I typed the calling sequence with those
>> parameters:
>
>> Result = sigma_filter( image.tif, 5, 2 )
>
>> I want the box_widht to be of 5 and the N_sigma to be 2.
>
>> The error i got is:
>
>> % Syntax error.
>> IDL> Result = sigma_filter( image.tif, 5, 2 )
>> % Expression must be a structure in this context: IMAGE.
>> % Execution halted at: $MAIN$
>
>> If try to show the path of the image like d:\\image.tif the error
>> message is:
>> % Illegal character in program text.
>
> The "image" in the command has to be the image itself,
> not the name of the file containing an image. So, you have
> to read the image data out of the image file.
>
> IDL> image = Read_Tiff('myimagefile.tif')
> IDL> Help, image
>
> Try that and see what happens. :-)
>
> 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.")
Thank you David for your help, because I am used with Python, I have
the bad habit to try the same calling sequences in IDL. I did what you
told me, and script start running but there is a syntax error now.
This is what I did in IDL (I put the image and the .pro in the
IDL71\bin\bin.x86\ folder):
image = Read_Tiff('myimage.tif')
result = sigma_filter(image, 5, 2, /ALL, /MON )
This is the error message in brief:
%syntax error. ... at line 56
%Attempt to call undefined procedure/function: 'SIGMA_FILTER'
mean=( filter_image( image,SMO=box_width,ALL=all )*bw2 -
image )/
(bw2-1)
%syntax error. ... at line 63
imvar = fact*( filter_image( imdev,SMO=box_width,ALL=all )*bw2 -
imdev )
Do you think the error is in the script itself or in my calling
sequence?
Thanks again!
Max
|
|
|
Re: sigma_filter calling sequence [message #84611 is a reply to message #73895] |
Sun, 05 December 2010 07:41  |
burton449
Messages: 15 Registered: December 2010
|
Junior Member |
|
|
On Dec 4, 8:04 pm, David Fanning <n...@dfanning.com> wrote:
> burton449 writes:
>> Ok!
>> the script and the image are in the directory d:\
>> the image is a .tif
>
>> In IDL command line I typed the calling sequence with those
>> parameters:
>
>> Result = sigma_filter( image.tif, 5, 2 )
>
>> I want the box_widht to be of 5 and the N_sigma to be 2.
>
>> The error i got is:
>
>> % Syntax error.
>> IDL> Result = sigma_filter( image.tif, 5, 2 )
>> % Expression must be a structure in this context: IMAGE.
>> % Execution halted at: $MAIN$
>
>> If try to show the path of the image like d:\\image.tif the error
>> message is:
>> % Illegal character in program text.
>
> The "image" in the command has to be the image itself,
> not the name of the file containing an image. So, you have
> to read the image data out of the image file.
>
> IDL> image = Read_Tiff('myimagefile.tif')
> IDL> Help, image
>
> Try that and see what happens. :-)
>
> 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.")
Thank you David for your help, because I am used with Python, I have
the bad habit to try the same calling sequences in IDL. I did what you
told me, and script start running but there is a syntax error now.
This is what I did in IDL (I put the image and the .pro in the
IDL71\bin\bin.x86\ folder):
image = Read_Tiff('myimage.tif')
sigma_filter(image, 5, 2, /ALL, /MON )
This is the error message in brief:
%syntax error. ... at line 56
%Attempt to call undefined procedure/function: 'SIGMA_FILTER'
mean=( filter_image( image,SMO=box_width,ALL=all )*bw2 - image )/
(bw2-1)
%syntax error. ... at line 63
imvar = fact*( filter_image( imdev,SMO=box_width,ALL=all )*bw2 -
imdev )
Do you think the error is in the script itself or in my calling
sequence?
Thanks again!
Max
|
|
|