Error when using acre.pro routine: "Programs can't be compiled from single statement mode" - idl-programming-language

I am trying to use acre.pro routine. It is a cosmic ray extraction program used to identify and remove cosmic ray strikes from an image. Here is an excerpt from the documentation of the routine (https://www.boulder.swri.edu/~buie/idl/pro/acre.html)
CALLING SEQUENCE:
; pro acre,dirty_im,clean_im,thresh,width
INPUTS:
; dirty_im - Original input image to be cleaned.
; thresh - Deviation threshold, in sigma, from background to cause
; pixel to be fixed.
; width - Median smoothing width to get local background reference.
OUTPUTS:
; clean_im - Final cleaned up image.
I followed the above procedure to use this program, however, IDL gives me two errors:
"Syntax Error" and "Programs can't be compiled from single statement mode."
Here is two of the many things that I've tried and the errors that I got:
IDL> pro acre ,'N1487262225_2cal.IMG','cosmic_clean.IMG',3,7
pro acre ,'N1487262225_2cal.IMG','cosmic_clean.IMG',3,7
^
% Syntax error.
IDL> pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Programs can't be compiled from single statement mode.
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Programs can't be compiled from single statement mode.
pro acre ,N1487262225_2.IMG,cosmic_clean.IMG,3,7
^
% Syntax error.

Try:
IDL> acre, 'N1487262225_2cal.IMG', 'cosmic_clean.IMG', 3, 7

Related

How to add runtime library in Ada multi 7.2.4

I am trying t execute ada multi program using batch file but I am getting this errors:
_d_dtof
_d_dmul
For the below line:
long float := long float (int) * long float;
I think he mean to say for variables only for example
long float : a, b, c;
integer : x;
NOW...
a := b(x) * c;
even I got the same errors for that line but the difference is when using IDE (Ada multi 7.2.4 tool) I did not got any errors, but same code when I used using command promt I got errors. Which means a run time library is unable to link those errors.
I got the below errors...
_d_dtof
_d_add
_d_div
_d_ftod
_d_sub
_d_itod
_d_utod
_d_dtou
and the code is in Ada language.

Lattice Diamond Clock Constraint, cannot properly identify signal,port, pin, net

The design has an internal oscillator of 2.08 mhz. The 2.08 logic has no timing errors reported once compiled, place and routed. An async clock input, 100 MHz rate, has timing errors. Trying to use the constraints to set the clock rate. I cannot seem to properly identify the net, pin, or port to set the constraint. It failed with the below warnings.
constraint.lcd file line is: create_clock -period 50.000000 -name clk1 [get_nets pin22_c]
--------------------------it failed using the constraint with this message -----------------------------------------
WARNING - No object with type NET found matching pin22_c;
WARNING - Ignoring Constraint: create_clock -period 50.000000 -name clk1 [get_nets pin22_c].
------------------------the report before using the constrain file ----------------------------------------------
Constraint: create_clock -period 5.000000 -name clk1 [get_nets pin22_c]
119 items scored, 21 timing errors detected.
Error: The following path violates requirements by 2.088ns
Logical Details: Cell type Pin type Cell name (clock net +/-)
Source: FD1P3IX CK \so/sireaddone_30 (from pin22_c +)
Destination: FD1S3AX D \so/shiftreg_i4 (to pin22_c +)
Delay: 6.928ns (27.8% logic, 72.2% route), 4 logic levels.
Constraint Details:
6.928ns data_path \so/sireaddone_30 to \so/shiftreg_i4 violates
5.000ns delay constraint less
0.160ns L_S requirement (totaling 4.840ns) by 2.088ns
All day struggle with lattice diamond trying to set the clock constraint... finally figured out what needs doing.
process the design so to have a netlist
i used an empty constraint abc.lcd file so it was in the file list
right click on this file list tab and open with lcd editor
now double click the source box and selected clock port, select pin22
double click the other boxes and enter desired values
then under file click the save to save the file
rerun the process and all is well and that clock is set 20 MHz
be happy, but dissapointed with LATTICE!
then look at the file to find the syntax is not even close to what the manuals state!
#
create_clock -period 50.000000 -name asyncclk [ get_ports { pin22 } ]
#

Syntax error caused by using different version of IDL

I am new in IDL. When I use IDL version 8, my program run successfully. But when I use IDL Version 7.1 I get a syntax error that you can see below.
How can I fix this issue?
IDL> .com schwmodfirstiter_box.pro
str +=pars[i].name+strn(p[i],format='('+pars[i].sformat+')')
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 5
% 1 Compilation error(s) in module SCHMAKEPARSTRING.
str +=pars[i].name+strn(p[i],format='('+pars[i].sformat+')')
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 14
% 1 Compilation error(s) in module SCHMAKEPARSTRING0.
mlstr=pars[0].name+strn(ml[k],format='('+pars[0].sformat+')')+'/'
^
% Syntax error.
At: /home/behzad/schwmodfirstiter_box.pro, Line 63
% 1 Compilation error(s) in module SCHMAKEMODEL.
% Compiled module: SUBMITORBLIB.
% Compiled module: COMPILENNLS.
% Compiled module: SCHWMODFIRSTITER.
IDL>
% Interrupt encountered.
strn.pro is not part of IDL but is likely from
https://idlastro.gsfc.nasa.gov/ftp/pro/misc/strn.pro
Make sure you have this procedure in your !Path and can compile it.

eval_objective command for automatic architectures

This is an automatic architecture code(source: http://openmdao.org/releases/0.13.0/docs/tutorials/mdao/optproblem.html)
I have a doubt that what will be the code to print the minimum value of the objective function.
It may be very trivial but I am not getting it. I tried using eval_objective but it is not working. What code is to be added to this existing one?
def display_results():
print "Minimum found at (%f, %f, %f)" % (problem.dis1.z1,
problem.dis1.z2,
problem.dis1.x1)
print "Couping vars: %f, %f" % (problem.dis1.y1, problem.dis2.y2)
print "Function calls dis1: %d, dis2: %d"%(problem.dis1.exec_count,problem.dis2.exec_count)
print "\n"
that code assumes that the optimizer finished and left the model sitting at the point that gave the lowest objective. For all gradient based optimizers this is a reasonable assumption.
To do the same thing in openmdao > 1.7.x, see the following tutorial:
http://openmdao.readthedocs.io/en/1.7.3/usr-guide/tutorials/paraboloid-tutorial.html#optimization-of-the-paraboloid-with-a-constraint
print('Minimum of %f found at (%f, %f)' % (top['p.f_xy'], top['p.x'], top['p.y']))

OpenCL double precision not working

So I have a project that I created on Mac Pro using double data type and it works perfect. Now I moved my project to MacBook Air and it started giving me
Exception
ERROR: clBuildProgram(-11)
error. Now the reason for this is that my MacBook Air does not support the double precision type with OpenCL. But on the contrary, I found this: OpenCL kernel error on Mac OSx. I applied the method in the answer like this:
cl_device_fp_config cfg;
clGetDeviceInfo(devicesIds[0], CL_DEVICE_DOUBLE_FP_CONFIG, sizeof(cfg), &cfg, NULL); // 0 is for the device number I guess?
printf("Double FP config = %llu\n", cfg);
And he explained that if the result is 0, then it means that double precision is not supported. But I get this result:
Double FP config = 63
I also tried this method:
if (!cfg) {
printf("Double precision not supported \n\n");
} else {
printf("Following double precision features supported:\n");
if(cfg & CL_FP_INF_NAN)
printf(" INF and NaN values\n");
if(cfg & CL_FP_DENORM)
printf(" Denormalized numbers\n");
if(cfg & CL_FP_ROUND_TO_NEAREST)
printf(" Round To Nearest Even mode\n");
if(cfg & CL_FP_ROUND_TO_INF)
printf(" Round To Infinity mode\n");
if(cfg & CL_FP_ROUND_TO_ZERO)
printf(" Round To Zero mode\n");
if(cfg & CL_FP_FMA)
printf(" Floating-point multiply-and-add operation\n\n");
}
And I got the following results:
Double FP config = 63
Following double precision features supported:
INF and NaN values
Denormalized numbers
Round To Nearest Even mode
Round To Infinity mode
Round To Zero mode
Floating-point multiply-and-add operation
What is going on here? Does my system support double precision with OpenCL or not? If yes, how do I enable and use it? If not, what are my alternatives?
Now I am very confused. First of all, I don't know if my MacBook Air supports double precision or not? Apparently it doesn't. But with the output, it seems like it does.
If it doesn't support double precision, then what should I do? Should I change everything in my project to float values? OR if it does, then how do I enable it? Because I followed a lot of tutorials and examples and none of them work. e.g. https://streamcomputing.eu/blog/2013-10-17/writing-opencl-code-single-double-precision/ but none of them seem to work.
EDIT:
Unfortunately double support is "optional" in OpenCL, some devices support it and some don't...
If a device supports double then the device extensions (CL_DEVICE_EXTENSIONS) will contain cl_khr_fp64 or cl_khr_fp64.
There is some example kernel code here to use floats when doubles aren't available.

Resources