This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
additions for data with Feature type Point
git-svn-id: file:///home/users/tmap/svn/repos/baker/trunk@23538 fdbf22ae-c210-0410-be80-ca943da6b8f8
- Loading branch information
1 parent
898b315
commit 7565af6
Showing
9 changed files
with
351 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,269 @@ | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
! $Header$ | ||
! Points_xy.jnl | ||
! | ||
! Creates a 2D plot with a blank 'basemap' and an overlay of points | ||
! colored by the ($ferret_plot_var) defined in LAS_initialize_data_insitu. | ||
! Reads dsg files with the "point" feature type | ||
! 3/31/2017 ACM | ||
|
||
IF `($ferret_memory"25.6") LT 200` THEN SET MEM/SIZ=200 | ||
|
||
DEFINE SYMBOL start_clock_seconds = ($clock_secs) | ||
|
||
|
||
! Set the gif filename, changing it from .gif to the name from this request | ||
! Set up to write info to the debug log so that FshowGO can be used | ||
GO LAS_initial_setup | ||
|
||
! Initialize the region and data. | ||
|
||
DEFINE SYMBOL data_initialization_script = feature_initialize_data_insitu | ||
|
||
! DEFINE SYMBOL ferret_label = 0 | ||
|
||
SET MODE verify:always ! allows for debugging | ||
|
||
DEFINE SYMBOL its_insitu = 1 | ||
DEFINE SYMBOL its_trajectory_map = 1 | ||
GO LAS_initialize_region 0 | ||
|
||
IF ($data_0_var"0|vid>1|*>0") THEN | ||
DEFINE SYMBOL ferret_by_id = 1 | ||
USE "($data_0_url)" | ||
LET varnames = ..varnames | ||
|
||
DEFINE SYMBOL data_0_var = `varnames[i=1]` | ||
CANCEL DATA "($data_0_url)" | ||
ENDIF | ||
DEFINE SYMBOL data_name_in = ($data_0_var) | ||
|
||
GO LAS_initialize_data 0 | ||
|
||
! Check for errors (They often occur during dataset initialization.) | ||
|
||
IF ($error_status"0|*>1") THEN | ||
MESSAGE/ERROR **ERROR ($error_string) | ||
EXIT/PROGRAM | ||
ENDIF | ||
|
||
! Set the URL label for the first dataset. | ||
GO LAS_url_label 0 | ||
|
||
! For the annotations | ||
IF `($ngood_data"-10|*>1") LT 0` THEN DEFINE SYMBOL ngood_data = `($data_var)[i=@NGD]` | ||
IF `($nbad_data"-10|*>1") LT 0` THEN DEFINE SYMBOL nbad_data = `($data_var)[i=@NBD]` | ||
|
||
IF `STRINDEX("($ferret_view"0")", "x") EQ 0` THEN | ||
|
||
MESSAGE/ERROR **ERROR Expecting a view in xy or xyt | ||
EXIT/PROGRAM | ||
ENDIF | ||
|
||
LET/UNITS=degrees_east x_var_data = ($data_x_var) | ||
IF `($nodata"0|*>1") EQ 0` THEN | ||
STAT x_var_data | ||
ELSE | ||
DEFINE SYMBOL stat_min ($region_x_lo) | ||
ENDIF | ||
|
||
IF ($data_y_var"0|*>1") THEN LET/UNITS=degrees_north y_var_data = ($data_y_var) | ||
IF ($data_z_var"0|*>1") THEN LET z_var_data = ($data_z_var) | ||
IF ($data_t_var"0|*>1") THEN LET t_var_data = ($data_t_var) | ||
|
||
! Check for non-numeric data types. If cannot plot, just show the locations. | ||
LET var_data = ($data_var) | ||
|
||
DEFINE SYMBOL var_data = ($data_var)[i=1,m=1] | ||
DEFINE SYMBOL vtype = 0 | ||
LET gettype= ($var_data) | ||
DEFINE SYMBOL vtype = `gettype,RETURN=dtype` | ||
DEFINE SYMBOL is_string = ($vtype"0|CHAR>1|*>0") | ||
|
||
IF `($is_string) AND ($ferret_strfloat"0|*>1")` THEN | ||
SET VAR/NAME = var_data_0 var_data | ||
LET var_data = STRFLOAT(var_data_0) | ||
SET ATT/LIKE=var_data_0 var_data | ||
DEFINE SYMBOL ferret_plot_var var_data | ||
ELIF ($is_string) THEN | ||
LET var_data = 0*x_var_data | ||
DEFINE SYMBOL note_num = `($note_num"0") + 1` | ||
DEFINE SYMBOL note_($note_num)_lab = ($data_0_title) is not numeric. Plotting the point locations only. | ||
CANCEL SYMBOL ferret_plot_var | ||
ENDIF | ||
|
||
! Special color-by-time key | ||
IF ($ferret_plot_key"0|date_key>1|*>0") THEN | ||
|
||
! In this case we set up a time axis, and label the color key with dates | ||
! If the units are seconds since, we don't need that much resolution for this. Make it hours. | ||
|
||
LET tmin = ($data_var)[i=@MIN] | ||
LET tmax = ($data_var)[i=@MAX] | ||
|
||
LET since_loc = STRINDEX("`($data_t_var).units`","since") - 2 | ||
IF `since_loc GT 1` THEN | ||
LET tunits = SUBSTRING("`($data_t_var).units`",1,`since_loc`) | ||
DEFINE SYMBOL tunits = `tunits` | ||
ENDIF | ||
DEFINE AXIS/T=`tmin`:`tmax`:1/T0="`($data_t_var).time_origin`"/units=($tunits) time_axis | ||
IF ($tunits"0|seconds>1|*>0") THEN \ | ||
DEFINE AXIS/T=`tmin`:`tmax`:3600/T0="`($data_t_var).time_origin`"/units=($tunits) time_axis | ||
DEFINE SYMBOL datekey = 1 | ||
|
||
DEFINE SYMBOL ferret_key_annotate = 0 | ||
|
||
LET ttvar = t[gt=time_axis] | ||
DEFINE SYMBOL datekey_time_arg = ttvar | ||
|
||
IF `($ferret_plot_levels"0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_plot_levels = 50 | ||
IF `($ferret_fill_levels"0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_fill_levels = ($ferret_plot_levels) | ||
|
||
ENDIF | ||
|
||
! Set color levels | ||
GO LAS_initialize_var_levels | ||
|
||
! Color key for the variable values. | ||
! If there is no plot variable defined (only plotting locations), | ||
! do not plot the key. | ||
|
||
IF ($ferret_plot_key"1|0|*>1") THEN | ||
IF `($ferret_plot_key"0|0|1>0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_plot_key = ($ferret_plot_var"0|*>1") | ||
ENDIF | ||
|
||
! Plot qualifiers (graticule lines etc) | ||
GO LAS_set_plot_qualifiers | ||
IF `STRINDEX("($qualifiers)", "KEY") EQ 0 AND ($ferret_plot_key"0|*>1")` THEN DEFINE SYMBOL qualifiers = ($qualifiers)/KEY | ||
|
||
! Open the window | ||
GO LAS_open_window | ||
|
||
SAY _________________ Before land underlay clock seconds: ($clock_secs) | ||
|
||
LET pre_plot = ($clock_secs) | ||
|
||
! Create the blank plot with bathymetries, | ||
! coastlines, EEZ's, etc. | ||
! Make the gray ocean lighter. To make it lighter still, | ||
! start the colors with -40000. A lighter map needs darker graticule lines. | ||
|
||
! In trajectory_ui.xml is an option "Bathymetry style". Choose a white | ||
! background or the default grayscale bathymetry. | ||
|
||
DEFINE SYMBOL basemap_palette = grayscale | ||
|
||
DEFINE SYMBOL basemap_levels = (-inf)(-20000,-1000,500)(-1000,0,100) | ||
|
||
IF ($ferret_bathymetry_style"1|grayscale>1|*>0") THEN | ||
PPL COLOR,7,55,55,55 ! gray | ||
ENDIF | ||
|
||
IF ($ferret_bathymetry_style"0|white>1|*>0") THEN DEFINE SYMBOL basemap_palette = white | ||
IF ($ferret_bathymetry_style"0|blue>1|*>0") THEN | ||
DEFINE SYMBOL basemap_palette = osmc_bluescale | ||
DEFINE SYMBOL basemap_levels = (-20000)(-10000,0,10000) | ||
ENDIF | ||
|
||
GO LAS_XY_overlay_basemap | ||
|
||
PPL SHASET PROTECT | ||
|
||
! Note LAS_fland.jnl determines the resoultion from the region symbols. | ||
! GO LAS_fland black | ||
! GO LAS_fland navy | ||
! GO LAS_fland brown_dark | ||
! GO LAS_fland green_pine | ||
|
||
GO LAS_fland ($ferret_land_palette"gray_dark") | ||
|
||
PPL SHASET PROTECT | ||
SAY _________________ After land underlay clock seconds: ($clock_secs) | ||
SAY _________________ total time for land underlay, seconds ----- `($clock_secs) - pre_plot` | ||
|
||
! Turn on annotate_key, which persists until turned off | ||
! (unless key_annoatate property tells us otherwise). | ||
|
||
IF ($ferret_key_annotate"1|0|1|*>1") THEN | ||
KEYMARK 1 | ||
ELSE | ||
KEYMARK 0 | ||
ENDIF | ||
|
||
! Define plot qualifiers for color ribbon plot | ||
DEFINE SYMBOL qualifiers = ($qualifiers)/OVER/NOLAB | ||
|
||
|
||
! Add an annotation with number of points shown | ||
GO feature_labels | ||
|
||
! Ribbon plot | ||
|
||
DEFINE SYMBOL plot_command = PLOT/VS/RIBBON | ||
DEFINE SYMBOL qualifiers = ($qualifiers)/SYM=19/siz=0.18/THICK=1 | ||
|
||
! Set the palette | ||
! If there is no variable, only locations, and if a palette is not | ||
! defined by ferret_palette, use black. | ||
|
||
IF ($ferret_plot_var"0|*>1") THEN | ||
DEFINE SYMBOL qualifiers = ($qualifiers)/PALETTE=($ferret_palette"rainbow|default>rainbow|*>*") | ||
ELSE | ||
DEFINE SYMBOL qualifiers = ($qualifiers)/PALETTE=($ferret_palette"black|default>black|*>*")/NOKEY | ||
ENDIF | ||
|
||
SAY _________________ Start line plot: clock seconds: ($clock_secs) | ||
LET pre_plot = ($clock_secs) | ||
|
||
! Draw the ribbon plot | ||
|
||
DEFINE SYMBOL plot_plot_vars = x_var_data, y_var_data, var_data | ||
($plot_command)($qualifiers)/SET ($plot_plot_vars) | ||
IF ($ferret_annotations%0|*>1%) THEN GO key_at_top | ||
PPL RIBBON/OVER | ||
|
||
SAY _________________ END line plot: clock seconds: ($clock_secs) | ||
SAY _________________ total time for line plot, seconds ----- `($clock_secs) - pre_plot` | ||
|
||
IF ($ferret_plot_var"0|*>1") THEN | ||
LET data_range = minmax(var_data) | ||
DEFINE SYMBOL data_plotted_min = `data_range[i=1],prec=7` | ||
DEFINE SYMBOL data_plotted_max = `data_range[i=2],prec=7` | ||
ENDIF | ||
|
||
! Add annotations | ||
|
||
IF `($nmask_labels"0|*>1") EQ 0` THEN DEFINE SYMBOL nmask_labels = 1 | ||
|
||
REPEAT/RANGE=1:`($nmask_labels)`:1/NAME=m (\ | ||
DEFINE SYMBOL mmask = `m`;\ | ||
IF ($mask_title_($mmask)"0|*>1) THEN ; \ | ||
DEFINE SYMBOL note_num = `($note_num"0") + 1`; \ | ||
DEFINE SYMBOL note_($note_num)_lab = ($mask_title_($mmask)); \ | ||
ENDIF) | ||
|
||
! if constraints are shown via constraint_0_lhs etc, define labels for those | ||
GO set_constraint_labels | ||
|
||
! restore key-annotation setting: keys not annotated | ||
KEYMARK 0 | ||
|
||
! Save the results | ||
|
||
GO LAS_results box | ||
|
||
! End of file ------------Points_xy.jnl-------------------------- | ||
|
||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
SAY _________________ exiting Points_xy.jnl product script: | ||
|
||
SAY _________________ Product script total execution time, seconds: ----- `($clock_secs) - ($start_clock_seconds)` | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
! NOTE Can get just the timing info from a log of this product with | ||
! grep seconds log.out | grep -v "SAY " | grep -v MESSAGE | grep -v independent | ||
! | ||
! Or just the totals for decimating, plotting and the whole script with | ||
! grep seconds log.out | grep -v "SAY " | grep -v MESSAGE | grep -v independent | grep total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.