MRF-ERROR: Is a directory

how to overcome this error :

MRF-ERROR: Is a directory


regards,
Indra

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
indrag [ Mi, 16 März 2011 19:44 ] [ ID #2056678 ]

Re: MRF-ERROR: Is a directory

On 11-03-16 02:44 PM, indrag [at] students.itb.ac.id wrote:
> how to overcome this error :
>
> MRF-ERROR: Is a directory

Please show the code.


--
Just my 0.00000002 million dollars worth,
Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software: Fail early & often.

Eliminate software piracy: use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Shawn H Corey [ Mi, 16 März 2011 19:49 ] [ ID #2056679 ]

Re: MRF-ERROR: Is a directory

--20cf3054a289ee1778049e9e0728
Content-Type: text/plain; charset=UTF-8

On Wed, Mar 16, 2011 at 11:44 AM, <indrag [at] students.itb.ac.id> wrote:

> how to overcome this error :
>
> MRF-ERROR: Is a directory
>
>
>
Please post the entire code.

~Parag

--20cf3054a289ee1778049e9e0728--
Parag Kalra [ Mi, 16 März 2011 19:49 ] [ ID #2056681 ]

Re: MRF-ERROR: Is a directory

--bcaec517c4fc59c7da049e9e31a3
Content-Type: text/plain; charset=ISO-8859-1

Mornin' --

Please include the code that is giving you this error, otherwise we are
hypothesizing in vacuum. Off hand, I say that you are performing some file
operation that is not permitted for directories, and you have crossed your
hands and handed your code a directory rather than a file. But, with out
the context of the code ....


B

On Wed, Mar 16, 2011 at 11:44 AM, <indrag [at] students.itb.ac.id> wrote:

> how to overcome this error :
>
> MRF-ERROR: Is a directory
>
>
> regards,
> Indra
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
> For additional commands, e-mail: beginners-help [at] perl.org
> http://learn.perl.org/
>
>
>


--

Bob Goolsby
bob.goolsby [at] gmail.com

--bcaec517c4fc59c7da049e9e31a3--
Bob goolsby [ Mi, 16 März 2011 20:02 ] [ ID #2056682 ]

Re: MRF-ERROR: Is a directory

this is the code:
************************************
#!/usr/bin/perl

use NetCDF;

if( [at] ARGV == 6){
print "ARGV ERROR \n";
print "date hhmm Noise Radius AZ1 AZ2\n";
exit(1);
}
$date = $ARGV[0];
$hhmn = $ARGV[1];
$opt_Noise = $ARGV[2];
$radius = $ARGV[3];
$AZ1 = $ARGV[4];
$AZ2 = $ARGV[5];


$year = 2011;
$radar = "EWR";
$work = "/work/radar/radar_mkCAPPI/volume/Husein_20110221";

$unfold = "/work/radar/radar_mkCAPPI/volume/${radar}_unfold/${year}";
system("ls ${work}/${date}${hhmn}/${file} > list");

open(FP,"list");


close(FP);



open(FP,"list");

while(defined($file = <FP>)){
chomp($file);
$orgF = "${work}/${file}";
system("mkdir -p ${unfold}");
print "$orgF \n";

####### FILE NAME CHANGE for minimum time ###########
system("cp $orgF test.nc");
$ncid = NetCDF::open("test.nc",WRITE);
$varid= NetCDF::varid($ncid,"M_time");
$dimid= NetCDF::dimid($ncid,"Rays");
NetCDF::diminq($ncid,$dimid,$name,$RAY_NUM);
[at] start = (0);
[at] count = ($RAY_NUM);
NetCDF::varget($ncid,$varid,\ [at] start,\ [at] count,\ [at] UNIX_TIME);

$min = time();
for($i=0;$i<$RAY_NUM;$i++){
if($min > $UNIX_TIME[$i]){
$min = $UNIX_TIME[$i];
}
}
($sec,$min,$hh,$dd,$mm,$yy,$weak,$yday,$opt) = localtime($min);
$yy+=1900;
$mm+=1;

$head = substr($file,0,2);
$EL = substr($file,15,3);
$hh = sprintf("%02d",$hh);
$dd = sprintf("%02d",$dd);
$min = sprintf("%02d",$min);
$sec = sprintf("%02d",$sec);
$mm = sprintf("%02d",$mm);

$file2 = "${head}${mm}${dd}${hh}${min}${sec}_EL${EL}.nc";
$outF = "${unfold}/$file2";

############ CUT NOISE #####################
if($opt_Noise eq "ON"){
$varid= NetCDF::varid($ncid,"M_range_to_bin");
$dimid= NetCDF::dimid($ncid,"Bins");
NetCDF::diminq($ncid,$dimid,$name,$BIN_NUM);
[at] start = (0);
[at] count = ($BIN_NUM);
NetCDF::varget($ncid,$varid,\ [at] start,\ [at] count,\ [at] RANGE);

$varid= NetCDF::varid($ncid,"M_az");
[at] start = (0);
[at] count = ($RAY_NUM);
NetCDF::varget($ncid,$varid,\ [at] start,\ [at] count,\ [at] AZ);

$varid= NetCDF::varid($ncid,"M_ref");
[at] start = (0,0);
[at] count = ($RAY_NUM,$BIN_NUM);
NetCDF::varget($ncid,$varid,\ [at] start,\ [at] count,\ [at] REF);
NetCDF::attget($ncid,$varid,"scale_factor",\ [at] scale_factor);
NetCDF::attget($ncid,$varid,"add_offset",\ [at] add_offset);
NetCDF::attget($ncid,$varid,"missing_value",\ [at] missing_value) ;
print "$missing_value[0] \n";

for($j=0;$j<$RAY_NUM;$j++){
for($i=0;$i<$BIN_NUM;$i++){
if($RANGE[$i] < $radius * 1000){
$REF[$j*$BIN_NUM+$i]= $missing_value[0];
}

if($AZ[$j] > $AZ1 && $AZ[$j] < $AZ2 ){
$REF[$j*$BIN_NUM+$i]= $missing_value[0];
}

}
}

NetCDF::varput($ncid,$varid,\ [at] start,\ [at] count,\ [at] REF);

$varid= NetCDF::varid($ncid,"M_vel");
NetCDF::varget($ncid,$varid,\ [at] start,\ [at] count,\ [at] VEL);
NetCDF::attget($ncid,$varid,"scale_factor",\ [at] scale_factor);
NetCDF::attget($ncid,$varid,"add_offset",\ [at] add_offset);
print "$scale_factor[0] $add_offset[0] \n";

for($j=0;$j<$RAY_NUM;$j++){
for($i=0;$i<$BIN_NUM;$i++){
if($RANGE[$i] < $radius * 1000){
$VEL[$j*$BIN_NUM+$i]= $missing_value[0];
}

if($AZ[$j] > $AZ1 && $AZ[$j] < $AZ2 ){
$VEL[$j*$BIN_NUM+$i]= $missing_value[0];
}

}
}

NetCDF::varput($ncid,$varid,\ [at] start,\ [at] count,\ [at] VEL);
NetCDF::close($ncid);

}

if($opt_Noise eq "ON"){




system("rm -f test.nc dummy");
}else{

if($orgF =~ /AZ\d\d\d/){
next;
}




}



********************************************************
regards,
Indra


----- Original Message -----
From: "Parag Kalra" <paragkalra [at] gmail.com>
To: indrag [at] students.itb.ac.id
Cc: beginners [at] perl.org
Sent: Thursday, March 17, 2011 1:49:15 AM
Subject: Re: MRF-ERROR: Is a directory




On Wed, Mar 16, 2011 at 11:44 AM, < indrag [at] students.itb.ac.id > wrote:


how to overcome this error :

MRF-ERROR: Is a directory




Please post the entire code.


~Parag

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
indrag [ Mi, 16 März 2011 20:26 ] [ ID #2056683 ]

Re: MRF-ERROR: Is a directory

>>>>> "i" == indrag <indrag [at] students.itb.ac.id> writes:

i> #!/usr/bin/perl

i> use NetCDF;

use strict ;
use warnings ;

those ask perl to help you. always use them. you will have to declare
all your vars with my when using strict but that is the point.


i> if( [at] ARGV == 6){

that makes no sense. you look for 6 args in [at] ARGV just below but if you
pass in 6 args on the commane line you print an error. it should be !=
to make sure you get 6 args.

i> print "ARGV ERROR \n";
i> print "date hhmm Noise Radius AZ1 AZ2\n";

is your program called date? that is already a standard unix command so
don't use that name. if date is an argument then you should also show
the command name in the usage. make the ARGV error say what the error
is (wrong number of arguments).

i> exit(1);
i> }
i> $date = $ARGV[0];
i> $hhmn = $ARGV[1];
i> $opt_Noise = $ARGV[2];
i> $radius = $ARGV[3];
i> $AZ1 = $ARGV[4];
i> $AZ2 = $ARGV[5];


i> open(FP,"list");

why do you open and then immediately close the file? also you should
always check for success/failure when opening files.

open( FP, 'list' ) or die "can't open 'list': $!" ;

i> while(defined($file = <FP>)){

good that you used defined there but in recent perls that is always done
with the while $file = <FP> idiom.

i> chomp($file);
i> $orgF = "${work}/${file}";
i> system("mkdir -p ${unfold}");

perl has mkdir builtin. File::Path (a core module) has mkpath which is
the same as mkdir -p.

i> print "$orgF \n";

i> ####### FILE NAME CHANGE for minimum time ###########
i> system("cp $orgF test.nc");

you don't need to system call out for that. there is a File::Copy
module.

there is too much module specific code in the rest for me to comment.

uri

--
Uri Guttman ------ uri [at] stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Uri Guttman [ Mi, 16 März 2011 22:21 ] [ ID #2056684 ]

Re: MRF-ERROR: Is a directory

On Thu, 17 Mar 2011 02:26:06 +0700, indrag wrote:

> this is the code:
> ************************************
> #!/usr/bin/perl
>
> use NetCDF;

The error is coming out of NetCDF.pm. Check all of the calls you make to=

functions from that module against its documentation.

Did you write the program you posted or did someone else? Do you
understand it?

--
Peter Scott
http://www.perlmedic.com/ http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=3D0137001274
http://www.oreillyschool.com/courses/perl3/

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Peter Scott [ Do, 17 März 2011 14:04 ] [ ID #2056726 ]
Perl » gmane.comp.lang.perl.beginners » MRF-ERROR: Is a directory

Vorheriges Thema: Read/Write XML file
Nächstes Thema: Read and change the file