default_paths.pl
author A.M. Thurnherr <athurnherr@yahoo.com>
Thu, 12 May 2016 10:54:28 -0400
changeset 44 515c353a31bd
parent 42 f7690c7b92e0
child 45 6d49c7420a6c
permissions -rw-r--r--
V1.2

#======================================================================
#                    D E F A U L T _ P A T H S . P L 
#                    doc: Tue Mar 29 07:09:52 2016
#                    dlm: Tue Mar 29 13:47:24 2016
#                    (c) 2016 A.M. Thurnherr
#                    uE-Info: 11 0 NIL 0 0 72 0 2 4 NIL ofnI
#======================================================================

# HISTORY:
#	Mar 29, 2016: - split from [defaults.pl]

#======================================================================
# ProcessingParams file selection
#======================================================================

if (-r "ProcessingParams.$RUN") {
	$processing_param_file = "ProcessingParams.$RUN";
} elsif (-r "ProcessingParams.default") {
	$processing_param_file = "ProcessingParams.default";
} elsif (-r "ProcessingParams") {
	$processing_param_file = "ProcessingParams";
} else {
	error("$0: cannot find either <ProcessingParams.$RUN> or <ProcessingParams[.default]>\n");
}

#======================================================================
# Output
#======================================================================

# The "base name" of all output files (usually 0-padded 3-digits)

$out_basename = sprintf('%03d',$PROF);


# Output subdirectories
#	these are automatically created as long as they don't contain a "/"

$data_dir = $plot_dir = $log_dir = $RUN;
unless (-d $data_dir) {
	unless ($data_dir =~ m{/}) {
		warning(0,"Creating data sub-directory ./$data_dir\n");
		mkdir($data_dir);
	}
	error("$data_dir: no such directory\n") unless (-d $data_dir);
}
unless (-d $plot_dir) { 										    
	unless ($plot_dir =~ m{/}) {
		warning(0,"Creating plot sub-directory ./$plot_dir\n");
		mkdir($plot_dir);
	}
	error("$plot_dir: no such directory\n") unless (-d $plot_dir);
}
unless (-d $log_dir) {
	unless ($log_dir =~ m{/}) {
		warning(0,"Creating log-file sub-directory ./$log_dir\n");
		mkdir($log_dir);
	}
	error("$log_dir: no such directory\n") unless (-d $log_dir);
}
           

#----------------------------------------------------------------------
# Processing log (diagnostic messages) output
#----------------------------------------------------------------------

$out_log = "$log_dir/$out_basename.log";


#----------------------------------------------------------------------
# Vertical-velocity profile output and plots:
#
# Data:
#	*.wprof				vertical velocity profiles
#
# Plots:
# 	*_wprof.ps			vertical velocity profiles (main output plot)
#----------------------------------------------------------------------

@out_profile = ("plot_wprof($plot_dir/${out_basename}_wprof.ps)",
			    "$data_dir/$out_basename.wprof");


#----------------------------------------------------------------------
# Vertical-velocity sample data output and plots:
#
# Data (in $data_dir):
#	*.wsamp							w sample data
#	residuals/<prof>/<ens>.rprof	OPTIONAL: per-ensemble residuals
#						
# Plots (in $plot_dir):
#	*_wsamp.ps						vertical velocity time-depth plot
#	*_residuals.ps					residual vertical velocity time-depth plot
#	*_backscatter.ps				volume scattering coefficient time-depth plot
#	*_correlation.ps				OPTIONAL: correlation time-depth plot
#----------------------------------------------------------------------

push(@out_wsamp,"$data_dir/$out_basename.wsamp");
#push(@out_wsamp,sprintf('dump_residual_profiles(%s/residuals/%03d)',$data_dir,$PROF));

push(@out_wsamp,"plot_residuals($plot_dir/${out_basename}_residuals.ps)");
push(@out_wsamp,"plot_backscatter($plot_dir/${out_basename}_backscatter.ps)");
push(@out_wsamp,"plot_wsamp($plot_dir/${out_basename}_wsamp.ps)");
#push(@out_wsamp,"plot_correlation($plot_dir/${out_basename}_correlation.ps)");


#----------------------------------------------------------------------
# Time-series output
#
#	*.tis			combined CTD/LADCP time-series data, including 
#					package- and LADCP reference layer w
#----------------------------------------------------------------------

@out_timeseries = ("$data_dir/$out_basename.tis");

#----------------------------------------------------------------------
# Per-bin vertical-velocity residuals (plot only)
#----------------------------------------------------------------------

@out_BR	= ("plot_mean_residuals($plot_dir/${out_basename}_mean_residuals.ps)");


#----------------------------------------------------------------------
# Time-lagging correlation statistics (plot only)
#----------------------------------------------------------------------

@out_TL = ("plot_time_lags($plot_dir/${out_basename}_time_lags.ps)");

1;	# return true