[Thread Prev][Thread Next][Index]

Re: [ferret_users] Color filling contours in Plate Caree projection - problem resloved




Dear Ferret Users, 

I resolve my Ferret problem described below. I've been running Ferret v. 5.81. Downloading and installing v.6.7 cured it completely. 

Thank you for your responses and help. 

Sergei



On Jun 16, 2011, at 4:21 PM, Sergei Maurits wrote:

Ansley, 

I run your script with some minor modifications (minor case sensitivity problems,
level=v syntax in command  fill) and got three picture in GIF

1. data fill in rectangular frame (data input proof) - OK, I see data
2. data (rather absence of ...) fill in Plate Caree    - only map and mesh, no data
3. data fill in Stereographic                                       - OK - data, map, and mesh

Basically, this is repetition of my previous findings, and because of that I did not modifie
my script moving data reading before the projection definition. I expect the same results. 

Provided, you got #2 successfully using this below script, please let me know what is your 
platform and the Ferret verson? 

I run Luniux RH and Ferret v. 5.81

I appreciate your attention to this question and time you spent addressing it. If you'd like, 
I can send to you my data (rather small) and custom color palette for experimenting. 

Sergei Maurits<First_fill_data_proof.gif><Second_fill_mp_Plate_Caree_proof.gif><Third_fill_mp_Stereographic_proof.gif>

The script   ( I run it in  >ferret -gif  mode)
**********************************************************

SET MODE METAFILE    ! output to metafile, PS-compatible
SET MODE VERIFY         ! show command file lines at the screen

!Preparation, cleaning from last settings
CANCEL REGION
CANCEL VARIABLES/ALL
CANCEL DATA/ALL
CANCEL VIEWPORTS

! 6/16/2011Set up the dataset
!definition of axis (x,y,t) and 3D grid from these axis

! CREATE A DATASET IN A SIMILAR FORMAT
USE coads_climatology
SET REGION/X=0:360/Y=40:90/L=1:12
! error LIST/CLOBBER/NOHEAD/NOROW/FORM=(E12.5)/FILE=SST.DAT SST
LIST/CLOBBER/NOHEAD/FORM=(E12.5)/FILE=SST.DAT SST
CANCEL DATA/ALL

! Now define a grid and set up to read the data
define axis/x=0.0e:359.0e:2/unit=degree ocnx
define axis/y=41n:90n:2/unit=degree ocny
define axis/t=1:12:1 ocnt
define grid/x=ocnx/y=ocny/t=ocnt ocngrid

!show grid ocngrid !optional

!DATA reading from formatted ASCII file into variable sic
file/format=(E12.5)/order=xyt/var=sic/grid=ocngrid SST.DAT !formatted file

show variable sic !optional

!introduction of variable sic_n = 100*sic if sic is > 0 or NoN otherwise

let sic_n = if sic gt 0.0 then sic*100 else (-1)^0.5
!show variable sic_n ! optional

!!! JUST USE SIC_N = SIC
!!! MAKE A TEST PLOT.
  LET SIC_N = SIC
  FILL/L=1 SIC
frame/file="First_fill_data_proof.gif"
  PAUSE

!Setting region 40-90N, 0-360 , 12 months
set region/l=1:12
set region/x=0.0:360.0/y=40.0N:90.0N
!SHOW REGION !optional

!Set window size and aspect ratio (will be overwritten if go mp_aspect is called)
!SET WINDOW/SIZE=1.1/ASPECT=0.4   !(aspect up increases vert size, for Plate Caree)
SET WINDOW/SIZE=1.1/ASPECT=1    !(aspect up increases vert size, 1 for stereographic)

