comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » ps_star.pro no found on IDL71?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
ps_star.pro no found on IDL71? [message #79044] Fri, 20 January 2012 14:17
dlopezaspe is currently offline  dlopezaspe
Messages: 10
Registered: October 2008
Junior Member
Hello Everyone.
I have run script to generate many postscript file is to create a gis
animator, My solution is simple my script run with script Dr. David
Fanning P_star.pro psconfig.pro I try version 7 and runs IDL nw my
version is 7.1 and not found I don't why?......


PRO david_NDVIT_plot_rainbow
COMPILE_OPT STRICTARR
;
************************************************************ *********
; DESCRIPTION: Program to plot Landsat imagery
;
************************************************************ *********
; AUTHOR: Stef Lhermitte
;
************************************************************ *********
; DATE: 2009/10/20
;
************************************************************ *********
; FORMATS
;
************************************************************ *********
F80='(80("-"))' & F120S='(120("*"))'
;
************************************************************ *********
; PARAMETERS
;
************************************************************ *********
ifolder = '/home/david/tesis/paper/mod13a3/'
ofolder = '/home/david/tesis/paper/mod13a3/ndvi_avg/ani/'
vector= 'home/david/tesis/paper/mod13a3/ndvi_avg/
provincias_wgs84_.evf'
filepattern='MOD13A3.B0.stack.masked_resam_p.hdr'
l7_band = [0]
;
************************************************************ *********
PRINT, FORMAT=F120S
if (FILE_TEST(ifolder, /DIRECTORY) ne 1) then begin
PRINT, 'Input folder does not exist: ', ifolder
PRINT, FORMAT=F120S
return
endif
if (FILE_TEST(ofolder, /DIRECTORY) ne 1) then begin
PRINT, 'Output folder does not exist: ', ofolder
PRINT, FORMAT=F120S
return
endif
;
************************************************************ *********
; Populate file list
;
************************************************************ *********
files = FILE_SEARCH(ifolder+'*'+filepattern, COUNT=n_dates, /
FOLD_CASE)
if n_dates lt 1 THEN BEGIN
PRINT, 'No files encountered for : '
PRINT, ifolder+filepattern
RETURN
endif
;
************************************************************ *********
; Process
;
************************************************************ *********
; Extract files name
name = FILE_BASENAME(files[0],filepattern,/FOLD_CASE)
name = STRSPLIT(name,'.',/EXTRACT)

print, files[0]

ENVI_OPEN_FILE, files[0], r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, ns=ns, nl=nl, nb=n_dates, bname=bname
map_info = ENVI_GET_MAP_INFO(fid=fid)

for date_i=0l, n_dates-1 do begin


bname_i= Strmid(bname[date_i],48,7)
print, bname_i

image = ENVI_GET_DATA(fid=fid, pos=date_i, dims=dims)


utmlimit=[map_info.mc[2],map_info.mc[2]+map_info.ps[0]*ns,ma p_info.mc[3],map_info.mc[3]-
map_info.ps[1]*nl]

; Modificar esta linea
imdisp_map, image, ofolder=ofolder, utmlimit=utmlimit,
name=name[0]+STRTRIM(string(date_i),2)+'.NDVI',$
title='NDVI MODIS Time Series', subtitle=bname_i,
bartitle='2000-2010', ct=40, range=[1,80], /CLEANUP, /PLOTCOLORBAR, $
vector=vector, vectcolor='Red', latdel=0.5

PRINT, FORMAT=F120S


endfor

END

>>>> >>>>>>>>
PRO imdisp_map, image, ofolder=ofolder, name=name, utmlimit=utmlimit,
$
xsize=xsize, ysize=ysize, title=title, subtitle=subtitle,
bartitle=bartitle, $
charsize=charsize, latdel=latdel, londel=londel, $
ct=ct, range=range, gridcolor=gridcolor, vector=vector, $
plotcolorbar=plotcolorbar, vectcolor=vectcolor,
horizontal=horizontal, cleanup=cleanup
COMPILE_OPT STRICTARR
;
************************************************************ *********
; DESCRIPTION: Program to plot image in UTM with title
;
************************************************************ *********
; AUTHOR: Stef Lhermitte
;
************************************************************ *********
; DATE: 2009/10/20
;
************************************************************ *********
; FORMATS
;
************************************************************ *********
F80='(80("-"))' & F120S='(120("*"))'
;
************************************************************ *********
; PARAMETERS
;
************************************************************ *********
IF ~KEYWORD_SET(ofolder) then ofolder = FILE_DIRNAME(filename,/
MARK_DIRECTORY)
IF ~KEYWORD_SET(xsize) then xsize=10
IF ~KEYWORD_SET(ysize) then ysize=10
IF ~KEYWORD_SET(title) then title=''
IF ~KEYWORD_SET(subtitle) then subtitle=''
IF ~KEYWORD_SET(bartitle) then bartitle=''
IF ~KEYWORD_SET(charsize) then charsize=1
IF ~KEYWORD_SET(latdel) then latdel=.05
IF ~KEYWORD_SET(londel) then londel=latdel
IF ~KEYWORD_SET(ct) then ct=0
IF ~KEYWORD_SET(gridcolor) then gridcolor='Black'
IF ~KEYWORD_SET(cleanup) then cleanup=0
IF ~KEYWORD_SET(plotcolorbar) then plotcolorbar=0
IF ~KEYWORD_SET(horizontal) then horizontal=0
IF ~KEYWORD_SET(vector) then vector='xxxxx'
IF ~KEYWORD_SET(attr_name) then attr_name='id'
IF ~KEYWORD_SET(vectcolor) then vectcolor='White'
IF (~KEYWORD_SET(utmlimit)) then begin
print, "UTM limit not set"
RETURN
endif
;
************************************************************ *********
; PRE-TEST
;
************************************************************ *********
IF FILE_TEST(ofolder, /DIRECTORY) ne 1 then begin
PRINT, 'Ofolder does not exist: ', ofolder
return
endif
IF ~KEYWORD_SET(name) then name=FILE_BASENAME(filename,ext, /
FOLD_CASE)
;
************************************************************ *********
; START PLOTTING
;
************************************************************ *********
ps_start, filename=ofolder+name+'.ps', XSize=xsize,YSize=ysize

; Find the image dimensions.
s = Size(image)
if (s[0] gt 2) then begin
s = s[2:3]
onelayer=0
endif else begin
onelayer=1
s = s[1:2]
endelse
print, "Image dimension : "+STRING(s)

; Read min-max for range
IF (~KEYWORD_SET(range) and onelayer eq 1) then begin
minRange = MIN(image, MAX=maxRange)
range=[minRange,maxRange]
print, "Image range : "+STRING(range)
endif


; Origin in upper-left in TIFF file. I want to move to bottom left
; for my own sanity.
xOrigin = utmlimit[0]
yOrigin = utmlimit[2]
xEnd = utmlimit[1]
yEnd = utmlimit[3]
xCenter = (xEnd - xOrigin) / 2.0 + xOrigin
yCenter = (yEnd - yOrigin) / 2.0 + yOrigin

; Map the corners in lat/lon space.
utmMap = MAP_PROJ_INIT('UTM', DATUM=8, ZONE=-19)
lonlat = MAP_PROJ_INVERSE([xOrigin, xOrigin, xEnd, xEnd, xCenter],
$
[yOrigin, yEnd, yEnd, yOrigin, yCenter],
$
MAP_STRUCTURE=utmMap)

Print, 'Latitude: ', Reform(lonlat[1,0:3])
Print, 'Longitude: ', Reform(lonlat[0,0:3])
Print, 'Center: ', lonlat[0,4] , lonlat[1,4]

; The limit is the min and max of these latitudes and longitudes.
minLat = Min(lonlat[1,*], MAX=maxLat)
minLon = Min(lonlat[0,*], MAX=maxLon)
limit = [minLat, minLon, maxLat, maxLon]

; Set up a map projection space, using a limit.
utmMap = MAP_PROJ_INIT('UTM', DATUM=8, ZONE=-19, LIMIT=limit)

uv_box = [xOrigin, yOrigin, xEnd, yEnd]
Print, 'MAP_PROJ_INIT UV_BOX: ', uv_box

loadct, ct
; Display the image.
imdisp, image, range=range, out_pos=pos, /erase, /ORDER

; Pot colorbar
if plotcolorbar then begin
if horizontal eq 1 then colorbar,format='(f6.2)',range=range,
charsize=charsize, /top $
else colorbar,format='(f6.1)',range=range, charsize=charsize, /
vertical
endif


; Use the UV_BOX of Map_Proj_Image to set up the data coordinate
space.
warp = Map_Proj_Image(dist(10), $
[xOrigin, yOrigin, xEnd, yEnd], $ ; image range in UV coords
IMAGE_STRUCTURE=utmMap, $
MAP_STRUCTURE=utmMap, $
UVRANGE=uv_box)
plot, uv_box[[0, 2]], uv_box[[1, 3]], Position=pos, $
/Nodata, XStyle=5, YStyle=5, /NoErase

; Add gridlines
MAP_GRID, BOX_AXES=0.1, Color=FSC_Color(gridcolor),
Map_Structure=utmMap, latdel=latdel, londel=londel, charsize=charsize

; Add title
x = (!X.Window[1] - !X.Window[0]) / 2. + !X.Window[0]
y = 0.95
XYOuts, x, y, title, /normal, alignment=0.5, charsize=charsize*1.5,
Color=FSC_Color('Black')
y = 0.93
XYOuts, x, y, subtitle, /normal, alignment=0.5, charsize=charsize*.9,
Color=FSC_Color('Black')
x = (1 - pos[2]) / 2. + pos[2]
y = 0.95
XYOuts, x, y, bartitle, /normal, alignment=0.5, charsize=charsize*1.5,
Color=FSC_Color('Black')
print, pos

IF FILE_TEST(vector) eq 1 then begin
PRINT, 'Drawing vector: ',vector
drawcounties, vector, ATTRIBUTE_NAME=attr_name, thick=charsize*5,
color=vectcolor
ENDIF

>>>> >>>>>>>>>>>>>>>>>>>>>>>

; docformat = 'rst'
;
; NAME:
; PSCONFIG
;
; PURPOSE:
; The purpose of this program is to allow the user to configure the
PostScript device
; with a graphical interface.
;*********************************************************** *******************************;
; ;
; Copyright (c) 2000-2012, by Fanning Software Consulting, Inc. All
rights reserved. ;
; ;
; Redistribution and use in source and binary forms, with or
without ;
; modification, are permitted provided that the following conditions
are met: ;
; ;
; * Redistributions of source code must retain the above
copyright ;
; notice, this list of conditions and the following
disclaimer. ;
; * Redistributions in binary form must reproduce the above
copyright ;
; notice, this list of conditions and the following disclaimer
in the ;
; documentation and/or other materials provided with the
distribution. ;
; * Neither the name of Fanning Software Consulting, Inc. nor the
names of its ;
; contributors may be used to endorse or promote products
derived from this ;
; software without specific prior written
permission. ;
; ;
; THIS SOFTWARE IS PROVIDED BY FANNING SOFTWARE CONSULTING, INC. ''AS
IS'' AND ANY ;
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES ;
; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT ;
; SHALL FANNING SOFTWARE CONSULTING, INC. BE LIABLE FOR ANY DIRECT,
INDIRECT, ;
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED ;
; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; ;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ;
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT ;
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS ;
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. ;
;*********************************************************** *******************************;
;
;+
; The purpose of this program is to allow the user to configure the
PostScript device
; with or without a graphical user interface. This function is
essentially a simplified
; wrapper to the FSC_PSConfig object, which provides a powerful
graphical user interface
; for configuring the IDL PostScript device.
;
; :Categories:
; Utilities, Graphics
;
; :Returns:
; A structure of keywords, appropriate for configuring the
PostScript device, is returned.
; These keywords are generally passed to the PostScript device by
means of keyword inheritance::
;
; keywords = PSConfig() ; Obtain PostScript keywords
; Set_Plot, 'PS' ; Select the PostScript device
; Device, _Extra=keywords ; Configure the PostScript device
with keywords
;
; :Params:
; psobject: in, optional, type=object
; An FSC_PSCONFIG object reference of the sort returned by this
function
; can be passed as an argument to the function. It is up to the
user to destroy
; the object if passed as an argument. Passing an object
argument essentially
; by-passes the rest of the keywords and the GUI will take its
initial values
; from the values in the input object. This allows the
programmer to keep track
; of how the user last configured the GUI and to set it up in
exactly the same
; way the next time the GUI is invoked.
;
; :Keywords:
; AvantGarde: in, optional, type=boolean, default=0
; Set this keyword to select the AvantGarde PostScript font.
; Bits_per_Pixel: in, optional, type=integer, default=8
; The number of image bits saved for each image pixel: 2, 4, or
8.
; Bold: in, optional, type=boolean, default=0
; Set this keyword to select a bold PostScript font.
; BookStyle: in, optional, type=boolean, default=0
; Set this keyword to specify that the book version of the
current PostScript
; font should be used.
; Bkman: in, optional, type=boolean, default=0
; Set this keyword to select the Bookman PostScript font.
; Cancel: out, optional, type=boolean, default=0
; If this keyword is set to 1, the user hit the Cancel button
in the GUI.
; CMYK: in, optional, type=boolean, default=0
; Set this keyword to use CMYK colors instead of RGB colors in
the output.
; Color: in, optional, type=boolean, default=1
; Set this keyword to 1 to select color or gray-scale output.
; Courier: in, optional, type=boolean, default=0
; Set this keyword to select the Courier font.
; Debug: in, optional, type=boolean, default=0
; Set this keyword to get traceback information when errors are
encountered.
; Decomposed: in, optional, type=boolean, default=0
; Set this keyword to turn on 24-bit color support. Set to zero
to select indexed color
; support. Applies only to IDL versions 7.1 and higher.
; DefaultSetup: in, optional, type=structure
; Set this keyword to the "name" of a default style. Current
styles (you can easily
; create and add your own to the source code) are the
following::
; "System (Portrait)" - The normal "default" system set-up.
Also, "System".
; "System (Landcape)" - The normal "default" landscape
system set-up.
; "Centered (Portrait)" - The window centered on the page.
Also, "Center" or "Centered".
; "Centered (Landscape)" - The window centered on the
landscape page. Also, "Landscape".
; "Square (Portrait)" - A square plot, centered on the page.
; "Square (Landscape)" - A square plot, centered on the
landscape page.
; "Figure (Small)" - A small encapsulated figure size,
centered on page. Also, "Encapsulated" or "Encapsulate".
; "Figure (Large)" - A larger encapsulated figure size,
centered on page. Also, "Figure".
; "Color (Portrait)" - A "centered" plot, with color turned
on. Also, "Color".
; "Color (Landscape)" - A "centered" landscape plot, with
color turned on.
; Demi: in, optional, type=boolean, default=0
; Set this keyword to select the Demi font style.
; Directory: in, optional, type=string
; Set this keyword to the name of the starting directory. The
current directory is used by default.
; Encapsulated: in, optional, type=boolean, default=0
; Set this keyword to 1 to select Encapsulated PostScript
output.
; European: in, optional
; This keyword is depreciated in favor or `Metric`.
; Filename: in, optional, type=string, default='idl.ps'
; Set this keyword to the name of the PostScript file you wish
to create.
; FontInfo: in, optional, type=boolean, default=0
; Set this keyword if you wish to see font information in the
GUI interface. Since font
; information has to be interpreted to be used, most users
prefer not to see this information
; on the GUI.
; FontSize: in, optional, type=integer, default=12
; Set this keyword to the desired font size. Values should be
between 6 and 32.
; FontType: out, optional, type=integer
; This keyword is both an input and an output keyword. It
allows you to specify the font
; type you wish to use, and it also returns the font type the
user selected in the GUI.
; The user is responsibe for configuring the PostScript
graphical commands with the appropriate font
; type, because it cannot be done via the normal Device keyword
channel. Normally, this is set to
; !P.Font.
; Group_Leader: in, optional, type=long
; Set this keyword to the identifer of a widget group leader.
This program will be destroyed
; if the group leader application is destroyed.
; Helvetica: in, optional, type=boolean, default=0
; Set this keyword to select the Helvetica PostScript font.
; Inches: in, optional, type=boolean, default=1
; Set this keyword to indicate sizes and offsets are in inches
as opposed to centimeters.
; Set to zero by default if the `Metric` keyword is set.
; Italic: in, optional, type=boolean, default=0
; Set this keyword to select italic type font styling.
; Isolatin: in, optional, type=boolean, default=0
; Set this keyword to select ISOlatin1 encoding.
; Landscape: in, optional, type=boolean, default=0
; Set this keyword to select Landscape page output. Portrait
page output is the default.
; Light: in, optional, type=boolean, default=0
; Set this keyword to select the Light PostScript style for the
font.
; Match: in, optional, type=boolean, default=0
; If this keyword is set, the initial PostScript window will
match the aspect ratio of the
; current graphics window.
; Medium: in, optional, type=boolean, default=0
; Set this keyword to select the Medium PostScript style for
the font.
; Metric: in, optional, type=boolean, default=0
; Set this keyword to indicate metric mode (i.e., A4 page and
centimeter units).
; Name: in, optional, type=string
; Set this keyword to the "name" of the created FSC_PSConfig
object.
; Narrow: in, optional, type=boolean, default=0
; Set this keyword to select the Narrow font style.
; NoGUI: in, optional, type=boolean, default=0
; Set this keyword if you don't want a graphical user
interface, but just want to get the
; return structure of keywords.
; Oblique: in, optional, type=boolean, default=0
; Set this keyword to select the Oblique font style.
; PageType: in, optional, type=string, default='LETTER'
; Set this keyword to the "type" of page. Possible values are::
; "Letter" - 8.5 by 11 inches. (Default, unless the Metric
keyword is set.)
; "Legal" - 8.5 by 14 inches.
; "Ledger" - 11 by 17 inches.
; "A4" - 21.0 by 29.7 centimeters. (Default, if the Metric
keyword is set.)
; Palatino: in, optional, type=boolean, default=0
; Set this keyword to select the Palatino font.
; Preview: in, optional, type=integer, default=0
; Set this keyword to select the type of PostScript preview to
add to the file. Values 0, 1, or 2.
; Adding previews to PostScript files created in IDL is not
recommended as the results are always
; poor. There are better methods to add PostScript previews
using other software, such as GhostView.
; Schoolbook: in, optional, type=boolean, default=0
; Set this keyword to select the Schoolbook PostScript font.
; Set_Font: in, optional, type=string
; Set this keyword to the name of a PostScript hardware or true-
type font you want to use.
; Note that if you specify a true-type font, you must also set
the `TrueType` keyword.
; Symbol: in, optional, type=boolean, default=0
; Set this keyword to select the Symbol PostScript font.
; Times: in, optional, type=boolean, default=0
; Set this keyword to select the Times PostScript font.
; TrueType: in, optional, type=boolean, default=0
; Set this keyword to use true-type fonts in the PostScript
output. Set the name of the font
; with the `Set_Font` keyword.
; XOffset: in, optional, type=float
; Set this keyword to the X Offset. Uses "System (Portrait)"
defaults. (Note: offset
; calculated from lower-left corner of page.)
; XSize: in, optional, type=float
; Set this keyword to the X size of the PostScript "window".
Uses "System (Portrait)" defaults.
; YOffset: in, optional, type=float
; Set this keyword to the Y Offset. Uses "System (Portrait)"
defaults. (Note: offset
; calculated from lower-left corner of page.)
; YSize: in, optional, type=float
; Set this keyword to the Y size of the PostScript "window".
Uses "System (Portrait)" defaults.
; ZapfChancery: in, optional, type=boolean, default=0
; Set this keyword to select the ZapfChancery PostScript font.
; ZapfDingbats: in, optional, type=boolean, default=0
; Set this keyword to select the ZapfDingbats PostScript font.
;
; :Examples:
; To have the user specify PostScript configuration parameters, use
; the program like this::
;
; keywords = PSConfig(Cancel=cancelled)
; IF cancelled THEN RETURN
; thisDevice = !D.Name
; Set_Plot, 'PS'
; Device, _Extra=keywords
; Plot, findgen(11) ; Or whatever graphics commands you use.
; Device, /Close_File
; Set_Plot, thisDevice
;
; :Author:
; FANNING SOFTWARE CONSULTING::
; David W. Fanning
; 1645 Sheely Drive
; Fort Collins, CO 80526 USA
; Phone: 970-221-0438
; E-mail: david@idlcoyote.com
; Coyote's Guide to IDL Programming: http://www.idlcoyote.com
;
; :History:
; Change History::
; Written by David W. Fanning, 31 January 2000.
; Added NOGUI keyword to allow default keywords to be obtained
without
; user interaction. 11 Oct 2004. DWF.
; Added CMYK option 24 August 2007. Requires LANGUAGE_LEVEL=2
printer. L. Anderson
; Updated for IDL 7.1 and 24-bt color PostScript support. 24
May 2009. DWF.
; Added MATCH keyword. 14 Dec 2010. DWF.
; Changed ENCAPSULATE keyword to ENCAPSULATED, which is what I
always type! 29 Jan 2011. DWF.
; Depreciated EUROPEAN keyword in favor of METRIC. 31 Jan 2011.
DWF.
;
; :Copyright:
; Copyright (c) 2000-2012, Fanning Software Consulting, Inc.
;-
FUNCTION PSConfig, psObject, $ ; A FSC_PSCONFIG object.
AvantGarde=avantgarde, $ ; Set this keyword to select
the AvantGarde font.
Bits_per_Pixel=bits_per_pixel, $ ; The number of image bits
saved for each image pixel: 2, 4, or 8.
Bold=bold, $ ; Set this keyword to select
the Bold font style.
BookStyle=book, $ ; Set this keyword to select
the Book font style.
Bkman=bookman, $ ; Set this keyword to select
the Bookman font.
Cancel=cancelled, $ ; This output keyword will be
set to 1 if the user CANCELs. Set to 0 otherwise.
CMYK=cmyk, $ ; Set this keyword to use CMYK
colors instead of RGB. (Requires LANGUAGE_LEVEL=2 printer.)
Color=color, $ ; Set this keyword to select
Color PostScript output.
Courier=courier, $ ; Set this keyword to select
the Courier font.
Debug=debug, $ ; Set this keyword to get
traceback information when errors are encountered.
Decomposed=decomposed, $ ; Set this keyword to select
24-bit color PostScript support. (IDL 7.1 and above.)
DefaultSetup=defaultsetup, $ ; Set this keyword to the
"name" of a default style.
Demi=demi, $ ; Set this keyword to select
the Demi font style.
Directory=directory, $ ; Set thie keyword to the name
of the starting directory. Current directory by default.
Encapsulated=encapsulated, $ ; Set this keyword to select
Encapsulated PostScript output.
European=european, $ ; This keyword depreciated in
favor of "metric".
Filename=filename, $ ; Set this keyword to the name
of the file. Default: 'idl.ps'
FontInfo=fontinfo, $ ; Set this keyword if you want
font information in the FSC_PSCONFIG GUI.
FontSize=fontsize, $ ; Set this keyword to the font
size. Between 6 and 36. Default is 12.
FontType=fonttype, $ ; An input/output keyword that
will have the FontType. Will be !P.Font unless FontInfo is selected.
Group_Leader=group_leader, $ ; The group leader of the
PSConfig modal widget.
Helvetica=helvetica, $ ; Set this keyword to select
the Helvetica font.
Inches=inches, $ ; Set this keyword to indicate
sizes and offsets are in inches as opposed to centimeters.
Italic=italic, $ ; Set this keyword to select
the Italic font style.
Isolatin=isolatin, $ ; Set this keyword to select
ISOlatin1 encoding.
Landscape=landscape, $ ; Set this keyword to select
Landscape output.
Light=light, $ ; Set this keyword to select
the Light font style.
Match=match, $ ; Set this keyword to match
the aspect ratio of the current graphics window.
Medium=medium, $ ; Set this keyword to select
the Medium font style.
Metric=metric, $ ; Set this keyword to indicate
metric mode (i.e., A4 page and centimeter units).
Name=name, $ ; The "name" of the object.
Narrow=narrow, $ ; Set this keyword to select
the Narrow font style.
NoGUI=nogui, $ ; Return the default keywords
directly, without user interaction.
Oblique=oblique, $ ; Set this keyword to select
the Oblique font style.
PageType=pagetype, $ ; Set this keyword to the
"type" of page: 'Letter', 'Legal', 'Ledger', or 'A4'.
Palatino=palatino, $ ; Set this keyword to select
the Palatino font.
Preview=preview, $ ; Set this keyword to select
Preview mode: 0, 1, or 2.
Schoolbook=schoolbook, $ ; Set this keyword to select
the Schoolbook font.
Set_Font=set_font, $ ; Set this keyword to the name
of a font passed to PostScript with Set_Plot keyword.
Symbol=symbol, $ ; Set this keyword to select
the Symbol font.
Times=times, $ ; Set this keyword to select
the Times font.
TrueType=truetype, $ ; Set this keyword to select
True-Type fonts.
XOffset=xoffset, $ ; Set this keyword to the
XOffset. (Note: offset calculated from lower-left corner of page.)
XSize=xsize, $ ; Set this keyword to the X
size of the PostScript "window".
YOffset=yoffset, $ ; Set this keyword to the
YOffset. (Note: offset calculated from lower-left corner of page.)
YSize=ysize, $ ; Set this keyword to the Y
size of the PostScript "window".
ZapfChancery=zapfchancery, $ ; Set this keyword to select
the ZapfChancery font.
ZapfDingbats=zapfdingbats ; Set this keyword to select
the ZapfDingbats font.

On_Error, 2

; Depreciated keywords.
IF N_Elements(metric) EQ 0 THEN metric = Keyword_Set(european) ELSE
metric = Keyword_Set(metric)

; Cannot have landscape orientation with encapsulated PostScript
output.
IF Keyword_Set(encapsulated) THEN landscape = 0

; Did the user ask us to match the aspect ratio of the current
graphics window?
IF Keyword_Set(match) THEN BEGIN

; Is this a device that supports windows?
IF (!D.Flags AND 256) NE 0 THEN BEGIN

; Is there a current graphics window?
IF !D.Window GE 0 THEN BEGIN
IF N_Elements(inches) NE 0 THEN cm = 1 -
Keyword_Set(inches)
keywords = PSWindow(Landscape=landscape, CM=cm,
Metric=metric)
xsize = keywords.xsize
ysize = keywords.ysize
xoffset = keywords.xoffset
yoffset = keywords.yoffset
inches = keywords.inches
landscape = keywords.landscape
portrait = keywords.portrait
ENDIF
ENDIF
ENDIF

IF N_Elements(psObject) EQ 0 THEN BEGIN
psObject = Obj_New('FSC_PSCONFIG', $
AvantGarde=avantgarde, $
Bits_per_Pixel=bits_per_pixel, $
Bold=bold, $
BookStyle=book, $
Bkman=bookman, $
CMYK=cmyk, $
Color=color, $
Courier=courier, $
Debug=debug, $
Decomposed=decomposed, $
DefaultSetup=defaultsetup, $
Demi=demi, $
Directory=directory, $
Encapsulated=encapsulated, $
Filename=filename, $
FontSize=fontsize, $
FontType=fonttype, $
Helvetica=helvetica, $
Inches=inches, $
Italic=italic, $
Isolatin=isolatin, $
Landscape=landscape, $
Light=light, $
Medium=medium, $
Metric=metric, $
Name=name, $
Narrow=narrow, $
Oblique=oblique, $
PageType=pagetype, $
Palatino=palatino, $
Preview=preview, $
Schoolbook=schoolbook, $
Set_Font=set_font, $
Symbol=symbol, $
Times=times, $
TrueType=truetype, $
XOffset=xoffset, $
XSize=xsize, $
YOffset=yoffset, $
YSize=ysize, $
ZapfChancery=zapfchancery, $
ZapfDingbats=zapfdingbats )
Create = 1
ENDIF ELSE BEGIN
type = Size(psObject, /Type)
IF type NE 11 THEN BEGIN
Message, 'Object Reference required as an argument'
ENDIF
create = 0
ENDELSE

; Call the GUI of the FSC_PSCONFIG object.

IF Keyword_Set(nogui) EQ 0 THEN $
psObject->GUI, Group_Leader=group_leader, Cancel=cancelled,
FontInfo=Keyword_Set(fontinfo)

; Get the PostScript device keywords, along with the font type
information.

keywords = psObject->GetKeywords(FontType=fonttype)

; If this program created the psObject, destroy it. Otherwise leave
it.

IF create THEN Obj_Destroy, psObject

; Return the PostScript device keywords.

RETURN, keywords
END ;----------------------------------------------------------- -----------


>>>> >>>>>>>>>>>>>>

;+
; NAME:
; PS_START
;
; PURPOSE:
;
; The purpose of PS_START and PS_END is to make it easy to set-up
; for and close a PostScript file. The programs work in close
conjunction
; with PSCONFIG, another program from the Coyote Library.
;
; If ImageMagick (http://www.imagemagick.org/script/index.php) is
installed
; on your computer, you can easily convert PostScript output to
JPEG, PNG, and TIFF
; image output. (See the keywords to PS_END.)
;
; AUTHOR:
;
; FANNING SOFTWARE CONSULTING
; David Fanning, Ph.D.
; 1645 Sheely Drive
; Fort Collins, CO 80526 USA
; Phone: 970-221-0438
; E-mail: davidf@dfanning.com
; Coyote's Guide to IDL Programming: http://www.dfanning.com/
;
; CATEGORY:
;
; Graphics, File Output, PostScript
;
; CALLING SEQUENCE:
;
; PS_START
; Various graphics commands here...
; PS_END
;
; KEYWORD PARAMETERS FOR PS_START:
;
; FONT: Set this to the type of font you want. A -1
selects Hershey
; fonts, a 0 selects hardware fonts (Helvetica,
normally), and
; a 1 selects a True-Type font. Set to 1 by
default.
;
; GUI: The default behavior is to use PSCONFIG to
configure the
; PostScript device silently. If you wish to allow
the user
; to interatively configure the PostScript device,
set this
; keyword.
;
; NOMATCH: Normally, PS_Start will try to "match" the
aspect ratio of the
; PostScript file "window" to the current display
window. If this
; keyword is set, then this doesn't occur, giving
the user the
; option of specifying the size and offsets of the
PostScript
; window directly though appropriate keywords.
;
; QUIET: If set, informational messages are not set.
;
; SCALE_FACTOR: Set this to the PostScript scale factor. By
default: 1.
;
; TT_FONT: The name of a true-type font to use of FONT=1.
By default, "TIMES".
;
; Any keyword supported by PSCONFIG can be used to configure the
PostScript device.
; Common keywords would include FILENAME, XSIZE, YSIZE, XOFFSET,
YOFFSET, etc. See
; the PSCONFIG documentation for details. If size keywords are
used, you *must* set
; the NOMATCH keyword.
;
; COMMON BLOCKS:
;
; _$FSC_PS_START_ Contains the PS_STRUCT structure for
communication between
; PS_START and PS_END.
;
; SIDE EFFECTS:
;
; When PS_START is called, the current graphics device is set to
"PS" (the PostScript
; device). When PS_END is called the current graphics device is
returned to the device
; in effect when PS_START was called.
;
; RESTRICTIONS:
;
; Requires numerous programs from the Coyote Library. To convert
PostScript files
; to PNG, JPEG, and TIFF files requires ImageMagick be installed
on your
; computer and configured correctly. You can download Coyote
Library programs here:
;
; http://www.dfanning.com/programs/coyoteprograms.zip
;
; ImageMagick can be found here:
;
; http://www.imagemagick.org/script/index.php
;
; NOTE: In this version of PS_START, I have added the "alpha"
option to the ImageMagick
; command. This is a relatively recent addition to the convert
command. (Added in ImageMagick
; version 6.3.4). Your version of ImageMagick may not allow it.
If so, simply comment out the
; alpha command in the code below (on or about line 242), or
uncomment it, as the case may be.
;
; EXAMPLE:
;
; To create a line plot in a PostScript file named lineplot.ps
and
; also create a PNG file named lineplot.png for display in a
browser,
; type these commands.
;
; PS_Start, FILENAME='lineplot.ps'
; Plot, Findgen(11), COLOR=FSC_Color('navy'), /NODATA,
XTITLE='Time', YTITLE='Signal'
; OPlot, Findgen(11), COLOR=FSC_Color('indian red')
; OPlot, Findgen(11), COLOR=FSC_Color('olive'), PSYM=2
; PS_End, /PNG
;
; NOTES:
;
; You can easily configure any modifications you like for your
PostScript output
; by setting fields in the plot and axis system variables (!P, !
X, !Y, and !Z).
; The modifications currently made by default in this program
are these:
;
; !P.Thick = 2
; !P.CharThick = 2
; !P.Charsize = 1.25 (or 1.5 if in UNIX)
; !X.Thick = 2
; !Y.Thick = 2
; !Z.Thick = 2
; !P.Font = 0
;
; MODIFICATION HISTORY:
;
; Written by: David W. Fanning, 20 May 2008.
; Slight modification to allow filenames with spaces in them.
; Added NoMatch keyword. 17 March 2009. DWF.
; Added a number of keywords to make these commands more
configurable. 19 March 2009. DWF.
; Only set thickness system variables if starting system
variables are set to their
; default values (namely, 0). This allows users to set their
own system variables
; before they call PS_START, rather than after. 23 March
2009. DWF.
; Moved PS_END to its own file to allow the IDLExBr_Assistant to
work properly. 7 April 2009. DWF.
;-
;
;*********************************************************** *******************************;
; Copyright (c) 2008 -2009, by Fanning Software Consulting,
Inc. ;
; All rights
reserved. ;
; ;
; Redistribution and use in source and binary forms, with or
without ;
; modification, are permitted provided that the following conditions
are met: ;
; ;
; * Redistributions of source code must retain the above
copyright ;
; notice, this list of conditions and the following
disclaimer. ;
; * Redistributions in binary form must reproduce the above
copyright ;
; notice, this list of conditions and the following disclaimer
in the ;
; documentation and/or other materials provided with the
distribution. ;
; * Neither the name of Fanning Software Consulting, Inc. nor the
names of its ;
; contributors may be used to endorse or promote products
derived from this ;
; software without specific prior written
permission. ;
; ;
; THIS SOFTWARE IS PROVIDED BY FANNING SOFTWARE CONSULTING, INC. ''AS
IS'' AND ANY ;
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES ;
; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT ;
; SHALL FANNING SOFTWARE CONSULTING, INC. BE LIABLE FOR ANY DIRECT,
INDIRECT, ;
; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED ;
; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; ;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ;
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT ;
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS ;
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. ;
;*********************************************************** *******************************;
PRO PS_START, $
FONT=font , $
GUI=gui, $
NOMATCH=nomatch, $
QUIET=quiet, $
SCALE_FACTOR=scale_factor, $
TT_FONT=tt_font, $
_EXTRA=extra

COMMON _$FSC_PS_START_, ps_struct

; PostScript hardware fonts by default.
SetDefaultValue, font, 0

; Use Helvetica True-Type font by default.
IF font EQ 1 THEN SetDefaultValue, tt_font, 'Helvetica'

gui = Keyword_Set(gui)
quiet = Keyword_Set(quiet)

; Define the PS structure.
IF N_Elements(ps_struct) EQ 0 THEN ps_struct = {FSC_PS_SETUP}

; If the setup flag is on, then we have to close the previous
; start command before we can continue.
IF ps_struct.setup EQ 1 THEN PS_END

; Save current setup information in the PS_STRUCT structure.
ps_struct.setup = 1
ps_struct.currentDevice = !D.Name
ps_struct.p = !P
ps_struct.x = !X
ps_struct.y = !Y
ps_struct.z = !Z

; Change any parameters you feel like changing.
IF ps_struct.p.thick EQ 0 THEN !P.Thick = 2
IF ps_struct.p.charthick EQ 0 THEN !P.Charthick = 2
IF ps_struct.p.charsize EQ 0 THEN !P.Charsize = 1.25
IF ps_struct.x.thick EQ 0 THEN !X.Thick = 2
IF ps_struct.y.thick EQ 0 THEN !Y.Thick = 2
IF ps_struct.z.thick EQ 0 THEN !Z.Thick = 2

; Set the true-type font.
thisWindow = !D.Window
IF thisWindow EQ -1 AND ((!D.Flags AND 256) NE 0)THEN BEGIN
Window, /FREE, /PIXMAP
pixmap = !D.Window
ENDIF
!P.Font = font
Device, Set_Font=tt_font, /TT_FONT
IF N_Elements(pixmap) NE 0 THEN WDelete, pixmap

; Configure the PostScript Device
cancelled = 0
IF ~Keyword_Set(nomatch) THEN BEGIN
IF !D.X_Size GT !D.Y_Size THEN landscape = 1 ELSE landscape = 0
sizes = PSWindow(_Extra=extra, LANDSCAPE=landscape)
keywords = PSConfig(_Extra=extra, INCHES=sizes.inches,
XSIZE=sizes.xsize, YSIZE=sizes.ysize, $
XOFFSET=sizes.xoffset, YOFFSET=sizes.yoffset,
Cancel=cancelled, NOGUI=(~gui), LANDSCAPE=landscape)
ENDIF ELSE BEGIN
keywords = PSConfig(_Extra=extra, Cancel=cancelled,
NOGUI=(~gui))
ENDELSE
IF cancelled THEN BEGIN
PS_END
RETURN
ENDIF

; Let them know where the output will be.
IF ~quiet THEN Print, 'PostScript output will be created here: ',
keywords.filename

Set_Plot, 'PS'
Device, _EXTRA=keywords

; What about scale factor?
IF N_Elements(scale_factor) NE 0 THEN $
DEVICE, SCALE_FACTOR=scale_factor ELSE $
DEVICE, SCALE_FACTOR=1

; Store filename.
ps_struct.filename = keywords.filename
ps_struct.landscape = Fix(keywords.landscape)
ps_struct.quiet = Fix(quiet)

END



my question is compatibility ps_star IDL 7.1?
Thanks in Advanced
[Message index]
 
Read Message
Previous Topic: IDLVM and execute
Next Topic: Re: ps_star.pro no found on IDL71?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:48:23 PDT 2025

Total time taken to generate the page: 0.88004 seconds