# Plot Domains

For the plotting programs, the output is defined by a specific domain
which either can be geographical or Cartesian. The
**plot_domain** resource specifies this plotting
coordinates.

In most cases, data are plotted based on a latitude longitude location.
Since this is a spherical coordinate system and the plot will be of two
dimensions, a transformation must occur. In the case of geographic plots,
this is called a **projection**.

To locate the plot, a simple set of parameters must be specified.

- the projection must be specified. By default, this is
**polar stereographic**. - the central point must be determined which for map projections is by
latitude,
**clat**, and longitude,**clon**. - the domain size must be specified. This is simply done by specifying a
size parameter
**dx**. For regional plots, this size is 1. For the entire contiguous United States, the size is around 2.5. For hemispheric plots, use 8.

The default aspect ratio for the plot is 3 to 2. Once the domain has been determined, all data are then remapped to this domain before plotting.

Often there is more to the domain that needs to be specified. There are projection coordinates such as the projection latitude and longitude, the true latitudes and mapping factor corrections. These can all be specified with the full plot domain specification:

*proj*[**:***params*]**,***clat***,***clon***,**[*nx***,***ny***,**]*dx ,dy*

where:

*proj*- The projection.MAP PROJECTIONS

**ll**or**lat**- latitude-longitude**ps**or**polar**- polar stereographic**me**or**merc**- mercator**lc**or**lamb**- lambert conformal**la**or**az**- lambert azimuthal

**gn**- gnomic**mo**- mollweide**or**- orthographic**sat**- satellite

NON-MAP PROJECTIONS

**xy**- X Y plot (cartesian) where lat=x, lon=y

**xlogp**- X log P plot where lat=x, lon=p

**cat**- category plot where lat=cat, lon=y**vert**- vertical cross section (same as xlogp)

**polar**- polar plot where lat=dist, lon=angle**hodo**- hodograph plot (same as polar)

**skewt**- skewT thermodynamic plot**stuve**- stuve thermodynamic plot**ema**- emagram thermodynamic plot**teph**- tephigram thermodynamic plot**rteph**- rotated tephigram thermodynamic plot

**therm**- thermodynamic plot (same as skewt)

*param*- A colon ":" delimited list of projection specific parameters. The parameters are:

[**e:**]*plat***:***plon***:***p1***:***p2***:***p3***:***p4*Any number of these can be specified.

**e**specifies elliptical earth computation (otherwise spherical)

*plat*and*plon*define the projection latitude and longitude.

polar stereographic:*p1*is the true latitude,

lambert conformal:*p1*and*p2*are the true latitudes,

satellite:*p1*is the satellite radius in 100s km and*p2*is the angle toggle for satellite projection. If the satellite radius is not specified, this is assumed to be 421.64 (geosynchronous orbit). The angle toggle (if*1*) specifes that distances are actually radian degrees*earth radius rather than distance on projection plane.

*clat,clon*- This is the central point in the domain. For map projections, this is latitude and longitude. For other projections, it's X and Y (or P). The*clat,clon*can be replaced with "**id:***station*" where the latitude and longitude are read in from a city database file (**sao.cty**by default) or just "*XXXX*" where this is the 4 letter station id in upper case. If you want to use a different database file, you need to specify it as "**id:***database_file***:***station*".*nx,ny*- Specifies the number of grid points or pixels in each direction. For non-grid plots, this acts as the aspect ratio of the domain as nx-1 to ny-1. The default is 25,17 which gives a region with an aspect ratio of 3 to 2. This can be useful in the case where overlays might need to be drawn where the underlying data or image does not adhere to the true projection coordinate system. This is especially true of satellite images where the height of a scan line is not equal to the width of each picture element and therefore dx cannot be equal to dy to give a proper projection. Also, the number of gridpoints is used to scale wind vector length. The longest wind vector is scaled to one grid distance. (OPTIONAL, DEFAULT: 25,17)*dx,dy*- Specifies the grid spacing in the X and Y direction. The distance is roughly in 100s of kilometers (latlon projection is latitude and longitude). The larger the value, the larger the domain. The full domain size is (nx-1)*dx by (ny-1)*dy. In some cases, this can be used to correct for unequal distances. This is especially true of satellite images where the width of one element on a scan line is not equal to the height on the scan line.

### Specifying the Domain

There are several ways to specify the domain. Not all of the above parameters need to be specified in order for the program to know what to plot

Parameters to specify |
Assumed values for others |
---|---|

proj,clat,clon,nx,ny,dx,dy |
None |

proj,clat,clon,nx,ny,dx |
dy=dx |

proj,clat,clon,dx,dy |
nx=25,ny=17 |

proj,clat,clon,dx |
nx=25 ny=17 dy=dx |

clat,clon,nx,ny |
proj=ps dx=1.2 dy=1.2 |

clat,clon,dx |
proj=ps nx=25 ny=17 dy=dx |

size,nx,ny |
used for images |

proj,clat,clon |
nx=25 ny=17 dx=1.2 dy=1.2 |

clat,clon |
proj=ps nx=25 ny=17 dx=1.2 dy=1.2 |

fi:region |
look up domain in file. Domain specification in first line of file |

file:region |
look up domain in file file |

region |
look up domain in wxp.reg file |

**NOTE:** *clat,clon* can be replaced by **id:***xxxx* or
*XXXX* which will look up location in **sao.cty** file using station
identifier *xxxx*. Use **id:***file***:***xxxx* to
look up location in *file* file.

The *proj *specification can always contain the [**:***params*] specification.

### Selecting a Domain for a Map Projection

In selecting a plot domain, first determine the center latitude and longitude of the domain. Next, determine the rough size of the domain to capture all the data of interest. Since domain is established as a grid, the size is dependent on number of gridpoints and grid spacing. The horizontal size is (nx-1)*dx in 100s of kilometers. Since the default grid is 25x17, the dx can be estimated by dividing size in kms by 2400. This makes a value of 1 for dx,dy adequate for regional plots and a value of just larger than 2 adequate for the continental US.

**NOTE: **This is a rough computation because different projections
will yield slightly different domain sizes. Finally, adjust the aspect ratio
of the plot by changing the nx,ny parameters. These may not need to be
changed unless the domain is square or oblong.

Here are some examples:

Plot Domain | Description |
---|---|

39,-97,2.3 |
United States |

KORD,.5 |
Small region centered over Chicago |

ll,0,0,37,19,10 |
The whole globe on a lat-lon projection |

ps,90,-90,8 |
Northern hemisphere |

ps,38.5,-97,2800,2000,0.02,0.02 |
Polar stereographic grid over US used for radar mosaics |

sat:e:0:-75::1:,0.7,-74.9,1024,1024,0.1266,0.147 |
Satellite image projection. The satellite is centered over 75W and the image is centered at 0.7N, 74.9W. It uses an ellipsoidal earth computation. Since no distance is specified, this is geostationary orbit. The angle toggle is on so distances are in radians*earth radius. The nx,ny specify the image size which is 1024x1024. The dx,dy specify the distance between pixels in projection coordinates which is roughly 12.6 by 14.7 km. In most satellite image cases, these values will not be equal. |

### Selecting a Domain for a non-Map Projection

This is done very similar to the map projections. First a center point is
determined. Use X for clat and Y for clon. The grid and grid size is the
same. If the projection is **xlogp**. The Y distance is actually in log P.

Plot Domain | Description |
---|---|

xy,0,5,20,10 |
XY plot ranging from -10 to 10 in X and 0 to 10 in Y |

pixel,512,512,1024,1024,1,1 |
Satellite image with 1024x1024 resolution. |

### Selecting a Domain for Thermodynamic Projection

The difference with thermodynamic projections is that the vertical coordinate is either log P, log theta (tephigram) or some function of P (as in stuve). The central point is in temperature (C) and pressure (mb/hPa).

Plot Domain | Description |
---|---|

skewt,-40,325,12,11,9,.235 |
Standard skewt projection |

stuve,-20,394,12,11,11,.36 |
Standard stuve projection |

ema,-20,325,12,11,11,.235 |
Standard emagram projection |

teph,-36,332,12,11,9.09,.033 |
Standard tephigram projection |

rteph,-25,400,12,11,13.6,.049 |
Standard rotated tephigram projection |

### Selecting a Domain from a File

There are two ways to select a domain from a file.

**Single Domain**-- in this case the file only contains the plot domain specification such as:sat:0:-75,34.95,-82.95,640,427,0.108,0.095

where the plot domain would be

**-pd=fi:domfile****Region File**-- in this case the region string is looked up in the domain file. For example, the plot domain would be "**-pd=sat.reg:goes_east**" and the region**goes_east**would be looked up in the**sat.reg**file. See the section below on**regions**.

### Region File

Specifying a full plot domain can be difficult. Therefore, a region file
can be created to alias plot domain specifications. This default region file
is **wxp.reg**. New regions can be added to this file. Here is an
example line from the file:

us Contiguous_US 1 39,-97,2.3 ne New_England 1 42,-76,.9 at Atlantic 1 37,-82,.9 se Southeastern 1 31,-88,1.1 mw Midwestern 1 43,-93,1.1 cp Central_Plains 1 37,-95,1.1 sp Southern_Plains 1 32,-100,1.1 nw Northwestern 1 44,-114,1 sw Southwestern 1 37,-114,1 -- ------------ 1 --------- wcan Western_Canada 1 55,-110,1.4 ecan Eastern_Canada 1 53,-72,1.4 nhem North_Hemisphere 0 90,-90,25,25,8 shem South_Hemisphere 0 -90,-90,25,25,8 us02 US_2km 0 ps,38.5,-97,2800,2000,0.02,0.02

The alias is listed first, followed by a long name (all spaces must be underscores), followed by a menu toggle (not used) and finally the plot domain specification.

**NOTE:** Menu toggle is ignored in WXP 6.

This alias can now be specified as:

sfcplot -pd=us

Updated January 2021