From 7565af607f87a05f94e34b76a9c355ea9e4b5569 Mon Sep 17 00:00:00 2001 From: Ansley Manke Date: Mon, 3 Apr 2017 17:01:59 +0000 Subject: [PATCH] additions for data with Feature type Point git-svn-id: file:///home/users/tmap/svn/repos/baker/trunk@23538 fdbf22ae-c210-0410-be80-ca943da6b8f8 --- .../ferret/scripts/LAS_setup_dsg.jnl | 26 +- .../Plot_insitu_XY_locations_and_values.jnl | 18 +- .../ferret/scripts/Plot_points_xy.jnl | 269 ++++++++++++++++++ .../ferret/scripts/dsg_find_roles.jnl | 15 +- .../feature_initialize_data_insitu.jnl | 11 +- .../scripts/feature_initialize_vars.jnl | 6 +- .../ferret/scripts/feature_labels.jnl | 10 + .../ferret/scripts/setup_dsg_variables.jnl | 6 +- .../ferret/scripts/setup_prop_prop.jnl | 22 +- 9 files changed, 351 insertions(+), 32 deletions(-) create mode 100644 JavaSource/resources/ferret/scripts/Plot_points_xy.jnl diff --git a/JavaSource/resources/ferret/scripts/LAS_setup_dsg.jnl b/JavaSource/resources/ferret/scripts/LAS_setup_dsg.jnl index 189b23214..d267858fa 100644 --- a/JavaSource/resources/ferret/scripts/LAS_setup_dsg.jnl +++ b/JavaSource/resources/ferret/scripts/LAS_setup_dsg.jnl @@ -1,4 +1,6 @@ ! LAS_setup_dsg.jnl +4/3/2017 *acm* Additions for point data types + SAY _________________ START LAS_setup_dsg: clock seconds: ($clock_secs) LET global_attnames = ..attnames @@ -20,25 +22,27 @@ ENDIF ! Find the featureType attribute, and find which variables ! are marked with the cf_role and sample_dimension attributes - - +! Have we already found these? IF `( ($feature_variable"0|*>1") GT 0) AND ( ($rowvar"0|*>1") GT 0)` THEN EXIT/SCRIPT IF `IS_ELEMENT_OF_STR_N(global_attnames, "featureType") ` THEN DEFINE SYMBOL feature_type = `..featureType` IF ($ferret_feature_label"0|*>1") THEN DEFINE SYMBOL feature_type = ($ferret_feature_label) DEFINE SYMBOL feature_type = `DNCASE("($feature_type)")` - - REPEAT/RANGE=1:`nvars`/name=q (\ - DEF SYM q = `q`;\ - DEF SYM vname = `varnames[i=($q)]`;\ - GO dsg_find_roles;\ - IF `STRCMP("($data_($num)_var)", "($feature_variable)") EQ 0` THEN \ - DEFINE SYMBOL ferret_plot_title = ($feature_variable) ID;\ - IF `( ($feature_variable"0|*>1") GT 0) AND ( ($rowvar"0|*>1") GT 0)` THEN EXIT/LOOP\ - ) ENDIF +! cf_role and sample_dimension are not included in DSG point datasets. + +IF ($feature_type"0|point>1|*>0") THEN EXIT/SCRIPT + +REPEAT/RANGE=1:`nvars`/name=q (\ + DEF SYM q = `q`;\ + DEF SYM vname = `varnames[i=($q)]`;\ + GO dsg_find_roles;\ + IF `STRCMP("($data_($num)_var)", "($feature_variable)") EQ 0` THEN \ + DEFINE SYMBOL ferret_plot_title = ($feature_variable) ID;\ + IF `( ($feature_variable"0|*>1") GT 0) AND ( ($rowvar"0|*>1") GT 0)` THEN EXIT/LOOP\ +) IF `($feature_variable"0|*>1") EQ 0` THEN LET ndims = ..ndims diff --git a/JavaSource/resources/ferret/scripts/Plot_insitu_XY_locations_and_values.jnl b/JavaSource/resources/ferret/scripts/Plot_insitu_XY_locations_and_values.jnl index 906b6ed95..4b3daa1ac 100644 --- a/JavaSource/resources/ferret/scripts/Plot_insitu_XY_locations_and_values.jnl +++ b/JavaSource/resources/ferret/scripts/Plot_insitu_XY_locations_and_values.jnl @@ -4,23 +4,19 @@ ! ! Set a couple of variables and call the script that does the work. -! 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 +! If it a database request, IF ($database_access_0_longitude"0|1|*>1) THEN -DEFINE SYMBOL data_0_x_var = ($database_access_0_longitude) + DEFINE SYMBOL data_0_x_var = ($database_access_0_longitude) ELSE -DEFINE SYMBOL data_0_x_var = ($tabledap_access_0_longitude) + DEFINE SYMBOL data_0_x_var = ($tabledap_access_0_longitude) ENDIF IF ($database_access_0_latitude"0|1|*>1) THEN -DEFINE SYMBOL data_0_y_var = ($database_access_0_latitude) + DEFINE SYMBOL data_0_y_var = ($database_access_0_latitude) ELSE -DEFINE SYMBOL data_0_y_var = ($tabledap_access_0_latitude) + DEFINE SYMBOL data_0_y_var = ($tabledap_access_0_latitude) ENDIF -!go xy_insitu_poly - -! Draw with a ribbon plot instead -go xy_insitu_plot +! Draw using a ribbon plot +go Plot_points_xy diff --git a/JavaSource/resources/ferret/scripts/Plot_points_xy.jnl b/JavaSource/resources/ferret/scripts/Plot_points_xy.jnl new file mode 100644 index 000000000..0942d0308 --- /dev/null +++ b/JavaSource/resources/ferret/scripts/Plot_points_xy.jnl @@ -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 diff --git a/JavaSource/resources/ferret/scripts/dsg_find_roles.jnl b/JavaSource/resources/ferret/scripts/dsg_find_roles.jnl index 81480dcdd..94d48603d 100644 --- a/JavaSource/resources/ferret/scripts/dsg_find_roles.jnl +++ b/JavaSource/resources/ferret/scripts/dsg_find_roles.jnl @@ -1,9 +1,11 @@ ! DSG_find_roles.jnl ! Find the Profile or Trajectory dimension and get its size ! Find the Obs dimension and get its size - +! 4/3/2017 *acm* Additions for point data types +! 4/3/2017 *acm* Handle datasets where dimensions are not also coordinate variables LET var_attnames = ($vname).attnames + IF `IS_ELEMENT_OF_STR(var_attnames, "cf_role")` THEN LET featureSize = `($vname),RETURN=msize` DEFINE SYMBOL feature_variable = ($vname) @@ -22,12 +24,17 @@ ENDIF ! We probably want to concoct names based on the location and time. ! Write a function to return the list for best flexibility. -IF `($feature_variable"0|*>1")` THEN -LET feature_name = ($feature_variable) +! Use ..coordnames for coordinate-variable namesinstead of ..dimnames. +! Some files have dimensions that are not coordinate variables. + + +IF `($feature_variable"0|*>1")` THEN + LET feature_name = ($feature_variable) + LET cnames = ..coordnames IF `STRINDEX("($feature_variable)", "(") GT 0` THEN - DEF SYM dname = `dimnames[i=($q)]` + DEF SYM dname = `cnames[i=($q)]` IF `($data_lon_var"0|*>1") + ($data_lat_var"0|*>1") + ($data_time_var"0|*>1") LT 3` THEN MESSAGE/ERROR **ERROR Did not find longitude, latitude and time variables in the dataset diff --git a/JavaSource/resources/ferret/scripts/feature_initialize_data_insitu.jnl b/JavaSource/resources/ferret/scripts/feature_initialize_data_insitu.jnl index 58301e27d..bab7a6132 100644 --- a/JavaSource/resources/ferret/scripts/feature_initialize_data_insitu.jnl +++ b/JavaSource/resources/ferret/scripts/feature_initialize_data_insitu.jnl @@ -5,6 +5,7 @@ ! Author: ansley ! 9/2012 (from Jons_initialize_data_insitu.jnl) ! 10/4/2016 fixes so init scripts still work +! 4/3/2017 *acm* Additions for point data types ! DEFINE SYMBOL num ($1"0") @@ -123,6 +124,13 @@ ENDIF ! Use the _CoordinateAxisType to define data_x_var, data_y_var, ! data_t_var if there is a time variable, data_z_var if there is depth. +IF ($feature_type"0|point>1|*>0") THEN + LET rowvar = x[gx=($DATA_VAR)] + DEFINE SYMBOL rowvar = rowvar + CANCEL SYMBOL its_trajectory_map + DEFINE SYMBOL its_point_map = 1 +ENDIF + IF `($data_x_var"0|*>1") EQ 0` THEN GO feature_lon_lat_time_depth DEFINE SYMBOL mark_end = ($data_var) @@ -144,8 +152,7 @@ IF `(($num)+1) eq ($data_count)` THEN ENDIF ! Make the RowSize and other metadata variables be on the E axis. - -IF ($rowvar"0|*>1") THEN +IF `($rowvar"0|*>1") AND ($feature_type"0|point>0|*>1")` THEN DEFINE SYMBOL rdir = `($rowvar),RETURN=shape` DEFINE SYMBOL rind = ($rdir"|X>I|E>M|POINT>M") LET setnum = `($rowvar),RETURN=dsetnum` diff --git a/JavaSource/resources/ferret/scripts/feature_initialize_vars.jnl b/JavaSource/resources/ferret/scripts/feature_initialize_vars.jnl index dcf04803e..02ce3c215 100644 --- a/JavaSource/resources/ferret/scripts/feature_initialize_vars.jnl +++ b/JavaSource/resources/ferret/scripts/feature_initialize_vars.jnl @@ -49,7 +49,8 @@ IF `($numobs) EQ 1` THEN LET feature_mask = 1 + 0*feature_numbers LET longest = 1 - LET data_var_c = EXPNDI_BY_Z_COUNTS(($data_var), XSEQUENCE(($rowvar)),`longest`) + LET ccarg = XSEQUENCE(($data_var)) + LET data_var_c = EXPNDI_BY_Z_COUNTS(ccarg, XSEQUENCE(($rowvar)),`longest`) LET feature_n = x[i=1:1] LET subset_mask = x[i=1:1] @@ -122,7 +123,8 @@ ELSE DEFINE SYMBOL feature_max = `nfeatures` LET longest = ($rowvar)[($rind)=@max]+2 - LET data_var_c = EXPNDI_BY_Z_COUNTS(($data_var), xsequence(($rowvar)),`longest`) + LET ccarg = XSEQUENCE(($data_var)) + LET data_var_c = EXPNDI_BY_Z_COUNTS(ccarg, xsequence(($rowvar)),`longest`) ! If a subset of feature ids is given then plot only those on a Prop/Prop ! plot, but using the symbols and colors as determined by the whole dataset. diff --git a/JavaSource/resources/ferret/scripts/feature_labels.jnl b/JavaSource/resources/ferret/scripts/feature_labels.jnl index 21b631287..3609128a6 100644 --- a/JavaSource/resources/ferret/scripts/feature_labels.jnl +++ b/JavaSource/resources/ferret/scripts/feature_labels.jnl @@ -6,6 +6,7 @@ ! and number of valid and missing points shown. ! On prop-prop plots, don't show missing. The count of missing-values in the ! data is not distinguishable from the missing data due to applying constraints. +! 4/3/2017 *acm* Additions for point data types ! If all labeling turned off just exit. IF `($ferret_label"1|0|1|*>1") EQ 0` THEN EXIT/SCRIPT @@ -13,6 +14,15 @@ IF `($ferret_label"1|0|1|*>1") EQ 0` THEN EXIT/SCRIPT ! If it is not a feature-type dataset, exit IF `($feature_type"0|*>1") EQ 0` THEN EXIT/SCRIPT + +IF ($feature_type"0|point>1|*>0") THEN + DEFINE SYMBOL note_num = `($note_num"0") + 1` + DEFINE SYMBOL note_($note_num)_lab = ($ngood_data) points shown + DEFINE SYMBOL plusmissing = (($nbad_data) missing) + IF ($nbad_data"0|0|*>1") THEN DEFINE SYMBOL note_($note_num)_lab = ($note_($note_num)_lab) ($plusmissing) + EXIT/SCRIPT +ENDIf + LET check_var = $1%XSEQUENCE(($ferret_plot_var))% DEFINE SYMBOL vtype = `check_var,return=dtype` IF ($vtype"0|char>1|*>0) THEN LET check_var = ($ferret_plot_var_2"($data_x_var%1%)") diff --git a/JavaSource/resources/ferret/scripts/setup_dsg_variables.jnl b/JavaSource/resources/ferret/scripts/setup_dsg_variables.jnl index 023e0394a..6a48169ee 100644 --- a/JavaSource/resources/ferret/scripts/setup_dsg_variables.jnl +++ b/JavaSource/resources/ferret/scripts/setup_dsg_variables.jnl @@ -8,6 +8,7 @@ ! 8/2016 *acm* If the Ferret property traj_discrete has been set, check ! whether the distance between points is large; if so plot as discrete ! points connected with a thin line. +! 4/3/2017 *acm* Additions for point data types IF `($rowvar"0|*>1") EQ 0` THEN EXIT/SCRIPT @@ -17,8 +18,9 @@ IF `($data_y_var_in"0|*>1") EQ 0` THEN DEFINE SYMBOL data_y_var_in = ($data_y_va IF `($data_t_var_in"0|*>1") EQ 0` THEN DEFINE SYMBOL data_t_var_in = ($data_t_var) DEFINE SYMBOL nfeatures = `($rowvar),RETURN=msize` +IF ($feature_type"0|point>1|*>0") THEN DEFINE SYMBOL nfeatures = 0 -IF ($nfeatures"0|*>1") THEN +IF ($nfeatures"0|0|*>1") THEN LET mmax = `($rowvar)[m=1:($nfeatures)@sum]` ! 1st m cruises LET npts = mmax ELSE @@ -50,6 +52,8 @@ IF `IS_ELEMENT_OF_STR(varnames, "time") GT 0` THEN set att/like=time time_with_g IF ($data_z_var"0|*>1") THEN LET vert_with_gaps = ($data_z_var) +IF ($feature_type"0|point>1|*>0") THEN EXIT/SCRIPT + ! Function separate puts gaps between cruises and also removes jumps in longitude ! where it crosses the dateline. Set ngood and nbad before adding these gaps. ! Prop-prop plots compute ngood elsewhere, taking into account constraints. diff --git a/JavaSource/resources/ferret/scripts/setup_prop_prop.jnl b/JavaSource/resources/ferret/scripts/setup_prop_prop.jnl index 114fe92f4..07bbb2ffb 100644 --- a/JavaSource/resources/ferret/scripts/setup_prop_prop.jnl +++ b/JavaSource/resources/ferret/scripts/setup_prop_prop.jnl @@ -254,8 +254,13 @@ IF `($data_count"0") GE 3` THEN ! color by 3rd variable DEFINE SYMBOL ferret_plot_var_2 = ($($fer_sym)_var) DEFINE SYMBOL ferret_plot_var = ($($fer_sym)_var) + + + + LET/TITLE="($ferret_title_2)" zvar = XSEQUENCE(($ferret_plot_var_2)) + ! Is it a varible on the E axis of a DSG file? DEFINE SYMBOL vshape = `($ferret_plot_var_2),RETURN=shape` @@ -283,7 +288,22 @@ IF `($data_count"0") GE 3` THEN ! color by 3rd variable LET zvar = EXPND_BY_LEN(($ferret_plot_var_2), ($rowvar),`($rowvar)[m=@sum]`) ENDIF - ENDIF + ELSE + +! Check the data type of other color-by variables. + + LET gettype= ($ferret_plot_var_2) + DEFINE SYMBOL vtype = `gettype,RETURN=dtype` + DEFINE SYMBOL is_string = ($vtype"0|CHAR>1|*>0") + + IF ($is_string) THEN + LET zvar = 1./0 + 0*xvar + DEFINE SYMBOL note_num = `($note_num"0") + 1` + DEFINE SYMBOL note_($note_num)_lab = ($data_2_title) is not numeric. Plot without color. + CANCEL SYMBOL ferret_plot_var + ENDIF + + ! what about woce flags?? DEFINE SYMBOL zvar = zvar