McIDAS User's Guide
Version 2015.2

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]


PTCOPY

Copies point data from one dataset to another.


Format

PTCOPY sdataset ddataset [keywords]


Parameters

sdataset

source ADDE dataset name and position; specify one of the following formats:

 

 

group/descriptor.position
alias
.position

 

a position greater than zero represents an absolute position in the dataset; a position less than or equal to zero represents a relative position in the dataset based on date and time, for example, 0 is the most recent and -1 is the next most recent; the position ALL represents all positions in the dataset (no default for group/descriptor or alias; position default=ALL if DAY is specified with the SELECT keyword, otherwise default=0)

ddataset

destination ADDE dataset name and absolute position; specify one of the following formats:

 

 

group/descriptor.position
alias.position

 

use only positive integers for position


Keywords

BYTecount=

YES

lists the number of bytes received from the server

 

NO

does not list the number of bytes (default)

DEL=

YES

deletes the destination file before copying; see the Remarks

 

NO

does not delete the destination file (default)

DROw=

beginning row number in the destination file to write data; this keyword may overwrite existing rows; see the Remarks (default=append after the last row with data)

NROws=

number of rows to allocate when creating an MD file; the valid range is 1 to 1000 (default=schema default)

SELect=

'clause1; clause2; . . ; clausen'
finds only the data matching the values in the select clauses; single quotes are mandatory; separate select clauses with semicolons; specify clause as a range or a list using one of the following formats:

 

 

range:
list:

parameter [unit] bval eval
parameter
[unit] val1,val2, . . ,valn

 

 

parameter

point file parameter

 

 

[unit]

units for the parameter values; units are optional but must be in square brackets if specified; see the Remarks (default=from sdataset)

 

 

bval eval

range of parameter values; see the Remarks

 

 

val1, . ., valn

list of parameter values

TITLE=

'text'

title of the destination point file; 32 characters maximum (default=current title if the file already exists; default=title of the source file if the file is new)


Remarks

PTCOPY copies records from the source point data file to the destination point data file. Use the SELECT keyword to define a subset of records to copy. If you don't specify SELECT, all records in the source file are copied.

If you use the range format for the SELECT keyword and bval is less than eval, all values between and including bval and eval are selected. For example, if you specify SELECT='LON -177 177', the longitude values -177, -176, . . , 176, 177 are selected. If bval is greater than eval, all values greater than bval or less than eval, including bval and eval, are selected. For example, if you specify SELECT='LON 177 -177', the longitude values 177, 178, 179, 180, -179, -178 and -177 are selected. This feature also allows you to select only wind directions from northwest to northeast with SELECT='DIR 315 45'.

If you specify the DROW keyword, the values of the row header parameters (for example, DAY, TIME and TYPE in ISFC schema MD files) are checked. If the values of the copied data's row header parameters are the same as the values in the destination row, the data is added to the row. Otherwise, the destination row's data is overwritten with the new data. If DROW is not specified, the data is copied to the rows following the last row containing data in the destination file.

If you specify DEL=YES or a position number of a nonexistent point data file in the ddataset parameter, the records are copied into a newly created MD file; change the title with the TITLE keyword.

When using the SELECT keyword, you can specify the following units:

Unit type UNIT= Definition
Distance CM centimeters
DM decameters
FT feet
GPM geopotential meters
IN inches
KM kilometers
M meters
MI miles
MM millimeters
NMI nautical miles
YD yards
Pressure HPA hectopascals
INHG inches of mercury
MB millibars
Speed KT or KTS knots
MPH miles per hour
MPS meters per second
Temperature C Celsius
F Fahrenheit
K Kelvin

When using point/MD files with CYD (ccyyddd) date units (e.g., FO14, IRAB, ISEN, ISFC, ISHP, PIRP and SYN schema MD files created with McIDAS-XCD 7.5 and later), commands PTCON, PTCOPY, PTDISP and PTLIST default to the current year if you don't specify a four-digit year and the nearest century if you specify only the last two digits of the year. For example, if the file uses CYD units for the DAY parameter and its value is 2004260, then you can specify the DAY in the SELECT keyword as 2004260 or 04260. If the current year is 2004, you can also specify it as 260. Use the PTLIST command with FORM=PARAM to list the file's parameters and units.

The PTCON, PTCOPY, PTDISP and PTLIST commands continue to work with point/MD files using the old SYD (ssyyddd) date units (e.g., FO14, IRAB, ISEN, ISFC, ISHP, PIRP and SYN schema MD files created with versions of McIDAS-XCD prior to 7.5), with the following exception: If you want to specify DAY in the SELECT keyword and the ss portion of the MD file's DAY value is nonzero, then you must specify the units with DAY in the SELECT keyword. For example, if the MD file uses SYD units for DAY and its value is 7197240, then it must appear as SELECT='DAY[SYD] 7197240'. If the MD file uses SYD units for DAY but has a zero (blank) ss value, you don't have to specify the units in the SELECT keyword. For example, if the MD file uses SYD units for DAY and its value is 97240 then it can appear as either SELECT='DAY 97240' or SELECT='DAY[SYD] 97240'.


Examples

PTCOPY RAOB/MANDATORY LOCAL/PT.1 DEL=YES

This entry copies the entire contents of the most recent point file in dataset RAOB/MANDATORY to position 1 of dataset LOCAL/PT. The DEL=YES keyword deletes the existing destination point file and creates a new one with the same title as the source file. Because point files may be very large, copying an entire point file may take a long time. Use the SELECT keyword to copy only the data you need, as shown in the following examples.

PTCOPY SURFACE/ISFC.5 LOCAL/PT.2 SELECT='CO US,CN ; TIME 0 2 ; TYPE 0' DEL=YES TITLE='15 May 96 US and Canada Sfc Data'

This entry copies the 00 through 02 UTC surface hourly (type 0) data for all stations in the United States and Canada in position 5 of dataset SURFACE/ISFC to position 2 of dataset LOCAL/PT. The DEL=YES and TITLE keywords delete the existing destination point file and create a new one with the title 15 May 96 US and Canada Sfc Data. Because each hour's data in ISFC schema point files is assigned to a separate row, the 00 UTC data is copied to row 1, the 01 UTC data is copied to row 2, and the 02 UTC data is copied to row 3 in the new destination file.

PTCOPY SURFACE/ISFC.5 LOCAL/PT.2 SELECT='CO US,CN ; TIME 6,12 ; TYPE 0' DROW=2

If this entry follows the previous example, it replaces the destination point file's 01 UTC data in row 2 with 06 UTC data, and replaces the 02 UTC data in row 3 with 12 UTC data.

PTCOPY SURFACE/ISFC.5 LOCAL/PT.2 SELECT='CO US,CN ; TIME 18 ; TYPE 0' TITLE='15 May 96 0,6,12,18 UTC Sfc Data'

If this entry follows the previous two examples, it copies the 18 UTC data to row 4 of the destination point file (position 2 of dataset LOCAL/PT) and changes its title to 15 May 96 0,6,12,18 UTC Sfc Data. The data is placed in row 4 because without DROW being specified, the data is copied to the row after the last row containing data. The destination point file now has the 00, 06, 12 and 18 UTC data in rows 1, 2, 3 and 4.


[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]