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

[McIDAS #YSW-232469]: Plotting vectors based on SPD and DIR



Hi Kwan,

re:
> Hope that you had a nice Thanksgiving.

Its been great, thanks!

> Yesterday, I began to look for a way to plot vectors in
> McIDAS given DIR and SPD at random points with lat-lon
> pairs.  I already have these data saved in a text file in
> the following form.
> 
> DAY     TIME      LAT     LON     SPD    DIR
> 2006199 11:00:00   52.12   17.04    4.18    11
> 2006199 11:00:00   52.58   15.68   18.69   225
> 2006199 11:00:00   52.54   14.27   24.58   225
> 2006199 11:00:00   52.22    5.26    0.00   225
> 2006199 11:00:00   52.17    5.80    7.13   225
> 
> The first thing I did was to use TXT2MD to convert the
> text file to an MD file, i.e.
> 
> txt2md.k vectors.txt 900 ISFC
> 
> It shows that I've used schema ISFC.

I would recommend creating a custom schema that better represents the
data you have.  The ISFC schema is too complicated for storing just
wind information.

> But after I defined
> 
> dsserve.k ADD CLOUD/VECTORS MD 900 900
> 
> and tried plotting vectors using
> 
> SFCPLOT WINDV OLAY 11 2006/07/18 LSIZE=6 COL=3 DAT=CLOUD/VECTORS
> 
> it says,
> 
> Accessing Dataset Name = CLOUD/VECTORS.ALL
> PTDISP: No data found matching search conditions
> SFCPLOT - Done

I recreated your steps and go the same result.

> At first, I thought the problem was the text format, but
> now I think it may be schema-related. But I'm not sure.

You are correct.

> So I am sending you vectors.txt.  Hope that you can show
> me how to plot these data as vectors in McIDAS.  Note that
> the vectors are located in the Spain and France area.

Here is what I recommend:

- create a schema that better represents your data.  I have attached
  a text version of what I recommend, WIND.TXT

- copy/create the ASCII schema in your $MCDATA directory (e.g., ~mcidas/workdata
  if running as 'mcidas'; ~/mcidas/data if running as some other user)

- register the new schema:

cd $MCDATA
sche.k WIND.TXT

  WIND.TXT     will be treated as a text file
" WIND (JSP) 06330 SCHEMA -- GENERAL SURFACE SCHEMA
"        NAME VSN DATE  ID "TEXTID
"        ---- --- ----- -- -------
  SCHEMA WIND  1 2006330 0 "Wind FIELDS
*--SCHEMA * WIND *, VERSION * 1 * ADDED TO SCHEMA FILE *  KEYS=6
 --END OF SCHEMA REGISTRATION PROGRAM
 
lsche.k WIND

NAME: WIND  VERSION:  1  DATE: 2006330  TEXTID: "Wind FIELDS
----        -------
   DEFAULT NUMBER OF ROWS:   24                        INTEGER ID: 0
                     COLS:   1000                   MISSING DATA VALUE:  
-2139062144
   REPEAT GROUP:  NUMBER OF REPETITIONS:   1
                      STARTING POSITION:   3
                                   SIZE:   4
   NUMBER OF KEYS IN ROW HEADER:     2
                     COL HEADER:     0   STARTING AT POSITION   3
                    DATA RECORD:     4   STARTING AT POSITION   3
                                  ----
                                     6 TOTAL

        KEY  SCALE UNIT     KEY  SCALE UNIT     KEY  SCALE UNIT
        ---- ----- ----     ---- ----- ----     ---- ----- ----
        DAY    0   CYD      TIME   0   HMS      LAT    4   DEG
        LON    4   DEG      DIR    0   DEG      SPD    1   MPS
LSCHE: DONE

- delete the output file:

lwu.k DEL MDXX0900

- (re)define the ADDE dataset:

dsserve.k ADD CLOUDS/VECTOR MD 900 900 "European Wind Data

- list out the data to make sure you can access it:

ptlist.k CLOUDS/VECTOR.1 PAR=DAY TIME LAT LON DIR SPD NUM=10

 DAY[CYD] TIME[HMS]  LAT[DEG]  LON[DEG]  DIR[DEG]  SPD[MPS]
--------- --------- --------- --------- --------- ---------
  2006199    110000   52.1200   17.0400        11       4.2
  2006199    110000   52.5800   15.6800       225      18.7
  2006199    110000   52.5400   14.2700       225      24.6
  2006199    110000   52.2200    5.2600       225       0.0
  2006199    110000   52.1700    5.8000       225       7.1
  2006199    110000   51.9400    6.1600       225      17.8
  2006199    110000   52.1200   16.4500        10       4.2
  2006199    110000   51.9300   12.9700         1      22.0
  2006199    110000   51.8800   13.4600        12      25.9
  2006199    110000   52.0100   16.4500        10       4.2
Number of matches found = 10
PTLIST: Done

- assuming that the previous step worked, plot the data:

mcenv -f 1@600x800
ptdisp.k CLOUDS/VECTOR.1 PAR=WINDB MAP=EUROPE
frmsave.k 1 winds.gif
exit

> Thanks for your help again.

No worries.  Please let me know the results of your test.

Cheers,

Tom
****************************************************************************
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: YSW-232469
Department: Support McIDAS
Priority: Normal
Status: Closed