Joe, The NC driver creates a standard cgm meta file, with a header (as described in $GEMPAK/include/cgmcmn.h). This header includes an 80 byte file header and space for 500 frame headers of 72 bytes (36000 bytes total). The header is what allows Ntrans to find an lable the various groups and plot parameters. Otherwise, the nc driver is the same as the vc driver which created cgm meta files. So, the standard CGM part of the file will begin after 36080 bytes. By default, the CGM plot domain will be 32767x32767 (square) and should be recognizeable by standard CGM packages. GEMPAK does allow the user to create non-square domains...but you should not do that for maintaining conformity to the CGM standard. Note that not all CGM commands may be recognized by certain plotting packages...for example, such packages may not support filled areas. You will also have to byte flip the 2byte (unsigned short) values if the file is created on a little endian machine (ntrans will recognize the byte order and flip as necessary....but your CGM package probably wont). I have attatched a gzipped tar file called nmetatocgm.tar.gz that will unpack to a nmetatocgm directory. In the directory is a standard GEMPAK Makefile (if you have the GEMPAK libraries installed to link against). Otherwise, I can build you a binary. To build (after sourcing your Gemenviron, type "make all" and "make install". The program will link against gemlib.a and cgemlib.a. The nmetatocgm is run as "nmetatocgm Nmeta", where the Nmeta is any file created by the nc driver. The program will strip off the 36080 byte header, and create a separate file called "frame_xxx.cgm" for each individual fram within the Nmeta file- and byte flip the values to big endian if necessary (eg Linux, etc). I converted the sample Nmeta file inclosed in the tar file and was able to import the CGM into coreldraw and manipulate the individual segments. Let me know if you need a binary instead of source. Steve Chiswell **************************************************************************** Steve, Thanks for your help. Concerning the vc driver (vanilla cgm) are there any programs now that have taken its place; are there any converter programs? Are there any programs that would convert a postscript file into a cgm file? The reason I'm wondering is that I need to have a cgm file that I can import into either Canvas or Adobe. I tried using NMAP2 and NTRANS, but couldn't find anything within those programs to convert the file into a rcognizable cgm file. Thanks for your help! Joe Grim At 04:33 PM 12/17/2002 -0700, you wrote: >Joe, > >The nc driver produces a file header used by Ntrans for identifying the >frames and groups, and allows for rectangular (as opposed to square only >for standard cgm) plots. You could probably take off the Ntrans header and >use just the CGM drawing commands as long as you specified a square output. > >The vc driver (vanilla cgm) was moved to the inactive directory back in 1997 >(along with the hp hpgl plotter driver and vt term) due to limitations of the >standards and obsolete equipment. > >The vg driver was created to provide a georeferenced vector output which >can be used within NMAP2 for drawing, editing, etc. > >Steve Chiswell >**************************************************************************** < >Unidata User Support UCAR Unidata Program < >(303)497-8643 P.O. Box 3000 < >address@hidden Boulder, CO 80307 < >---------------------------------------------------------------------------- < >Unidata WWW Service http://www.unidata.ucar.edu/ < >**************************************************************************** >< > >From: "Joe Grim" <address@hidden> > >Organization: UCAR/Unidata > >Keywords: 200212172101.gBHL1HW23677 > > >Institution: University of Illinois - Department of Atmospheric Sciences > >Description: Hi, > >I was wondering if it is possible to create .cgm files in gempak which > are of > > a format useable in Canvas. I have tried using the nc file format, but > am un > > able to get it into a format that is recognized by Canvas (I have been > able t > > o view them using NTRANS, but that doesn't do me any good, except to > know it' > > s there.) The reason I need the cgm format is so that I can be able to > impor > > t the vector images into Canvas for manipulation, which is a lot easier > than > > tracing over a .ps or .gif file! > >If you can help me in this way, that would be great! > >Thanks! > >Joe Grim > > > > > > > **************************************************************************** Unidata User Support UCAR Unidata Program 303 497 8643 P.O. Box 3000 address@hidden Boulder, CO 80307 ---------------------------------------------------------------------------- Unidata WWW Service http://www.unidata.ucar.edu/ ****************************************************************************
Attachment:
nmetatocgm.tar.gz
Description: nmetatocgm