!Show WINDOW size in pixsels
show symbol ppl$xpixel
show symbol ppl$ypixel
!! Stereographic projection
!===========================
! Usage:                   arg1               arg2
!  go mp_stereographic_north [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

! go mp_stereographic_north -42.5 !stereographic projection

! NOTE:  Do not forget to uncomment
!        go mp_aspect
!        below, if Stereographic projection is used

!!Simple Cylindrical or Plate Ceree projection for G.Earth
!=========================================================
! Usage:                   arg1               arg2
!  go mp_plate_caree [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

go mp_plate_caree -42.5 !Simple Cylindrical or Plate Caree projection for G.Earth

!show variables !optional
!Comment the next line out for Simple Cylindrical or Plate Caree projection
!go mp_aspect       ! computes appropriate aspect, ovewritting SET WINDOW,
                  ! useful for stereographic projection, but SET WINDOW is better for P.C.

!Setting grid for variable sic_n, important
set grid sic_n
!show grid  sic_n !optional

! error (V) fill/nolab/noaxis/set_up/nokey/levels=v/L=1 sic_n*mp_mask,x_page,y_page
fill/nolab/noaxis/set_up/nokey/L=1 sic_n*mp_mask,x_page,y_page

ppl fill

!Optional contouring with different colors/line width
!contour/over/noaxis/set_up/nolabels/color=4/levels=(15,90,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!contour/over/noaxis/set_up/nolabels/color=17/levels=(15,15,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!Adding map and geographic mesh
go mp_graticule 0 360 30 50 90 20 1
go mp_land 1 overlay
! Output to GIF-file
frame/file="Second_fill_mp_Plate_Caree_proof.gif"

!! Stereographic projection
!===========================
! Usage:                   arg1               arg2
!  go mp_stereographic_north [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

go mp_stereographic_north -42.5 !stereographic projection

! NOTE:  Do not forget to uncomment
!        go mp_aspect
!        below, if Stereographic projection is used

!!Simple Cylindrical or Plate Ceree projection for G.Earth
!=========================================================
! Usage:                   arg1               arg2
!  go mp_plate_caree [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

!go mp_plate_caree -42.5 !Simple Cylindrical or Plate Caree projection for G.Earth

!show variables !optional


!Comment the next line out for Simple Cylindrical or Plate Caree projection
go mp_aspect       ! computes appropriate aspect, ovewritting SET WINDOW,
                  ! useful for stereographic projection, but SET WINDOW is better for P.C.

!Setting grid for variable sic_n, important
set grid sic_n
!show grid  sic_n !optional

! error (V) fill/nolab/noaxis/set_up/nokey/levels=v/L=1 sic_n*mp_mask,x_page,y_page
fill/nolab/noaxis/set_up/nokey/L=1 sic_n*mp_mask,x_page,y_page

ppl fill

!Optional contouring with different colors/line width
!contour/over/noaxis/set_up/nolabels/color=4/levels=(15,90,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!contour/over/noaxis/set_up/nolabels/color=17/levels=(15,15,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!Adding map and geographic mesh
go mp_graticule 0 360 30 50 90 20 1
go mp_land 1 overlay
! Output to GIF-file
frame/file="Third_fill_mp_Stereographic_proof.gif"


CANCEL MODE METAFILE

********************************************************************************


Dr. Sergei Maurits, HPC Specialist
Arctic Region Supercomputing Center
University of Alaska Fairbanks
Fairbanks, AK 99775-6020
907 450 8697 voice   907 450 8604 fax.
maurits@xxxxxxxx



On Jun 16, 2011, at 8:43 AM, Ansley Manke wrote:

Hi -
Let's see if we can work this out and then report back to the users list when we know what's happening.  I don't have your data of course but I wonder if the problem is in in reading the data or in the region settings.

I would move the setup of your input data, defining its grid, to the start of the script, to separate that from the map projection and plotting calls.

I made an example dataset from coads_climatology which is an XYT dataset, and read it in with similar commands to the ones you used.  I used your same calls to set the region and define the map projection. I changed the levels and palette that you used, and the script runs correctly and makes a plot.  So, first, I know that you have done this but make sure you can plot the data without the map projection.   I did that  in the script below, with a pause statement after it.

Here is my example script, see if you can run it and if you can spot what may be different in your example.  I put the commands that I added for testing in all capital letters, marked with comments that start with !!!


****************************************************

SET MODE METAFILE    ! output to metafile, PS-compatible
SET MODE VERIFY         ! show command file lines at the screen

!Preparation, cleaning from last settings
CANCEL REGION
CANCEL VARIABLES/ALL
CANCEL DATA/ALL
CANCEL VIEWPORTS

! 6/16/2011Set up the dataset
!definition of axis (x,y,t) and 3D grid from these axis

! CREATE A DATASET IN A SIMILAR FORMAT
USE COADS_CLIMATOLOGY
SET REGION/X=0:360/Y=40:90/L=1:12
LIST/CLOBBER/NOHEAD/NOROW/FORM=(E12.5)/FILE=SST.DAT SST
CANCEL DATA/ALL

! Now define a grid and set up to read the data
define axis/x=0.0e:359.0e:2/unit=degree ocnx
define axis/y=41n:90n:2/unit=degree ocny
define axis/t=1:12:1 ocnt
define grid/x=ocnx/y=ocny/t=ocnt ocngrid

!show grid ocngrid !optional

!DATA reading from formatted ASCII file into variable sic
file/format=(E12.5)/order=xyt/var=sic/grid=ocngrid sst.dat !formatted file

show variable sic !optional

!introduction of variable sic_n = 100*sic if sic is > 0 or NoN otherwise

let sic_n = if sic gt 0.0 then sic*100 else (-1)^0.5
!show variable sic_n ! optional

!!! JUST USE SIC_N = SIC
!!! MAKE A TEST PLOT.
  LET SIC_N = SIC
  FILL/L=1 SIC
  PAUSE

!Setting region 40-90N, 0-360 , 12 months
set region/l=1:12
set region/x=0.0:360.0/y=40.0N:90.0N
!SHOW REGION !optional

!Set window size and aspect ratio (will be overwritten if go mp_aspect is called)
!SET WINDOW/SIZE=1.1/ASPECT=0.4   !(aspect up increases vert size, for Plate Caree)
SET WINDOW/SIZE=1.1/ASPECT=1    !(aspect up increases vert size, 1 for stereographic)

!Show WINDOW size in pixsels
show symbol ppl$xpixel
show symbol ppl$ypixel


!! Stereographic projection
!===========================
! Usage:                   arg1               arg2
!  go mp_stereographic_north [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

! go mp_stereographic_north -42.5 !stereographic projection

! NOTE:  Do not forget to uncomment
!        go mp_aspect
!        below, if Stereographic projection is used

!!Simple Cylindrical or Plate Ceree projection for G.Earth
!=========================================================
! Usage:                   arg1               arg2
!  go mp_plate_caree [central meridian] [standard parallel]
!
! arg 1 - longitude used for the center of the projection
! arg 2 - latitude used for the center of the projection

go mp_plate_caree -42.5 !Simple Cylindrical or Plate Caree projection for G.Earth

!show variables !optional

!Comment the next line out for Simple Cylindrical or Plate Caree projection
!go mp_aspect       ! computes appropriate aspect, ovewritting SET WINDOW,
                  ! useful for stereographic projection, but SET WINDOW is better for P.C.

!Setting grid for variable sic_n, important
set grid sic_n
!show grid  sic_n !optional

fill/nolab/noaxis/set_up/nokey/levels=v/L=1 sic_n*mp_mask,x_page,y_page
ppl fill

!Optional contouring with different colors/line width
!contour/over/noaxis/set_up/nolabels/color=4/levels=(15,90,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!contour/over/noaxis/set_up/nolabels/color=17/levels=(15,15,15)/L=1 sic_n*mp_mask,x_page,y_page
!ppl contour/over !ppl plot layout
!Adding map and geographic mesh
go mp_graticule 0 360 30 50 90 20 1
go mp_land 1 overlay
! Output to GIF-file
frame/file="output_str40N_2028_101.gif"

CANCEL MODE METAFILE

*****************************************************







[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement