[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[McIDAS #PKJ-573885]: mcidas: problem using imgcopy

Hi Patrick,

> I am having a problem using the MCIDAS imgcopy command. I suspect it's an 
> issue
> of 'user error'.
> *** What I am trying to do is copy data from a remote server to a local
> directory using command line only.

OK.  This should be easy enough...

> *** What I've done:
> I've mapped the remote and local data sets:
> dataloc.k ADD MSG

Looks good.

> dsserve.k ADD LOCAL/MSG AREA DIR='/data/scratch/msgglob09i*'  TYPE=IMAGE 
> “M8
> Latest MSG-1 band 9 10.8 um REALTIME

I believe that this is your problem.  The server that will write output files
in AREA format (the ones you want to copy to) needs to know how to name files 
AREA naming conventions.  Your ADDE dataset specification does not contain the
needed information to do this.  The DIRFILE= keyword specification for an output
dataset namespace does not contain enough information to uniquely name files.
For instance, a DIRFILE= that looks like:


might, at first glance, seem to uniquely specify an output name space of
/data/scratch/mgsglob09i/AREA3000, /data/scratch/mgsglob09i/AREA3001, ...
/data/scratch/mgsglob09i/AREA3999, but it does not.  In fact the set of
names specified in this example is _anything_ beginning with AREA3.

What you need to do is tell DSSERVE that you want to create a specific output
namespace.  Here is one example:

dsserve.k ADD LOCAL/MSG AREA 3000 3999 \"M8 Latest MSG-1 band 9 10.8 um REALTIME

The unfortunate part about defining a dataset like this is that McIDAS does not
one to use the DIRFILE= keyword in conjunction with the range of output AREA
file numbers, 3000-3999 in this case.  Instead, you have to tell McIDAS where
the files exist in one of two ways:


> I've created the directory /data/scratch/msgglob09i and can write to the
> directory as the user running mcidas.

Since you want to write output files to the /data/scratch/msgglob09i directory,
you would specify this directory as the first directory in your MCPATH.  For
example (that assumes that the HOME directory for 'rtoper' is /home/rtoper):

setenv MCDATA /data/scratch/msgglob09i
setenv MCPATH 

In lieu of a file REDIRECTion, McIDAS will write output to the first writable
directory in the MCPATH set of directories that is in scope when a command is 
So, with this environment setup, you could run:

imgcopy.k MSG/MSGGLOB03I.1 LOCAL/MSG.1

and the resultant output will be the file /data/scratch/msgglob09i/AREA3000

The other way to 'teach' McIDAS about where it should look for files is
by use of the REDIRECT facility:

REDIRECT sets up a match between a file name regular expression and a
specific directory that that/those file(s) will be found/written in.  For
instance, if your MCPATH was defined as:

setenv MCPATH 

and you wanted to read/write AREA3000-AREA3999 files in 
you would define the needed file REDIRECTion as follows:

redirect.k ADD AREA3\* \"/data/scratch/msgglob09i

File REDIRECT definitions get saved in the file LWPATH.NAM which should be
located in your McIDAS working directory (which is recommended to be
~user/mcidas/data (e.g., /home/rtoper/mcidas/data) for users other than 'mcidas'
and /home/mcidas/workdata for the user 'mcidas'.

> I can see the remote MSG data sets fine;
> Image file directory listing for:MSG/MSGGLOB03I
> Pos Satellite/         Date       Time      Center      Res (km)   Image_Size
> sensor                                 Lat  Lon    Lat   Lon
> --- -------------  ------------  --------  ---- ----  ----- ----- ------------
> 1  METEOSAT8     26 FEB 07057  22:00:00     0    0
> Band: 3    1.6 um Near IR - Surface, cloud phase     3.02  3.00  3712 x 3712

Very good.  (For the records, access to the MSG dataset on 
one to LOGON specifying a user name and project ID that has been assigned by
those maintaining McIDAS on

> *** When I attempt to copy from MSG/MSGGLOB03I to LOCAL/MSG I get an error:
> imgcopy.k LOCAL/MSGTMP.1  LOCAL/MSG.1
> Beginning Image Data transfer, bytes= 616660
> Transferring AREA data outbound, bytes= 616740
> imgcopy.k: MCAOUT rc= -1
> imgcopy.k: done

A couple of things here:

- you are not trying to copy from the remote ADDE dataset that you referred to

- the LOCAL/MSG dataset is not defined in a way that McIDAS will know how to
  name the output file

> *** I am sure I am missing something but not sure what. I'd appreciate any 
> help!

You have run into one of the areas of McIDAS that requires more intimate 
of how things work.  Please let me know if my explanation about the output
namespace above was clear.

> *** Here is a data dump of everything I've set for this scenario:
> setenv MCHOME /usr/local/mcidas
> setenv MCDATA $MCHOME/mcidas2006/data
> setenv MCSRC $MCHOME/mcidas2006/src
> setenv MCGUI $MCHOME/bin
> unsetenv MCTABLE_READ
> unsetenv MCTABLE_WRITE
> running this as user 'rtoper'

I have several recommendations for how to define the various environmental

- you don't need MCSRC

- I strongly recommend you define MCDATA to be /home/rtoper/mcidas/data

- I recommend that your MCPATH be defined as:

  setenv MCPATH ${MCDATA}:$MCHOME/data:$MCHOME/help

- I recommend that you define MCTABLE_READ and MCTABLE_WRITE:


- since there should be no McIDAS executables in your $MCPATH directories,
  I see no reason to include MCPATH in your PATH definition

> file perms for /data/scratch/msgglob09i:
> drwxr-xr-x  2 rtoper fd 4096 Feb 27 17:58 msgglob09i
> dataloc.k ADD GER
> dataloc.k ADD GWR
> dataloc.k ADD MSG
> dataloc.k ADD PUB gp16.ssd.nesdis.noaa.gov
> dsserve.k ADD LOCAL/MSG AREA DIR='/data/scratch/msgglob09i*'  TYPE=IMAGE 
> “M8
> Latest MSG-1 band 9 10.8 um REALTIME

As noted above, the definition for LOCAL/MSG is incorrect for an output dataset.

Please let me know if the information above was helpful.


Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
Unidata HomePage                       http://www.unidata.ucar.edu

Ticket Details
Ticket ID: PKJ-573885
Department: Support McIDAS
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.