Index: /branches/eam_branches/ipp-20150405/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- /branches/eam_branches/ipp-20150405/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 38152)
@@ -411,12 +411,10 @@
     my $release_args;
     if (($req_type eq 'byexp' and $stage ne 'raw') or ($req_type eq 'byskycell' and $stage ne 'diff')) {
-        # XXX: Think hard before committing the change to use releasetool for byexp requests regardless.
-        # XXX: using releasetool by default for byexp requests will break for nightly data when 
-        # the release table survey task breaks.
-        # (MOPS one off requests for last night's data)
-        # we could fall back and do the old style lookup in that case.
-        # Need to fix the duplicate camRun problem.
-        my $force_releasetool_for_byexp = 0;
-        if ($release_name or $survey or ($force_releasetool_for_byexp and ($req_type eq 'byexp'))) {
+        # we use releasetool for lookups if we get here and have a survey or release specfied and
+        # the survey is not 'bypass' 
+        # That is a hook to allow sophisticated users to bypass the release mechanisms. Useful for
+        # MOPS which is interested primarily in nightly data and wants to get their data immediately
+        # without regard to timeleness of the relexp tables
+        if ($release_name or ($survey and $survey ne 'bypass')) {  
             $use_releasetool = 1;
             if ($release_name) {
@@ -579,5 +577,10 @@
         # $cmf_name    = "PSPHOT.OUTPUT";    # this puts .fpa. in the name
         $psf_name    = "PPSTACK.TARGET.PSF";
+        # XXX TODO should we filter stacks so that only one per skycell/filter combintation is returned for
+        # most requests. Currently unless a release is provided all that match are returned.
+        # Actually maybe that is the right answer. User's simply need to specify a release value
+        # if that is all that they want.
     } else {
+        # this should have been caught before we get here.
         die "Unknown IMG_TYPE supplied: $stage";
     }
@@ -615,4 +618,5 @@
         $command .= " -dateobs_end $dateobs_end" if $dateobs_end;
     } elsif ($req_type ne "byid") {
+        # stacks
         $command .= " -mjd_obs_begin $mjd_min" if $mjd_min;
         $command .= " -mjd_obs_end $mjd_max" if $mjd_max;
Index: /branches/eam_branches/ipp-20150405/dbconfig/changes.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/dbconfig/changes.txt	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/dbconfig/changes.txt	(revision 38152)
@@ -2526,5 +2526,5 @@
 --
 
-UPDATE dbversion set schema_version = '1.1.80, updated= CURRENT_TIMESTAMP();
+UPDATE dbversion set schema_version = '1.1.80', updated= CURRENT_TIMESTAMP();
 ALTER TABLE remoteComponent ADD COLUMN jobs INT after stage_id;
 ALTER TABLE remoteComponent ADD COLUMN state VARCHAR(64) NOT NULL after jobs;
Index: /branches/eam_branches/ipp-20150405/ippScripts/Build.PL
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/Build.PL	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/Build.PL	(revision 38152)
@@ -128,4 +128,5 @@
         scripts/diffphot.pl
         scripts/lap_science.pl
+        scripts/lap_queue_diff.pl
         scripts/videophot_process.pl
         scripts/listvideocells.pl
@@ -139,8 +140,10 @@
         scripts/sc_mk_stack_mdc.pl
         scripts/sc_mk_staticsky_mdc.pl
+        scripts/sc_check_diff.pl
         scripts/sc_prepare_camera.pl
         scripts/sc_prepare_chip.pl
         scripts/sc_prepare_stack.pl
         scripts/sc_prepare_staticsky.pl
+        scripts/sc_prepare_diff.pl
         scripts/sc_prepare_warp.pl
         scripts/sc_prepare_run.pl
Index: /branches/eam_branches/ipp-20150405/ippScripts/MANIFEST
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/MANIFEST	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/MANIFEST	(revision 38152)
@@ -49,11 +49,14 @@
 scripts/skycell_jpeg.pl
 scripts/lap_science.pl
+scripts/lap_queue_diff.pl
 scripts/regenerate_background.pl
 scripts/sc_mk_stack_mdc.pl
 scripts/sc_mk_staticsky_mdc.pl
+scripts/sc_check_diff.pl
 scripts/sc_prepare_camera.pl
 scripts/sc_prepare_chip.pl
 scripts/sc_prepare_stack.pl
 scripts/sc_prepare_staticsky.pl
+scripts/sc_prepare_diff.pl
 scripts/sc_prepare_warp.pl
 scripts/sc_remote_exec.pl
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/addstar_run.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/addstar_run.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/addstar_run.pl	(revision 38152)
@@ -102,4 +102,8 @@
 
 if ($stage =~/fullforce/) {
+    $reduction='DEFAULT';
+    #hardwired because why not
+}
+if ($stage =~/diff/) {
     $reduction='DEFAULT';
     #hardwired because why not
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/lap_queue_diff.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/lap_queue_diff.pl	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/lap_queue_diff.pl	(revision 38152)
@@ -0,0 +1,310 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+use Carp;
+use IPC::Cmd 0.36 qw( can_run run);
+use PS::IPP::Metadata::List qw( parse_md_list );
+use PS::IPP::Config 1.01 qw( :standard );
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
+use DateTime;
+
+
+my $missing_tools = 0;
+
+my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
+my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1);
+my $laptool  = can_run('laptool') or (warn "Can't find laptool" and $missing_tools = 1);
+if ($missing_tools) {
+    warn("Can't find required tools.");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+
+
+my ( $help, $verbose, $debug, $do_nothing);
+my ( $camera, $dbname);
+my ( $lap_id );
+my ( $queue_list );
+
+GetOptions(
+    'help|h'       => \$help,
+    'verbose'      => \$verbose,
+    'debug'        => \$debug,
+    'do_nothing'   => \$do_nothing,
+
+    'camera=s'     => \$camera,
+    'dbname=s'     => \$dbname,
+    
+    'lap_id=s'     => \$lap_id,
+    'queue_list=s' => \$queue_list,
+    ) or pod2usage ( 2 );
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage(
+    -msg => "--lap_id is required",
+    -exitval => 3,
+    ) unless
+    defined $lap_id;
+
+unless (defined $dbname) {
+    $dbname = 'gpc1';
+}
+
+my $mdcParser = PS::IPP::Metadata::Config->new;
+
+log_message("Startup");
+
+my %lapRunInfo = get_lapRun_info($lap_id);
+unless (($lapRunInfo{state} eq 'full')||
+	($lapRunInfo{state} eq 'done')) {
+    &my_die("Cannot run diff_mode if lapRun != full!", $lap_id);
+}
+my $label = $lapRunInfo{label};
+log_message("Have lapRun info");
+
+my %projcell_done = ();
+&get_completed_projcells($label);
+log_message("Have completed projcells");
+
+my %projcell_todo = ();
+&get_projcell_set();
+log_message("Have projcells todo");
+
+my $Nexp = 0;
+my $Ndiff= 0;
+my $lapExp = get_lapExp_info($lap_id);
+foreach my $exp (@{ $lapExp }) {
+    log_message("  Exp " . $exp->{exp_id});
+    $Nexp++;
+    if ($exp->{data_state} eq 'full') {
+	my $warp_id = get_warp_id($exp->{exp_id},$exp->{chip_id});
+	my @warp_proj_cells = get_warp_projcells($warp_id);
+	my $can_diff = check_diff_existance($warp_id,$label);
+	if ($can_diff) {
+	    foreach my $pc (@warp_proj_cells) {
+		if (exists($projcell_todo{$pc})) { # We plan on doing this projection cell
+		    unless (exists($projcell_done{$pc})) { # But we haven't done it?
+			$can_diff = 0;
+		    }
+		}
+	    }
+	    if ($can_diff == 1) {
+		# This needs a check to ensure it hasn't been done yet.
+		my $diff_id = &launch_diff($warp_id);
+		print "Made diff for $warp_id => $diff_id\n";
+		$Ndiff++;
+	    }
+	}
+	log_message("  Diff? $can_diff");
+    }
+}
+print "LAP_ID: $lap_id\n";
+print "NEXP:   $Nexp\n";
+print "NDIFF:  $Ndiff\n";
+
+
+
+sub log_message {
+    my $message = shift;
+    if ($verbose) {
+	print "$message\n";
+    }
+}
+
+sub get_lapRun_info {
+    my $lap_id = shift;
+    my $command = "$laptool -pendingrun -lap_id $lap_id";
+    $command .= " -dbname $dbname " if defined $dbname;
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id);
+    }
+    my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id);
+    # There should be only one.
+    my $Run = ${ $Runs }[0];
+    my %info = %{ $Run };
+    return(%info);
+}
+
+sub get_lapExp_info {
+    my $lap_id = shift;
+    my $command = "$laptool -exposures -lap_id $lap_id";
+    $command .= " -dbname $dbname" if defined $dbname;
+
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform laptool -exposures: $error_code", $lap_id);
+    }
+    
+    if (@$stdout_buf == 0) {
+        # Nothing to do. However, this is likely an error.
+        return(0);
+    }
+    
+    my $exposures = $mdcParser->parse_list(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata from laptool -exposures", $lap_id);
+    return($exposures); # This is a pointer to an array of hashes.
+}
+
+sub get_completed_projcells {
+    my $label = shift;
+    my $command = "$laptool -listrun -label ${label} -state done ";
+    $command .= " -dbname $dbname " if defined $dbname;
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id);
+    }
+    my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id);
+    foreach my $r (@{ $Runs }) {
+	$projcell_done{$r->{projection_cell}} = 1;
+    }
+}
+
+sub get_projcell_set {
+    open(Q,$queue_list) or &my_die("Cannot open queue list $queue_list",$lap_id);
+    while(<Q>) {
+	chomp;
+	my $cmd = $_;
+	my $projection_cell = $cmd;
+	$projection_cell =~ s/.*?-projection_cell (skycell.\w+?) .*/$1/;
+	$projcell_todo{$projection_cell} = 1;
+    }
+    close(Q);
+}
+
+sub get_warp_id {
+    my $exp_id = shift;
+    my $chip_id = shift;
+
+    my $warptool_info_cmd = "$warptool -listrun -exp_id $exp_id -chip_id $chip_id";
+    $warptool_info_cmd   .= " -dbname $dbname " if defined $dbname;
+    
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	run(command => $warptool_info_cmd, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform warptool -listrun: $error_code", $exp_id);
+    }
+    my $warps = $mdcParser->parse_list(join "", @$stdout_buf) or
+	&my_die("Unable to parse metadata from warptool -listrun", $exp_id);
+    # There should be only one.
+    my $warp = ${ $warps }[0];
+    my $warp_id = 0;
+    if ($warp) {
+	$warp_id = $warp->{warp_id};
+    }
+    if ($warp_id == 0) {
+	&my_die("Unable to find warp_id",$exp_id);
+    }
+    return($warp_id);
+}
+
+
+sub get_warp_projcells {
+    my $warp_id = shift;
+    my %proj_cell_list = ();
+    my $command = "$warptool -warped -warp_id ${warp_id}";
+    $command .= " -dbname $dbname " if defined $dbname;
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id);
+    }
+    my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id);
+    foreach my $r (@{ $Runs }) {
+	my $projcell = $r->{skycell_id};
+	$projcell =~ s/\.\d\d\d$//;
+	$proj_cell_list{$projcell} = 1;
+    }
+    return(keys(%proj_cell_list));
+}
+    
+sub check_diff_existance {
+    my $warp_id = shift;
+    my $label   = shift;
+    my $command = "$difftool -listrun -warp_id ${warp_id} -label ${label}";
+    $command .= " -dbname $dbname " if defined $dbname;
+    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id);
+    }
+    my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id);
+    my $N = $#{ $Runs } + 1;
+    if ($N == 0) {
+	return(1);
+    }
+    else {
+	return(0);
+    }
+}
+
+sub launch_diff {
+    my $warp_id = shift;
+    my $label = shift;
+    if (($debug)||($do_nothing)) {
+	return(99);
+    }
+    else {
+	my $command = "$difftool -definewarpstack -available -bothways -good_frac 0.2 ";
+	$command   .= " -warp_label $label -stack_label $label -set_label $label ";
+	$command   .= " -set_data_group ${label}.";
+	$command   .= " -set_workdir neb://@HOST@.0/gpc1/LAP.PV3.20140730/diff01.20150311/ ";
+	$command   .= " -set_reduction WARPSTACK_PV3 ";
+	$command   .= " -warp_id ${warp_id} ";
+	$command .= " -dbname $dbname " if defined $dbname;
+	my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => $verbose);
+	unless ($success) {
+	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	    &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id);
+	}
+	my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id);
+	if ($#{ $Runs } != 0) {
+	    print "Something has gone seriously wrong, and we've made more than one diff for warp_id $warp_id\n";
+	}
+	my $Run = ${ $Runs }[0];
+	my $diff_id = $Run->{diff_id};
+	return($diff_id);
+    }
+}
+
+#
+# Utilities
+################################################################################
+
+sub my_die {
+    my $msg = shift; # Warning message on die
+    my $lap_id = shift; # identifier
+    my $optional = shift;
+    my $exit_code = shift;
+    unless (defined $exit_code) {
+        $exit_code = $PS_EXIT_PROG_ERROR;
+    }
+    carp($msg);
+    exit $exit_code;
+}
+
+# Check to see if a 64bit integer is NULL or not.  This is probably fragile, but I don't know how to get a S64 NULL out.
+sub S64_IS_NOT_NULL {
+    if ($_[0] == 9223372036854775807) {
+        return(0);
+    }
+    else {
+        return(1);
+    }
+}
+
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_check_diff.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_check_diff.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_check_diff.pl	(revision 38152)
@@ -35,7 +35,8 @@
 
     if ($error != 0) {
-	open(DB,"${out_path_base}.dbinfo");
+	open(DB,">${out_path_base}.dbinfo");
 	print DB "difftool -adddiffskyfile -diff_id ${diff_id} -skycell_id ${skycell_id} -dbname ${dbname} -quality 4242\n";
 	close(DB);
+	print "Failed to find required file $file for $diff_id $skycell_id\n";
 	exit(1);
     }
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_camera.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_camera.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_camera.pl	(revision 38152)
@@ -91,6 +91,6 @@
 {
 
+###    $command    = "$camtool -processedexp -cam_id $cam_id "; ### THIS LINE ONLY TO TEST!  
     my $command = "$camtool -pendingexp -cam_id $cam_id ";
-    $command    = "$camtool -processedexp -cam_id $cam_id "; ### THIS LINE ONLY TO TEST!  
     $command   .= " -dbname $dbname " if defined($dbname);
 
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_diff.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_diff.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_diff.pl	(revision 38152)
@@ -59,5 +59,5 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
-my @return_component_list = ("DBINFO.EXP", "PPSUB.CONFIG", "LOG.EXP",
+my @return_component_list = ("DBINFO.EXP", "PPSUB.CONFIG", "LOG.EXP","TRACE.EXP","SKYCELL.STATS","PPSUB.OUTPUT.KERNELS",
 			     "PPSUB.OUTPUT.SOURCES", "PPSUB.INVERSE.SOURCES",
 			     "PSPHOT.BACKMDL.MEF", "PSPHOT.PSF.SKY.SAVE");
@@ -145,10 +145,10 @@
 
 
-    my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB');
-    my $recipe_psphot= $ipprc->reduction($reduction, 'DIFF_PSPHOT');
+#    my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB');
+#    my $recipe_psphot= $ipprc->reduction($reduction, 'DIFF_PSPHOT');
 #    my $recipe_ppstats= 'DIFFSTATS';
-    &my_die("Unable to find recipes for reduction $reduction",
-	    $remote_id, $diff_id, $PS_EXIT_CONFIG_ERROR, $fail_state) 
-	unless ((defined($recipe_ppSub))&&(defined($recipe_psphot)));
+#     &my_die("Unable to find recipes for reduction $reduction",
+# 	    $remote_id, $diff_id, $PS_EXIT_CONFIG_ERROR, $fail_state) 
+# 	unless ((defined($recipe_ppSub))&&(defined($recipe_psphot)));
 
 
@@ -197,7 +197,13 @@
 	my $remote_templwt    = &uri_local_to_remote($ipp_templwt);
 	my $remote_templsourc = &uri_local_to_remote($ipp_templsourc);
-
-
-	# Conver these here
+	
+	my $pre_command     = " sc_check_diff.pl --diff_id ${diff_id} --skycell_id ${skycell_id} --dbname ${dbname} --out_path_base ${remote_outroot} $remote_inimage $remote_inmask $remote_inwt $remote_insourc $remote_templimage $remote_templmask $remote_templwt $remote_templsourc ";
+
+	# make any directory we may need
+        my $remote_outroot_dir = dirname($remote_outroot);
+        my $dir_command =  "mkdir -p $remote_outroot_dir";
+
+
+	# Convert these here
         my $psdiff_command  = " ppSub ${remote_outroot} ";
         $psdiff_command    .= " -inimage $remote_inimage -refimage $remote_templimage ";
@@ -208,6 +214,6 @@
         $psdiff_command    .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF ";
         $psdiff_command    .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF ";
-        $psdiff_command    .= " -recipe PPSUB $recipe_ppSub ";
-        $psdiff_command    .= " -recipe PSPHOT $recipe_psphot ";
+        $psdiff_command    .= " -recipe PPSUB WARPSTACK_PV3 ";
+        $psdiff_command    .= " -recipe PSPHOT DIFF_PV3 ";
         $psdiff_command    .= " -recipe PPSTATS DIFFSTATS ";
         $psdiff_command    .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
@@ -215,5 +221,5 @@
         $psdiff_command    .= " -recipe PPSTATS DIFFSTATS ";
         $psdiff_command    .= " -dumpconfig ${remote_outroot}.ppSub.mdc -stats ${remote_outroot}.stats ";
-	$psdiff_command    .= " -save-inconv "; # I guess?
+#	$psdiff_command    .= " -save-inconv "; # I guess? Nope.  It makes images we don't plan to transfer back.
 	$psdiff_command    .= " -photometry -inverse ";
 	$psdiff_command    .= " -image_id $diff_skyfile_id "; # I have no clue what this does.
@@ -228,5 +234,5 @@
         my $post_cmd_SfM  = " ppStatsFromMetadata ${remote_outroot}.stats - DIFF_SKYCELL >> ${remote_outroot}.dbinfo ";
 
-        print CONFIG " ${psdiff_command} && ${post_cmd_echo} && ${post_cmd_SfM} ";
+        print CONFIG " ${dir_command} && ${pre_command} && ${psdiff_command} && ${post_cmd_echo} && ${post_cmd_SfM} ";
         $job_index++;
 
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_ff.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_ff.pl	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_ff.pl	(revision 38152)
@@ -0,0 +1,292 @@
+#! /usr/bin/env perl
+
+# generate the input & output files lists and commands for a single ffRun
+
+use Carp;
+use warnings;
+use strict;
+
+use IPC::Cmd 0.36 qw( can_run run );
+use PS::IPP::Metadata::Config;
+use PS::IPP::Metadata::List qw( parse_md_list );
+use PS::IPP::Config 1.01 qw( :standard );
+use DateTime;
+use Data::Dumper;
+use File::Basename;
+
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
+
+# Hard coded values
+# my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
+my $remote_root     = '/scratch3/watersc1/';
+my $remote_hostname = "LANL/Mustang";         # Name of the remote node.
+my $threads_req     = 4;                      # How many threads are we going to use?
+
+my $fail_state = "prep_fail";
+
+# Look for programs we need
+my $missing_tools;
+my $remotetool = can_run('remotetool') or (warn "Can't find remotetool" and $missing_tools = 1);
+my $fftool    = can_run('fftool') or (warn "Can't find fftool" and $missing_tools = 1);
+
+if ($missing_tools) {
+    warn("Can't find required tools.");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+
+my ($remote_id,$ff_id,$camera,$dbname,$verbose,$path_base,$no_update);
+GetOptions(
+    'remote_id=s'    => \$remote_id,
+    'ff_id=s'      => \$ff_id,
+    'camera|c=s'     => \$camera,
+    'dbname|d=s'     => \$dbname,
+    'path_base=s'    => \$path_base,
+    'no_update'      => \$no_update,
+    'verbose'        => \$verbose,
+    ) or pod2usage( 2 );
+
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage( -msg => "Required options: --remote_id -ff_id --camera --dbname --path_base", -exitval => 3) unless
+    defined($remote_id) and
+    defined($ff_id) and
+    defined($camera) and
+    defined($path_base) and
+    defined($dbname);
+
+my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id, $ff_id, $PS_EXIT_CONFIG_ERROR, $fail_state);
+
+my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
+
+my @return_component_list = ("DBINFO.EXP","LOG.EXP","SKYCELL.STATS","TRACE.EXP",
+			     "PSPHOT.OUT.CMF.MEF","PSPHOT.SKY.CONFIG");
+
+
+# STEP 0: Open output files
+my $uri_transfer= $path_base . ".transfer";
+my $uri_check   = $path_base . ".check";
+my $uri_config  = $path_base . ".config";
+my $uri_generate= $path_base . ".generate";
+my $uri_return  = $path_base . ".return";
+
+my $disk_transfer= $ipprc->file_resolve($uri_transfer,1);
+my $disk_check   = $ipprc->file_resolve($uri_check,1);
+my $disk_config  = $ipprc->file_resolve($uri_config,1);
+my $disk_generate= $ipprc->file_resolve($uri_generate,1);
+my $disk_return  = $ipprc->file_resolve($uri_return,1);
+
+my (undef, $remote_config) = &uri_convert($uri_config); # Needs to be done after we've created it.
+
+open(TRANSFER, ">$disk_transfer")  || &my_die("Couldn't open file? $disk_transfer",$remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+open(CHECK,    ">$disk_check")     || &my_die("Couldn't open file? $disk_check",   $remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+open(CONFIG,   ">$disk_config")    || &my_die("Couldn't open file? $disk_config",  $remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+open(GENERATE, ">$disk_generate")  || &my_die("Couldn't open file? $disk_generate",$remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+open(RETURN,   ">$disk_return")    || &my_die("Couldn't open file? $disk_return",  $remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+
+my $job_index = 0;
+
+# STEP 1: Get exposure level information from the ffRun we're working from.
+my ($ffRun);
+{
+    # Get the Run level information first.
+    my $command = "$fftool -todo -ff_id $ff_id ";
+    $command   .= " -dbname $dbname " if defined($dbname);
+
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to run fftool -todo ", $remote_id, $ff_id, $error_code, $fail_state);
+    }
+
+    my $MDlist = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to determine ff run information.", $remote_id, $ff_id, $PS_EXIT_PROG_ERROR, $fail_state);
+    $ffRun = parse_md_list($MDlist);
+}
+
+# STEP 2: Iterate over the sub-components
+{
+    foreach my $ffRun_entry (@{ $ffRun }) {
+	my $skycell_id = $ffRun_entry->{skycell_id};
+	my $tess_id    = $ffRun_entry->{tess_id};
+	my $workdir    = $ffRun_entry->{workdir};
+	my $warp_id    = $ffRun_entry->{warp_id};
+	my $source_pb  = $ffRun_entry->{sources_path_base};
+	my $warp_pb    = $ffRun_entry->{warp_path_base};
+	my $reduction  = $ffRun_entry->{reduction};
+	my $camera     = $ffRun_entry->{camera};
+	
+	my $ipp_outroot    = sprintf("%s/%s/%s/%s.%s.wrp.%s.ff.%s",$workdir,$tess_id,$skycell_id,$tess_id,$skycell_id,$warp_id,$ff_id);
+        print "$ipp_outroot\n";
+        my $remote_outroot = &uri_local_to_remote($ipp_outroot);
+
+	my $ipp_inimage = $ipprc->filename("PSWARP.OUTPUT",$warp_pb);
+	my $ipp_inmask  = $ipprc->filename("PSWARP.OUTPUT.MASK",$warp_pb);
+	my $ipp_inwt    = $ipprc->filename("PSWARP.OUTPUT.VARIANCE",$warp_pb);
+	my $ipp_insourc = $ipprc->filename("PSPHOT.OUTPUT.CFF",$source_pb);
+
+	my ($ipp_disk_inimage, $remote_inimage) = &uri_to_outputs($ipp_inimage);
+	my ($ipp_disk_inmask, $remote_inmask)  = &uri_to_outputs($ipp_inmask);
+	my ($ipp_disk_inwt, $remote_inwt)    = &uri_to_outputs($ipp_inwt);
+	my ($ipp_disk_insourc, $remote_insourc) = &uri_to_outputs($ipp_insourc);
+
+	# make any directory we may need
+        my $remote_outroot_dir = dirname($remote_outroot);
+        my $dir_command =  "mkdir -p $remote_outroot_dir";
+
+	# Find the recipe
+	$reduction = 'DEFAULT' unless defined $reduction;
+	my $recipe_psphot  = $ipprc->reduction($reduction, 'FULLFORCE_PSPHOT'); # Recipe to use for psphot
+	unless ($recipe_psphot) {
+	    &my_die("Couldn't find selected reduction for PSPHOT: $reduction\n", 
+		    $remote_id,$ff_id,  $PS_EXIT_CONFIG_ERROR, $fail_state);
+	}
+
+
+	# Convert these here
+        my $psff_command  = " psphotFullForce ${remote_outroot} ";
+	$psff_command    .= " -force $remote_insourc ";
+        $psff_command    .= " -file $remote_inimage ";
+        $psff_command    .= " -mask $remote_inmask ";
+        $psff_command    .= " -variance $remote_inwt ";
+        $psff_command    .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE ";
+        $psff_command    .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF ";
+        $psff_command    .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF ";
+        $psff_command    .= " -recipe PSPHOT $recipe_psphot ";
+	$psff_command    .= " -photcode-rule '{DETECTOR}.{FILTER.ID}.ForcedWarp' ";
+        $psff_command    .= " -dumpconfig ${remote_outroot}.psphot.mdc -stats ${remote_outroot}.stats ";
+        $psff_command    .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
+        $psff_command    .= " -threads $threads_req "; # -image_id ${image_id} -source_id ${source_id} ";
+
+        my $post_cmd_echo = " echo -n \"fftool  -addresult -ff_id $ff_id -warp_id $warp_id ";
+        $post_cmd_echo   .=  " -dbname $dbname " if defined $dbname;
+#        $post_cmd_echo   .= " -uri ${ipp_outroot}.fits ";
+        $post_cmd_echo   .= " -path_base $ipp_outroot -hostname $remote_hostname -dtime_script 0 \" > ${remote_outroot}.dbinfo ";
+
+        my $post_cmd_SfM  = " ppStatsFromMetadata ${remote_outroot}.stats - WARP_SKYCELL >> ${remote_outroot}.dbinfo ";
+
+        print CONFIG " ${dir_command}  && ${psff_command} && ${post_cmd_echo} && ${post_cmd_SfM} ";
+        $job_index++;
+
+        # Determine which output files need to be returned
+        foreach my $component(@return_component_list) {
+            my $filename = $ipprc->filename($component,$ipp_outroot,$skycell_id);
+            my ($ipp_disk, $remote_disk) = &uri_to_outputs_for_return( $filename);
+            my $remote_outroot_dir = dirname($ipp_disk);
+            print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
+        }
+        print CONFIG "\n";
+#       die();
+    }
+}
+close(CONFIG);
+close(TRANSFER);
+close(CHECK);
+close(RETURN);
+close(GENERATE);
+
+unless($no_update) {
+    my $command = "remotetool -updatecomponent -remote_id $remote_id -stage_id $ff_id ";
+    $command .= " -set_jobs $job_index";
+    $command .= " -set_path_base $path_base";
+    $command .= " -set_state prep_done";
+    $command .= " -dbname $dbname " if defined $dbname;
+
+    system($command);
+}
+exit (0);
+
+## Common SC routines
+
+sub uri_convert { # (ipp_disk,remote_disk) = uri_convert(neb_uri);
+    my $neb_uri = shift;
+    my $ipp_disk= $ipprc->file_resolve( $neb_uri );
+    my $remote_disk = $ipp_disk;
+
+    unless(defined($ipp_disk)) {
+        &my_die( "Unable to generate file for $neb_uri ", $remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+    }
+
+    $remote_disk =~ s%^.*/%%;   # Remove nebulous path
+    $remote_disk =~ s%^\d+\.%%; # Remove ins_id
+    $remote_disk =~ s%:%/%g;    # Replace colons with directories
+    $remote_disk = "${remote_root}/${remote_disk}";
+    return($ipp_disk,$remote_disk);
+}
+
+sub uri_convert_and_create { # (ipp_disk,remote_disk) = uri_convert_and_create(neb_uri); ipp_disk is created if it doesn't exist
+    my $neb_uri = shift;
+    my $ipp_disk= $ipprc->file_resolve( $neb_uri , 1);
+    my $remote_disk = $ipp_disk;
+
+    unless(defined($ipp_disk)) {
+        &my_die( "Unable to generate file for $neb_uri ", $remote_id, $ff_id, $PS_EXIT_SYS_ERROR, $fail_state);
+    }
+
+    $remote_disk =~ s%^.*/%%;   # Remove nebulous path
+    $remote_disk =~ s%^\d+\.%%; # Remove ins_id
+    $remote_disk =~ s%:%/%g;    # Replace colons with directories
+    $remote_disk = "${remote_root}/${remote_disk}";
+    return($ipp_disk,$remote_disk);
+}
+
+sub uri_to_outputs { # (ipp_disk,remote_disk) = uri_to_output(neb_uri); Appends to TRANSFER and CHECK filehandles
+    my $neb_uri = shift;
+    my ($ipp_disk, $remote_disk) = &uri_convert( $neb_uri );
+
+    print TRANSFER "$ipp_disk\n";
+    print CHECK    "$remote_disk\n";
+    return($ipp_disk,$remote_disk);
+}
+
+sub uri_to_outputs_for_return { # (ipp_disk,remote_disk) = uri_to_outputs_for_return(neb_uri); create ipp_disk, append to RETURN and GENERATE
+    my $neb_uri = shift;
+    my ($ipp_disk, $remote_disk) = &uri_convert_and_create( $neb_uri );
+
+    print RETURN "$ipp_disk\n";
+    print GENERATE "$remote_disk\n";
+    return($ipp_disk,$remote_disk);
+}
+
+sub uri_local_to_remote { #(remote_uri) = uri_local_to_remote(local_neb_uri);
+    # This needs to replace the nebulous tag with the remote root.
+    my $local_uri = shift;
+    $local_uri =~ s%^.*?/%%; # neb:/
+    $local_uri =~ s%^.*?/%%; # /
+    $local_uri =~ s%^.*?/%%; # @HOST@.0/
+    my $remote_uri = "${remote_root}/" . $local_uri;
+
+    return($remote_uri);
+}
+
+sub uri_remote_to_local { #(local_neb_uri) = uri_remote_to_local(remote_uri);
+    # This needs to replace the remote root directory with the nebulous tag.
+    my $remote_uri = shift;
+    $remote_uri =~ s%${remote_root}%%;
+    my $local_uri  = "neb:///" . $remote_uri;
+
+    return($local_uri);
+}
+
+
+sub my_die { # exit with status; my_die(message,stage_id,exit_code,exit_status);
+    my $msg = shift;
+    my $remote_id  = shift;
+    my $stage_id  = shift;
+    my $exit_code = shift;
+    my $exit_state = shift;
+
+    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
+
+    carp($msg);
+
+    if (defined $remote_id and defined $stage_id and not $no_update) {
+        my $command = "remotetool -updatecomponent -remote_id $remote_id -stage_id $stage_id";
+        $command .= " -set_state $exit_state " if defined $exit_state;
+        $command .= " -dbname $dbname " if defined $dbname;
+
+        system($command);
+    }
+
+    exit($exit_code);
+}
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_run.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_run.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_run.pl	(revision 38152)
@@ -38,4 +38,5 @@
 $job_cost{"staticsky"} = 2; # really?  avg time of 5720s?
 $job_cost{"diff"}   = 300 / 60 / 60;
+$job_cost{"ff"}     = 300 / 60 / 60; # This is an 83%-ile point, but the tail is long.
 
 # This object holds how "expensive" a given job is in terms of cores on a node.  
@@ -48,4 +49,5 @@
 $job_subscription{"staticsky"} = 3;
 $job_subscription{"diff"} = 1;
+$job_subscription{"ff"} = 1;
 
 my $proc_per_node = 24;                     # processors per node
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_stack.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_stack.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_stack.pl	(revision 38152)
@@ -216,5 +216,5 @@
     $ppstack_command    .= " -threads $threads_req ";
     $ppstack_command    .= " -dumpconfig ${remote_outroot}.mdc ";
-    $ppstack_command    .= " -stack_id $stack_id -skycell_id $skycell_id -tess_id $tess_id ";
+    $ppstack_command    .= " -stack_id $stack_id -skycell_id $skycell_id -tess_id $tess_id >& ${remote_outroot}.log2 ";
 
     my $post_cmd_echo = " echo -n \"stacktool  -addsumskyfile -stack_id $stack_id ";
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_staticsky.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_staticsky.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_prepare_staticsky.pl	(revision 38152)
@@ -198,5 +198,5 @@
     $pps_command    .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
     $pps_command    .= " -threads $threads_req ";
-    $pps_command    .= " -dumpconfig ${remote_outroot}.psphotStack.mdc ";
+    $pps_command    .= " -dumpconfig ${remote_outroot}.psphotStack.mdc >& ${remote_outroot}.log2 ";
 
     my $post_cmd_echo = " echo -n \"staticskytool  -addresult -sky_id $sky_id ";
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_remote_poll.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_remote_poll.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/sc_remote_poll.pl	(revision 38152)
@@ -516,4 +516,7 @@
 #	($class_id,$stage_id) = $file =~ /(/;
     }
+    elsif ($stage eq 'ff') {
+#	($class_id,$stage_id) = $file =~ /(/;
+    }
     return ($stage_id, $class_id);
 }
Index: /branches/eam_branches/ipp-20150405/ippScripts/scripts/skycalibration.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/ippScripts/scripts/skycalibration.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippScripts/scripts/skycalibration.pl	(revision 38152)
@@ -122,5 +122,5 @@
 my $recipe_psphot = $ipprc->reduction($reduction, "STACKPHOT_PSPHOT");
 unless ($recipe_psphot) {
-    &my_die("Couldn't find selected reduction for STATCKPHOT_PSPHOT: $reduction\n", $skycal_id, $PS_EXIT_CONFIG_ERROR);
+    &my_die("Couldn't find selected reduction for STACKPHOT_PSPHOT: $reduction\n", $skycal_id, $PS_EXIT_CONFIG_ERROR);
 }
 
Index: /branches/eam_branches/ipp-20150405/ippTasks/ipphosts.mhpcc.config
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTasks/ipphosts.mhpcc.config	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTasks/ipphosts.mhpcc.config	(revision 38152)
@@ -17,74 +17,74 @@
 # ipp045 : reference cat
 ##
-## now focus on new storage nodes only and not stsci since not ps1sc products 12/18/14 -- v2/05/15
+## now focus on new storage nodes only and not stsci since not ps1sc products 12/18/14 -- 04/07/15
 ## -- lower use of full nodes 67--81, even though transient diffs are large, but still need some since warp+dif
 ## -- try to avoid all the random alloc from no bbu nodes still 
+## -- ipp097 try adding now
 ipphosts METADATA
   camera STR skycell
   count S32  60
-  sky00 STR  ipp095.0
+  sky00 STR  ipp097.0
   sky01 STR  ipp095.0
-  sky02 STR  ipp093.0
-  sky03 STR  ipp092.0
-  sky04 STR  ipp091.0
-  sky05 STR  ipp090.0
-  sky06 STR  ipp089.0
-  sky07 STR  ipp088.0
-  sky08 STR  ipp087.0
+  sky02 STR  ipp094.0
+  sky03 STR  ipp093.0
+  sky04 STR  ipp092.0
+  sky05 STR  ipp091.0
+  sky06 STR  ipp090.0
+  sky07 STR  ipp089.0
+  sky08 STR  ipp088.0
   sky09 STR  ipp087.0
-  sky10 STR  ipp085.0
-  sky11 STR  ipp084.0
-  sky12 STR  ipp083.0
-  sky13 STR  ipp082.0
-
-  sky14 STR  ipp081.0
-  sky15 STR  ipp080.0
-  sky16 STR  ipp079.0
-  sky17 STR  ipp078.0
-  sky18 STR  ipp077.0
-  sky19 STR  ipp076.0
-  sky20 STR  ipp075.0
-  sky21 STR  ipp074.0
-  sky22 STR  ipp073.0
-  sky23 STR  ipp072.0
-  sky24 STR  ipp071.0
-  sky25 STR  ipp070.0
-  sky26 STR  ipp069.0
-  sky27 STR  ipp068.0
-  sky28 STR  ipp067.0
-
-  sky29 STR  ipp095.0
-  sky30 STR  ipp093.0
-  sky31 STR  ipp093.0
-  sky32 STR  ipp092.0
-  sky33 STR  ipp091.0
-  sky34 STR  ipp090.0
-  sky35 STR  ipp089.0
-  sky36 STR  ipp088.0
-  sky37 STR  ipp087.0
-  sky38 STR  ipp085.0
-  sky39 STR  ipp085.0
-  sky40 STR  ipp084.0
-  sky41 STR  ipp083.0
-  sky42 STR  ipp082.0
-
-  sky43 STR  ipp081.0
-  sky44 STR  ipp080.0
-  sky45 STR  ipp079.0
-  sky46 STR  ipp078.0
-  sky47 STR  ipp077.0
-  sky48 STR  ipp076.0
-  sky49 STR  ipp075.0
-  sky50 STR  ipp074.0
-  sky51 STR  ipp073.0
-  sky52 STR  ipp072.0
-  sky53 STR  ipp071.0
-  sky54 STR  ipp070.0
-  sky55 STR  ipp069.0
-  sky56 STR  ipp068.0
-  sky57 STR  ipp067.0
-
-  sky58 STR  ipp091.0
-  sky59 STR  ipp090.0
+  sky10 STR  ipp086.0
+  sky11 STR  ipp085.0
+  sky12 STR  ipp084.0
+  sky13 STR  ipp083.0
+  sky14 STR  ipp082.0
+
+  sky15 STR  ipp081.0
+  sky16 STR  ipp080.0
+  sky17 STR  ipp079.0
+  sky18 STR  ipp078.0
+  sky19 STR  ipp077.0
+  sky20 STR  ipp076.0
+  sky21 STR  ipp075.0
+  sky22 STR  ipp074.0
+  sky23 STR  ipp073.0
+  sky24 STR  ipp072.0
+  sky25 STR  ipp071.0
+  sky26 STR  ipp070.0
+  sky27 STR  ipp069.0
+  sky28 STR  ipp068.0
+  sky29 STR  ipp077.0
+
+  sky30 STR  ipp097.0
+  sky31 STR  ipp095.0
+  sky32 STR  ipp094.0
+  sky33 STR  ipp093.0
+  sky34 STR  ipp092.0
+  sky35 STR  ipp091.0
+  sky36 STR  ipp090.0
+  sky37 STR  ipp089.0
+  sky38 STR  ipp088.0
+  sky39 STR  ipp087.0
+  sky40 STR  ipp086.0
+  sky41 STR  ipp085.0
+  sky42 STR  ipp084.0
+  sky43 STR  ipp083.0
+  sky44 STR  ipp082.0
+
+  sky45 STR  ipp081.0
+  sky46 STR  ipp080.0
+  sky47 STR  ipp079.0
+  sky48 STR  ipp078.0
+  sky49 STR  ipp077.0
+  sky50 STR  ipp076.0
+  sky51 STR  ipp075.0
+  sky52 STR  ipp074.0
+  sky53 STR  ipp073.0
+  sky54 STR  ipp072.0
+  sky55 STR  ipp071.0
+  sky56 STR  ipp070.0
+  sky57 STR  ipp069.0
+  sky58 STR  ipp068.0
+  sky59 STR  ipp067.0
 END
 
@@ -92,69 +92,67 @@
 ## now focus on new storage nodes only 12/18/14
 ## -- chips transient and smaller so 67-81 ok
-## -- double up some to replace  problem/down nodes 094,086
 ipphosts METADATA
   camera STR GPC1
-  XY01  STR  ipp095
-  XY02  STR  ipp089
-  XY03  STR  ipp093
-  XY04  STR  ipp092
-  XY05  STR  ipp091
-  XY06  STR  ipp090
-  XY10  STR  ipp089
-  XY11  STR  ipp088
-  XY12  STR  ipp087
-  XY13  STR  ipp088
-  XY14  STR  ipp085
-  XY15  STR  ipp084
-  XY16  STR  ipp083
-  XY17  STR  ipp082
-  XY20  STR  ipp081
-  XY21  STR  ipp080
-  XY22  STR  ipp079
-  XY23  STR  ipp078
-  XY24  STR  ipp077
-  XY25  STR  ipp076
-  XY26  STR  ipp075
-  XY27  STR  ipp074
-  XY30  STR  ipp073
-  XY31  STR  ipp072
-  XY32  STR  ipp071
-  XY33  STR  ipp070
-  XY34  STR  ipp069
-  XY35  STR  ipp068
-  XY36  STR  ipp067
-
-  XY37  STR  ipp095
-  XY40  STR  ipp084
-  XY41  STR  ipp093
-  XY42  STR  ipp092
-  XY43  STR  ipp091
-  XY44  STR  ipp090
-  XY45  STR  ipp089
-  XY46  STR  ipp088
-  XY47  STR  ipp087
-  XY50  STR  ipp083
-  XY51  STR  ipp085
-  XY52  STR  ipp084
-  XY53  STR  ipp083
-  XY54  STR  ipp082
-  XY55  STR  ipp081
-  XY56  STR  ipp080
-  XY57  STR  ipp079
-  XY60  STR  ipp078
-  XY61  STR  ipp077
-  XY62  STR  ipp076
-  XY63  STR  ipp075
-  XY64  STR  ipp074
-  XY65  STR  ipp073
-  XY66  STR  ipp072
-  XY67  STR  ipp071
-  XY71  STR  ipp070
-  XY72  STR  ipp069
-  XY73  STR  ipp068
-  XY74  STR  ipp067
-
-  XY75  STR  ipp077
-  XY76  STR  ipp082
+  XY01  STR  ipp097
+  XY02  STR  ipp095
+  XY03  STR  ipp094
+  XY04  STR  ipp093
+  XY05  STR  ipp092
+  XY06  STR  ipp091
+  XY10  STR  ipp090
+  XY11  STR  ipp089
+  XY12  STR  ipp088
+  XY13  STR  ipp087
+  XY14  STR  ipp086
+  XY15  STR  ipp085
+  XY16  STR  ipp084
+  XY17  STR  ipp083
+  XY20  STR  ipp082
+  XY21  STR  ipp081
+  XY22  STR  ipp080
+  XY23  STR  ipp079
+  XY24  STR  ipp078
+  XY25  STR  ipp077
+  XY26  STR  ipp076
+  XY27  STR  ipp075
+  XY30  STR  ipp074
+  XY31  STR  ipp073
+  XY32  STR  ipp072
+  XY33  STR  ipp071
+  XY34  STR  ipp070
+  XY35  STR  ipp069
+  XY36  STR  ipp068
+  XY37  STR  ipp067
+
+  XY40  STR  ipp097
+  XY41  STR  ipp095
+  XY42  STR  ipp094
+  XY43  STR  ipp093
+  XY44  STR  ipp092
+  XY45  STR  ipp091
+  XY46  STR  ipp090
+  XY47  STR  ipp089
+  XY50  STR  ipp088
+  XY51  STR  ipp087
+  XY52  STR  ipp086
+  XY53  STR  ipp085
+  XY54  STR  ipp084
+  XY55  STR  ipp083
+  XY56  STR  ipp082
+  XY57  STR  ipp081
+  XY60  STR  ipp080
+  XY61  STR  ipp079
+  XY62  STR  ipp078
+  XY63  STR  ipp077
+  XY64  STR  ipp076
+  XY65  STR  ipp075
+  XY66  STR  ipp074
+  XY67  STR  ipp073
+  XY71  STR  ipp072
+  XY72  STR  ipp071
+  XY73  STR  ipp070
+  XY74  STR  ipp069
+  XY75  STR  ipp068
+  XY76  STR  ipp067
 END
 
@@ -162,72 +160,69 @@
 ## -- 066 and lower w/bbu just raw ota products or randomly if repair, only 1G so limit. 
 ## -- avoid 67-81 for permanent raw products since nearly full and need buffer for large diffims
-## -- 092 lot of free space so try double up there for when bbu fixed --  try 2/3/2015
-## -- try newer data nodes w/ poor BBU w/ just raw OTA since <066 seems to work ok
 ipphosts METADATA
   camera STR gpc1
-  ota01  STR  ipp095
-  ota02  STR  ipp094
-  ota03  STR  ipp093
-  ota04  STR  ipp092
-  ota05  STR  ipp091
-  ota06  STR  ipp090
-  ota10  STR  ipp089
-  ota11  STR  ipp088
-  ota12  STR  ipp087
-  ota13  STR  ipp086
-  ota14  STR  ipp085
-  ota15  STR  ipp084
-  ota16  STR  ipp083
-  ota17  STR  ipp082
-
-  ota20  STR  ipp095
-  ota21  STR  ipp094
-  ota22  STR  ipp093
-  ota23  STR  ipp092
-  ota24  STR  ipp091
-  ota25  STR  ipp090
-  ota26  STR  ipp089
-  ota27  STR  ipp087
-  ota30  STR  ipp086
-  ota31  STR  ipp085
-  ota32  STR  ipp084
-  ota33  STR  ipp083
-  ota34  STR  ipp082
-
-  ota35  STR  ipp095
-  ota36  STR  ipp094
-  ota37  STR  ipp093
-  ota40  STR  ipp092
-  ota41  STR  ipp091
-  ota42  STR  ipp090
-  ota43  STR  ipp089
-  ota44  STR  ipp088
-  ota45  STR  ipp087
-  ota46  STR  ipp086
-  ota47  STR  ipp085
-  ota50  STR  ipp084
-  ota51  STR  ipp083
-  ota52  STR  ipp082
-
-  ota53  STR  ipp095
-  ota54  STR  ipp066
-  ota55  STR  ipp093
-  ota56  STR  ipp092
-  ota57  STR  ipp091
-  ota60  STR  ipp090
-  ota61  STR  ipp089
-  ota62  STR  ipp088
-  ota63  STR  ipp087
-  ota64  STR  ipp063
-  ota65  STR  ipp085
-  ota66  STR  ipp084
-  ota67  STR  ipp083
-  ota71  STR  ipp082
-
-  ota72  STR  ipp056
-  ota73  STR  ipp056
-  ota74  STR  ipp058
-  ota75  STR  ipp058
-  ota76  STR  ipp092
+  ota01  STR  ipp097
+  ota02  STR  ipp095
+  ota03  STR  ipp094
+  ota04  STR  ipp093
+  ota05  STR  ipp092
+  ota06  STR  ipp091
+  ota10  STR  ipp090
+  ota11  STR  ipp089
+  ota12  STR  ipp088
+  ota13  STR  ipp087
+  ota14  STR  ipp086
+  ota15  STR  ipp085
+  ota16  STR  ipp084
+  ota17  STR  ipp083
+  ota20  STR  ipp082
+
+  ota21  STR  ipp097
+  ota22  STR  ipp095
+  ota23  STR  ipp094
+  ota24  STR  ipp093
+  ota25  STR  ipp092
+  ota26  STR  ipp091
+  ota27  STR  ipp090
+  ota30  STR  ipp089
+  ota31  STR  ipp088
+  ota32  STR  ipp087
+  ota33  STR  ipp086
+  ota34  STR  ipp085
+  ota35  STR  ipp084
+  ota36  STR  ipp083
+  ota37  STR  ipp082
+
+  ota40  STR  ipp097
+  ota41  STR  ipp095
+  ota42  STR  ipp094
+  ota43  STR  ipp093
+  ota44  STR  ipp092
+  ota45  STR  ipp091
+  ota46  STR  ipp090
+  ota47  STR  ipp089
+  ota50  STR  ipp088
+  ota51  STR  ipp087
+  ota52  STR  ipp086
+  ota53  STR  ipp085
+  ota54  STR  ipp084
+  ota55  STR  ipp083
+  ota56  STR  ipp082
+
+  ota57  STR  ipp097
+  ota60  STR  ipp095
+  ota61  STR  ipp094
+  ota62  STR  ipp093
+  ota63  STR  ipp092
+  ota64  STR  ipp091
+  ota65  STR  ipp090
+  ota66  STR  ipp089
+  ota67  STR  ipp088
+  ota71  STR  ipp087
+  ota72  STR  ipp086
+  ota73  STR  ipp085
+  ota74  STR  ipp084
+  ota75  STR  ipp083
+  ota76  STR  ipp082
 END
 
Index: /branches/eam_branches/ipp-20150405/ippTasks/lap.pro
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTasks/lap.pro	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTasks/lap.pro	(revision 38152)
@@ -220,5 +220,5 @@
   periods      -poll $LOADPOLL
   periods      -exec $LOADEXEC
-  periods      -timeout 600
+  periods      -timeout 3600
   active       false
 # This can probably be increased and spread over hosts in the future.
@@ -341,8 +341,8 @@
   periods      -poll $LOADPOLL
   periods      -exec $LOADEXEC
-  periods      -timeout 600
+  periods      -timeout 3600
   active       false
 # This can probably be increased and spread over hosts in the future.
-  npending     1            
+  npending     4            
 
   task.exec
@@ -461,5 +461,5 @@
   periods      -poll $LOADPOLL
   periods      -exec $LOADEXEC
-  periods      -timeout 600
+  periods      -timeout 3600
   active       false
 # This can probably be increased and spread over hosts in the future.
Index: /branches/eam_branches/ipp-20150405/ippTasks/remote.pro
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTasks/remote.pro	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTasks/remote.pro	(revision 38152)
@@ -27,4 +27,5 @@
   stack
   staticsky
+  diff
 end
 
@@ -121,5 +122,10 @@
 
     # min entry limit?
-    $run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 500
+    if ("$stage" == "stack") 
+	$run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 50
+    else 
+	$run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 500
+    end
+
     if ($DB:n == 0)
       option DEFAULT
@@ -293,5 +299,8 @@
     end
     if ("$STAGE" == "staticsky")
-      $command = sc_prepare_staticsky.pl --camera GPC1 --sky_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot -dbname $DBNAME
+      $command = sc_prepare_staticsky.pl --camera GPC1 --sky_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
+    end
+    if ("$STAGE" == "diff")
+      $command = sc_prepare_diff.pl --camera GPC1 --diff_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME
     end
 
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.DO.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.DO.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.DO.vot	(revision 38152)
@@ -21,7 +21,4 @@
 	<DESCRIPTION>Survey ID</DESCRIPTION>
       </FIELD>
-      <FIELD name="skyCellID" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>single float giving PrimaryCell.SkyCell identifier</DESCRIPTION>
-      </FIELD>
       <FIELD name="htmID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
         <DESCRIPTION>HTM index</DESCRIPTION>
@@ -30,5 +27,5 @@
         <DESCRIPTION>Zone index</DESCRIPTION>
       </FIELD>
-      <FIELD name="randomID" arraysize="1" datatype="long" unit="dimensionless" default="0">
+      <FIELD name="randomDiffObjID" arraysize="1" datatype="long" unit="dimensionless" default="0">
 	<DESCRIPTION>Random integer between 0 and 2^32 = 4,394,967,296</DESCRIPTION>
       </FIELD>
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FO.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FO.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FO.vot	(revision 38152)
@@ -15,4 +15,7 @@
         <DESCRIPTION>IPP object number</DESCRIPTION>
       </FIELD>
+      <FIELD name="randomForcedObjID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
+	<DESCRIPTION>random id</DESCRIPTION>
+      </FIELD>
       <FIELD name="nDetections" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>total number of detection measurements in all filters</DESCRIPTION>
@@ -21,7 +24,4 @@
         <DESCRIPTION>batch id</DESCRIPTION>
       </FIELD>
-      <FIELD name="gStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="gnTotal" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>number of detections in g filter</DESCRIPTION>
@@ -42,4 +42,7 @@
         <DESCRIPTION>number of detections included in robust mean of ApFlx 6 in g filter</DESCRIPTION>
       </FIELD>
+      <FIELD name="gnIncR7" arraysize="1" datatype="short" unit="dimensionless" default="-999">
+        <DESCRIPTION>number of detections included in robust mean of ApFlx 7 in g filter</DESCRIPTION>
+      </FIELD>      
       <FIELD name="gPSFFlux" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION> robust mean g psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number summary? 1/12 is ~9th percentile</DESCRIPTION>
@@ -93,4 +96,16 @@
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
       </FIELD>
+      <FIELD name="gFmeanflxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7 in g unconvolved stack</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gFmeanflxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gFmeanflxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gFmeanflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>      
       <FIELD name="gFlags" arraysize="1" datatype="long" unit="dimensionless" default="NA">
         <DESCRIPTION>flags for g forced</DESCRIPTION>
@@ -105,7 +120,4 @@
 	<DESCRIPTION>polarization, KSB-corrected 2Mxy / (Mxx + Myy)</DESCRIPTION>
       </FIELD>
-      <FIELD name="rStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="rnTotal" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>number of detections in r filter</DESCRIPTION>
@@ -126,4 +138,7 @@
         <DESCRIPTION>number of detections included in robust mean of ApFlx 6 in r filter</DESCRIPTION>
       </FIELD>
+      <FIELD name="rnIncR7" arraysize="1" datatype="short" unit="dimensionless" default="-999">
+        <DESCRIPTION>number of detections included in robust mean of ApFlx 7 in r filter</DESCRIPTION>
+      </FIELD>
       <FIELD name="rPSFFlux" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION> robust mean r psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number summary? 1/12 is ~9th percentile</DESCRIPTION>
@@ -177,4 +192,17 @@
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
       </FIELD>
+      <FIELD name="rFmeanflxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7 in r unconvolved stack</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rFmeanflxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rFmeanflxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rFmeanflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
+      
       <FIELD name="rFlags" arraysize="1" datatype="long" unit="dimensionless" default="NA">
         <DESCRIPTION>flags for r forced</DESCRIPTION>
@@ -189,7 +217,4 @@
 	<DESCRIPTION>polarization, KSB-corrected 2Mxy / (Mxx + Myy)</DESCRIPTION>
       </FIELD>
-      <FIELD name="iStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="inTotal" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>number of detections in i filter</DESCRIPTION>
@@ -210,4 +235,7 @@
         <DESCRIPTION>number of detections included in robust mean of ApFlx 6 in i filter</DESCRIPTION>
       </FIELD>
+      <FIELD name="inIncR7" arraysize="1" datatype="short" unit="dimensionless" default="-999">
+        <DESCRIPTION>number of detections included in robust mean of ApFlx 7 in i filter</DESCRIPTION>
+      </FIELD>      
       <FIELD name="iPSFFlux" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION> robust mean i psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number summary? 1/12 is ~9th percentile</DESCRIPTION>
@@ -261,4 +289,16 @@
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
       </FIELD>
+      <FIELD name="iFmeanflxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7 in i unconvolved stack</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iFmeanflxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iFmeanflxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iFmeanflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
       <FIELD name="iFlags" arraysize="1" datatype="long" unit="dimensionless" default="NA">
         <DESCRIPTION>flags for i forced</DESCRIPTION>
@@ -273,7 +313,4 @@
 	<DESCRIPTION>polarization, KSB-corrected 2Mxy / (Mxx + Myy)</DESCRIPTION>
       </FIELD>
-      <FIELD name="zStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="znTotal" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>number of detections in z filter</DESCRIPTION>
@@ -294,4 +331,7 @@
         <DESCRIPTION>number of detections included in robust mean of ApFlx 6 in z filter</DESCRIPTION>
       </FIELD>
+      <FIELD name="znIncR7" arraysize="1" datatype="short" unit="dimensionless" default="-999">
+        <DESCRIPTION>number of detections included in robust mean of ApFlx 7 in z filter</DESCRIPTION>
+      </FIELD>
       <FIELD name="zPSFFlux" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION> robust mean z psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number summary? 1/12 is ~9th percentile</DESCRIPTION>
@@ -345,4 +385,17 @@
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
       </FIELD>
+      <FIELD name="zFmeanflxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7 in z unconvolved stack</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zFmeanflxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zFmeanflxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zFmeanflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
+
       <FIELD name="zFlags" arraysize="1" datatype="long" unit="dimensionless" default="NA">
         <DESCRIPTION>flags for z forced</DESCRIPTION>
@@ -357,7 +410,4 @@
 	<DESCRIPTION>polarization, KSB-corrected 2Mxy / (Mxx + Myy)</DESCRIPTION>
       </FIELD>
-      <FIELD name="yStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="ynTotal" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>number of detections in y filter</DESCRIPTION>
@@ -378,4 +428,7 @@
         <DESCRIPTION>number of detections included in robust mean of ApFlx 6 in y filter</DESCRIPTION>
       </FIELD>
+      <FIELD name="ynIncR7" arraysize="1" datatype="short" unit="dimensionless" default="-999">
+        <DESCRIPTION>number of detections included in robust mean of ApFlx 7 in y filter</DESCRIPTION>
+      </FIELD>
       <FIELD name="yPSFFlux" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION> robust mean y psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number summary? 1/12 is ~9th percentile</DESCRIPTION>
@@ -428,4 +481,16 @@
       <FIELD name="yFmeanflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yFmeanflxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7 in y unconvolved stack</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yFmeanflxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yFmeanflxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yFmeanflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="yFlags" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -457,4 +522,7 @@
         <DESCRIPTION>IPP object number</DESCRIPTION>
       </FIELD>
+      <FIELD name="randomForcedObjID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
+	<DESCRIPTION>random number</DESCRIPTION>
+      </FIELD>
       <FIELD name="nDetections" arraysize="1" datatype="short" unit="dimensionless" default="-999">
         <DESCRIPTION>total number of detection measurements in all filters</DESCRIPTION>
@@ -463,7 +531,4 @@
         <DESCRIPTION>batch id</DESCRIPTION>
       </FIELD>
-      <FIELD name="gStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="gLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">
 	<DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION>
@@ -526,7 +591,4 @@
 	<DESCRIPTION>psf model shear polarizability E2 term</DESCRIPTION>
       </FIELD>
-      <FIELD name="rStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="rLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">
 	<DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION>
@@ -589,7 +651,4 @@
 	<DESCRIPTION>psf model shear polarizability E2 term</DESCRIPTION>
       </FIELD>
-      <FIELD name="iStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="iLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">
         <DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION>
@@ -652,7 +711,4 @@
 	<DESCRIPTION>psf model shear polarizability E2 term</DESCRIPTION>
       </FIELD>
-      <FIELD name="zStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
-      </FIELD>
       <FIELD name="zLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">
 	<DESCRIPTION>per-object smear polarizability X11 term</DESCRIPTION>
@@ -714,7 +770,4 @@
       <FIELD name="zLensPSFShearE2" arraysize="1" datatype="float" unit="dimensionless" default="-999">
 	<DESCRIPTION>psf model shear polarizability E2 term</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yStackID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
-	<DESCRIPTION>stack image id (how to carry through IPP+DVO</DESCRIPTION>
       </FIELD>
       <FIELD name="yLensObjSmearX11" arraysize="1" datatype="float" unit="arcsec^-2" default="-999">
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FW.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FW.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.FW.vot	(revision 38152)
@@ -318,4 +318,16 @@
         <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
       </FIELD>
+      <FIELD name="flxR7" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>Flux inside r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="flxR7Err" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated error in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="flxR7Std" arraysize="1" datatype="float" unit="adu/seconds" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
       <DATA>
         <TABLEDATA></TABLEDATA>
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.full.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.full.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.full.vot	(revision 38152)
@@ -207,4 +207,5 @@
           <TR><TD>25</TD><TD>CAL13</TD><TD>PS1 Cal 3C454.1 (Northern field) 225033+712919</TD></TR>
           <TR><TD>28</TD><TD>SSS</TD><TD>PS1 Solar System Sweet Spot Survey</TD></TR>
+          <TR><TD>29</TD><TD>CNP</TD><TD>PS1 Celestial North Pole Survey</TD></TR>
           <TR><TD>30</TD><TD>SAS</TD><TD>PS1 SAS</TD></TR>
           <TR><TD>254</TD><TD>UNK</TD><TD>PS1 undefined</TD></TR>
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.IN.vot	(revision 38152)
@@ -207,4 +207,5 @@
           <TR><TD>25</TD><TD>CAL13</TD><TD>PS1 Cal 3C454.1 (Northern field) 225033+712919</TD></TR>
           <TR><TD>28</TD><TD>SSS</TD><TD>PS1 Solar System Sweet Spot Survey</TD></TR>
+          <TR><TD>29</TD><TD>CNP</TD><TD>PS1 Celestial North Pole Survey</TD></TR>
           <TR><TD>30</TD><TD>SAS</TD><TD>PS1 SAS</TD></TR>
           <TR><TD>254</TD><TD>UNK</TD><TD>PS1 undefined</TD></TR>
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.OB.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.OB.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.OB.vot	(revision 38152)
@@ -58,8 +58,8 @@
       </FIELD>
       <FIELD name="raStack" arraysize="1" datatype="double" unit="degrees" default="-999">
-        <DESCRIPTION>Right Ascension - best weighted RA across filters from stack WHENEVER an object is detected in the stack</DESCRIPTION>
+        <DESCRIPTION>Right Ascension - best weighted RA across filters from stack WHENEVER an object is detected in the stack, will be -999 if	object not in stack</DESCRIPTION>
       </FIELD>
       <FIELD name="decStack" arraysize="1" datatype="double" unit="degrees" default="-999">
-        <DESCRIPTION>Declination - best weighted DEC across filters from stack WHENEVER an object is detected in the stack</DESCRIPTION>
+        <DESCRIPTION>Declination - best weighted DEC across filters from stack WHENEVER an object is detected in the stack, will be -999 if object not	in stack </DESCRIPTION>
       </FIELD>
       <FIELD name="raStackErr" arraysize="1" datatype="float" unit="arcsec" default="-999">
Index: /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.ST.vot
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.ST.vot	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/config/tables.ST.vot	(revision 38152)
@@ -207,10 +207,4 @@
         <DESCRIPTION>estimated error of g kron AB magnitude from stack</DESCRIPTION>
       </FIELD>
-      <FIELD name="gsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>PSF sky level at source (adu)</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>estimated error in sky</DESCRIPTION>
-      </FIELD>
       <FIELD name="ginfoFlag" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>informational bits</DESCRIPTION>
@@ -263,10 +257,4 @@
         <DESCRIPTION>estimated error of r kron AB magnitude from stack</DESCRIPTION>
       </FIELD>
-      <FIELD name="rsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>PSF sky level at source (adu)</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>estimated error in sky</DESCRIPTION>
-      </FIELD>
       <FIELD name="rinfoFlag" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>informational bits</DESCRIPTION>
@@ -319,10 +307,4 @@
         <DESCRIPTION>estimated error of i kron AB magnitude from stack</DESCRIPTION>
       </FIELD>
-      <FIELD name="isky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>PSF sky level at source (adu)</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>estimated error in sky</DESCRIPTION>
-      </FIELD>
       <FIELD name="iinfoFlag" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>informational bits</DESCRIPTION>
@@ -375,10 +357,4 @@
         <DESCRIPTION>estimated error of z kron AB magnitude from stack</DESCRIPTION>
       </FIELD>
-      <FIELD name="zsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>PSF sky level at source (adu)</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>estimated error in sky</DESCRIPTION>
-      </FIELD>
       <FIELD name="zinfoFlag" arraysize="1" datatype="int" unit="dimensionless" default="-999">
         <DESCRIPTION>informational bits</DESCRIPTION>
@@ -430,10 +406,4 @@
       <FIELD name="yKronMagErr" arraysize="1" datatype="float" unit="AB magnitude" default="-999">
         <DESCRIPTION>estimated error of y kron AB magnitude from stack</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ysky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>PSF sky level at source (adu)</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
-        <DESCRIPTION>estimated error in sky</DESCRIPTION>
       </FIELD>
       <FIELD name="yinfoFlag" arraysize="1" datatype="int" unit="dimensionless" default="-999">
@@ -568,4 +538,10 @@
 	<DESCRIPTION>extnsigma is a measure of how extended something is</DESCRIPTION>
       </FIELD>
+      <FIELD name="gsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>PSF residual background level at source (adu)</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>estimated error in sky</DESCRIPTION>
+      </FIELD>
       <FIELD name="gzp" arraysize="1" datatype="float" unit="magnitude" default="0">
         <DESCRIPTION>zero point offset</DESCRIPTION>
@@ -666,4 +642,10 @@
 	<DESCRIPTION>extnsigma is a measure of how extended something is</DESCRIPTION>
       </FIELD>
+      <FIELD name="rsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>PSF residual background level at source (adu)</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>estimated error in sky</DESCRIPTION>
+      </FIELD>
       <FIELD name="rzp" arraysize="1" datatype="float" unit="magnitude" default="0">
         <DESCRIPTION>zero point offset</DESCRIPTION>
@@ -763,4 +745,10 @@
 	<DESCRIPTION>extnsigma is a measure of how extended something is</DESCRIPTION>
       </FIELD>
+      <FIELD name="isky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>PSF residual background level at source (adu)</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>estimated error in sky</DESCRIPTION>
+      </FIELD>
       <FIELD name="izp" arraysize="1" datatype="float" unit="magnitude" default="0">
         <DESCRIPTION>zero point offset</DESCRIPTION>
@@ -861,4 +849,10 @@
 	<DESCRIPTION>extnsigma is a measure of how extended something is</DESCRIPTION>
       </FIELD>
+      <FIELD name="zsky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>PSF residual background level at source (adu)</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>estimated error in sky</DESCRIPTION>
+      </FIELD>
       <FIELD name="zzp" arraysize="1" datatype="float" unit="magnitude" default="0">
         <DESCRIPTION>zero point offset</DESCRIPTION>
@@ -957,5 +951,11 @@
       <FIELD name="yExtNSigma" arraysize="1" datatype="float" unit="unknown" default="-999">
 	<DESCRIPTION>extnsigma is a measure of how extended something is</DESCRIPTION>
-      </FIELD> 
+      </FIELD>
+      <FIELD name="ysky" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>PSF residual background level at source (adu)</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yskyErr" arraysize="1" datatype="float" unit="adu/s/arcsec" default="-999">
+        <DESCRIPTION>estimated error in sky</DESCRIPTION>
+      </FIELD>
       <FIELD name="yzp" arraysize="1" datatype="float" unit="magnitude" default="0">
         <DESCRIPTION>zero point offset</DESCRIPTION>
@@ -1005,66 +1005,42 @@
         <DESCRIPTION>ipp identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="gflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR3Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
-      </FIELD>
       <FIELD name="gflxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="gflxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is gflxR5</DESCRIPTION>
+        <DESCRIPTION>estimated error in flxR5</DESCRIPTION>
       </FIELD>
       <FIELD name="gflxR5Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in gflxR5</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR5Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="gc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="gflxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="gc6flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="gc6flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1077,30 +1053,30 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="gc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="gc6flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="gc8flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="gc8flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1113,4 +1089,28 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
+      <FIELD name="gc8flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
 
       <!-- r-band values -->
@@ -1124,66 +1124,42 @@
         <DESCRIPTION>ipp identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="rflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR3Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
-      </FIELD>
       <FIELD name="rflxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="rflxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is gflxR5</DESCRIPTION>
+        <DESCRIPTION>estimated error in flxR5</DESCRIPTION>
       </FIELD>
       <FIELD name="rflxR5Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in gflxR5</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR5Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="rc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="rflxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="rc6flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="rc6flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1196,30 +1172,30 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="rc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="rc6flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="rc8flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss  r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="rc8flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1232,4 +1208,28 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
+      <FIELD name="rc8flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
 
       <!-- i-band values -->
@@ -1243,66 +1243,42 @@
         <DESCRIPTION>ipp identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="iflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR3Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
-      </FIELD>
       <FIELD name="iflxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="iflxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is gflxR5</DESCRIPTION>
+        <DESCRIPTION>estimated error in flxR5</DESCRIPTION>
       </FIELD>
       <FIELD name="iflxR5Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in gflxR5</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR5Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="ic6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="iflxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="ic6flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="ic6flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1315,30 +1291,30 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="ic8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="ic6flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="ic8flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="ic8flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1351,4 +1327,28 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
+      <FIELD name="ic8flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
 
       <!-- z-band values -->
@@ -1362,66 +1362,42 @@
         <DESCRIPTION>ipp identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="zflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR3Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
-      </FIELD>
       <FIELD name="zflxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="zflxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is gflxR5</DESCRIPTION>
+        <DESCRIPTION>estimated error in flxR5</DESCRIPTION>
       </FIELD>
       <FIELD name="zflxR5Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in gflxR5</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR5Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="zc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="zflxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="zc6flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="zc6flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1434,30 +1410,30 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="zc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="zc6flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="zc8flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="zc8flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1470,4 +1446,28 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
+      <FIELD name="zc8flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
+      </FIELD>
 
       <!-- y-band values -->
@@ -1481,66 +1481,42 @@
         <DESCRIPTION>ipp identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="yflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR3Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
-      </FIELD>
       <FIELD name="yflxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="yflxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is gflxR5</DESCRIPTION>
+        <DESCRIPTION>estimated error in flxR5</DESCRIPTION>
       </FIELD>
       <FIELD name="yflxR5Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in gflxR5</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR5Fill" arraysize="1" datatype="float"  unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="yc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="yflxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in gflxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="yc6flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="yc6flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1553,30 +1529,30 @@
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
       </FIELD>
-      <FIELD name="yc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR3Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR3Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR3Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R3</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR4" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR4Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR4Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR4</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR4Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R4</DESCRIPTION>
+      <FIELD name="yc6flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <FIELD name="yc8flxR5" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 5</DESCRIPTION>
+        <DESCRIPTION>Flux inside sdss r = 5</DESCRIPTION>
       </FIELD>
       <FIELD name="yc8flxR5Err" arraysize="1" datatype="float" unit="Jy" default="-999">
@@ -1588,4 +1564,28 @@
       <FIELD name="yc8flxR5Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R5</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR6" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR6Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR6Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR6Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R6</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR7" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside sdss r = 7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR7Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR7Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR7</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR7Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R7</DESCRIPTION>
       </FIELD>
       <DATA>
@@ -2704,5 +2704,5 @@
 
     <!-- StackApFlxFull Table ************************************************** -->
-    <TABLE name="StackApFlxEGUnc">
+    <TABLE name="StackApFlxExGalUnc">
       <DESCRIPTION>VOTable description of PSPS table StackApFlxFull</DESCRIPTION>
       <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM>
@@ -2739,28 +2739,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="gflxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gflxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="gflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -2847,4 +2823,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="gflxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gflxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+
       <!-- r-band values -->
       <FIELD name="rippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -2857,28 +2858,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="rflxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rflxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="rflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -2964,4 +2941,28 @@
       <FIELD name="rflxR9Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rflxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
       </FIELD>
       <!-- i-band values -->
@@ -2975,28 +2976,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="iflxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="iflxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="iflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3083,4 +3060,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="iflxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="iflxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+
       <!-- z-band values -->
       <FIELD name="zippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -3093,28 +3095,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="zflxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zflxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="zflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3201,4 +3179,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="zflxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zflxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+      
       <!-- y-band values -->
       <FIELD name="yippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -3211,28 +3214,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="yflxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yflxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="yflxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3318,4 +3297,28 @@
       <FIELD name="yflxR9Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yflxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
       </FIELD>
       <DATA>
@@ -3325,5 +3328,5 @@
 
     <!-- StackApFlxFullC6 Table ************************************************** -->
-    <TABLE name="StackApFlxEGCon6">
+    <TABLE name="StackApFlxExGalCon6">
       <DESCRIPTION>VOTable description of PSPS table StackApFlxFullC6</DESCRIPTION>
       <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM>
@@ -3360,28 +3363,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="gc6flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc6flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="gc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3467,4 +3446,28 @@
       <FIELD name="gc6flxR9Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc6flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
       </FIELD>
       <!-- r-band values -->
@@ -3478,28 +3481,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="rc6flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc6flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="rc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3585,4 +3564,28 @@
       <FIELD name="rc6flxR9Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc6flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
       </FIELD>
       <!-- i-band values -->
@@ -3596,28 +3599,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="ic6flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic6flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="ic6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3704,4 +3683,28 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="ic6flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic6flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>      
       <!-- z-band values -->
       <FIELD name="zippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -3714,28 +3717,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="zc6flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc6flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="zc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3822,4 +3801,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="zc6flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc6flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+
       <!-- y-band values -->
       <FIELD name="yippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -3832,28 +3836,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="yc6flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c6flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc6flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="yc6flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -3940,4 +3920,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="yc6flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c6flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc6flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+
       <DATA>
 	<TABLEDATA></TABLEDATA>
@@ -3946,5 +3951,5 @@
 
     <!-- StackApFlxFullC8 Table ************************************************** -->
-    <TABLE name="StackApFlxEGCon8">
+    <TABLE name="StackApFlxExGalCon8">
       <DESCRIPTION>VOTable description of PSPS table StackApFlxFullC8</DESCRIPTION>
       <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM>
@@ -3981,28 +3986,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="gc8flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="gc8flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="gc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -4088,4 +4069,28 @@
       <FIELD name="gc8flxR9Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="gc8flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
       </FIELD>
       <!-- r-band values -->
@@ -4099,28 +4104,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="rc8flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="rc8flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="rc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -4207,4 +4188,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="rc8flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="rc8flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+      
       <!-- i-band values -->
       <FIELD name="iippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -4217,28 +4223,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="ic8flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="ic8flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="ic8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -4325,4 +4307,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="ic8flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="ic8flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+      
       <!-- z-band values -->
       <FIELD name="zippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -4335,28 +4342,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="zc8flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="zc8flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="zc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -4443,4 +4426,28 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="zc8flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="zc8flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>      
       <!-- y-band values -->
       <FIELD name="yippDetectID" arraysize="1" datatype="long" unit="dimensionless" default="NA">
@@ -4453,28 +4460,4 @@
         <DESCRIPTION>stack identifier</DESCRIPTION>
       </FIELD>
-      <FIELD name="yc8flxR1" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR1Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR1Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR1Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR2" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>Flux inside r = 2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR2Err" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated error is c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR2Std" arraysize="1" datatype="float" unit="Jy" default="-999">
-        <DESCRIPTION>estimated standard deviation in c8flxR2</DESCRIPTION>
-      </FIELD>
-      <FIELD name="yc8flxR2Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
-        <DESCRIPTION>estimated filling factor at R1</DESCRIPTION>
-      </FIELD>
       <FIELD name="yc8flxR3" arraysize="1" datatype="float" unit="Jy" default="-999">
         <DESCRIPTION>Flux inside r = 3</DESCRIPTION>
@@ -4561,4 +4544,29 @@
         <DESCRIPTION>estimated filling factor at R9</DESCRIPTION>
       </FIELD>
+      <FIELD name="yc8flxR10" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR10Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR10Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR10Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R10</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR11" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>Flux inside r = 11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR11Err" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated error is c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR11Std" arraysize="1" datatype="float" unit="Jy" default="-999">
+        <DESCRIPTION>estimated standard deviation in c8flxR11</DESCRIPTION>
+      </FIELD>
+      <FIELD name="yc8flxR11Fill" arraysize="1" datatype="float" unit="dimensionless" default="-999">
+        <DESCRIPTION>estimated filling factor at R11</DESCRIPTION>
+      </FIELD>
+      
       <DATA>
 	<TABLEDATA></TABLEDATA>
Index: /branches/eam_branches/ipp-20150405/ippToPsps/jython/diffobjectbatch.py
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/jython/diffobjectbatch.py	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/jython/diffobjectbatch.py	(revision 38152)
@@ -288,5 +288,5 @@
         sqlLine.group("ippObjID",        "OBJ_ID + (CAT_ID << 32)") # NOTE: shift by 32 bits exactly
         sqlLine.group("surveyID",        "'" + str(self.surveyID) + "'")
-        sqlLine.group("randomID",        "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)") # XXX where does this number come from??
+        sqlLine.group("randomDiffObjID",        "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)") # XXX where does this number come from??
         sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
         sqlLine.group("dvoRegionID",     "CAT_ID") 
Index: /branches/eam_branches/ipp-20150405/ippToPsps/jython/forcedobjectbatch.py
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/jython/forcedobjectbatch.py	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/jython/forcedobjectbatch.py	(revision 38152)
@@ -328,4 +328,5 @@
         sqlLine.group("ippObjID",        "OBJ_ID + (CAT_ID << 32)") # NOTE: shift by 32 bits exactly
         sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
+        sqlLine.group("randomForcedObjID",        "FLOOR(RAND("+str(self.batchID)+")*9223372036854775807)")
         sqlLine.group("nDetections",      "'0'")
         sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
@@ -354,12 +355,8 @@
         sqlLine.group("objID",           "objID")
         sqlLine.group("uniquePspsFOid","uniquePspsFOid")
+        sqlLine.group("randomForcedObjID","randomForcedObjID")
         sqlLine.group("ippObjID",        "ippObjID")
         sqlLine.group("batchID",         "batchID")
         sqlLine.group("nDetections",      "nDetections")
-        sqlLine.group("gStackID",      "gStackID")
-        sqlLine.group("rStackID",      "rStackID")
-        sqlLine.group("iStackID",      "iStackID")
-        sqlLine.group("zStackID",      "zStackID")
-        sqlLine.group("yStackID",      "yStackID")
 
         sql = sqlLine.makeRaw(") SELECT ", " FROM ForcedMeanObject")
Index: /branches/eam_branches/ipp-20150405/ippToPsps/jython/gpc1db.py
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/jython/gpc1db.py	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/jython/gpc1db.py	(revision 38152)
@@ -113,5 +113,5 @@
 
             stage = "diff"
-            sql = "SELECT DISTINCT stage_extra1, radeg,decdeg \
+            sql = "SELECT stage_id, avg(radeg),avg(decdeg) \
                    FROM addRun \
                    JOIN addProcessedExp using (add_id) \
@@ -140,11 +140,11 @@
                    AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
                    AND dateobs >= '" + tstart + "'\
-                   AND dateobs <= '" + tend  + "'"
-
+                   AND dateobs <= '" + tend  + "'\
+                   GROUP BY stage_id"                   
 
         elif batchType == "FW":
             
             stage = "fullforce"
-            sql = "SELECT DISTINCT add_id, radeg, decdeg FROM fullForceInput \
+            sql = "SELECT stage_id, avg(radeg), avg(decdeg) FROM fullForceInput \
                    JOIN addRun ON(fullForceInput.ff_id = addRun.stage_id AND fullForceInput.warp_id = addRun.stage_extra1) \
                    JOIN minidvodbRun USING(minidvodb_name) \
@@ -167,5 +167,6 @@
                    AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
                    AND mjd_obs >= (to_days('" + tstart + "')-678941) \
-                   AND mjd_obs <= (to_days('" + tend + "') - 678941) "
+                   AND mjd_obs <= (to_days('" + tend + "') - 678941) \
+                   GROUP BY stage_id"
 
         try:
Index: /branches/eam_branches/ipp-20150405/ippToPsps/jython/stackbatch.py
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/jython/stackbatch.py	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/jython/stackbatch.py	(revision 38152)
@@ -450,4 +450,5 @@
             sqlLine.group("a."+filter+"KronRad",       "b.MOMENTS_R1 * 2.5")
             sqlLine.group("a."+filter+"PlateScale",    "b.PLTSCALE")
+            sqlLine.group("a."+filter+"ExtNSigma",     "b.EXT_NSIGMA")
 
             sql = sqlLine.makeEquals("WHERE a." + filter + "ippDetectID = b.IPP_IDET")
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema10.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema10.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema10.txt	(revision 38152)
@@ -0,0 +1,132 @@
+Notes on Schema Version 9
+
+
+Proposed Image Products and PSPS Tables and Views
+
+IMAGE PRODUCTS 
+
+Survey  | Description               |  Image Products Saved
+
+3pi     | 3pi                       | 3pi warps, 3pi stacks
+CNP     | Celestial North Pole (3pi)| CNP warps, stacks
+SS      | ecliptic w band data      |   w warps, w stack
+MDD     | Medium Deep Deep          |  MD warps, deep stacks 
+MDT     | Medium Deep Template      |            template stacks
+MDN     | Medium Deep Nightly Stack |            nightly stacks 
+MDN     | Medium Deep Off Year      |            off year template stacks 
+M31     | M31                       | M31 warps, M31 stacks, template
+STS     | STS                       | STS warps, STS template - best iq stack 
+
+
+Survey  | Description               |  Image Products NOT Saved, but analyzed for difference detections and discarded 
+
+3pi     | difference                |3pi warps - stack 
+CNP     | difference                |CNP warps - stack 
+SS      | difference image          |  w warps - stack 
+MDD     | difference image          | MD warps - off year template stacks  
+MDO     | difference image          | MDN stacks - off year template stacks  
+M31     | difference image          | M31 warps - stack 
+STS     | difference image          | STS warps - template 
+
+
+
+PSPS TABLES                                                 
+
+
+Fundamental IPP Data Products  Origin 
+
+Detection                      detections found in detrended images   
+ObjectThin                     positonal and flag data, no fluxes   
+MeanObject                     extracted Mean properties as determined from individual Detections.   
+StackObject                    Stack Detections in all filters, with forced upperlimits, separate rows for primary, secondary, best stack detections (80% time only primary)  
+StackApFlx                     all filters in one table, unconvolved and convolved apertures (up to  6 , 8, 10(?) pixels  in all bands) 
+StackModelFit                  all filters in one table. Models of high signal to noise objects in low density regions.     
+DiffDet                        difference detections found in difference image = image - template 
+DiffObject                     associations of Difference Detections
+ForcedWarpMeasure              forced measurements on each warp in all filters at the position of an object found in a stack. Includes StackApFlx-like table   
+ForcedMeanObject               like MeanObject, but using the Forced Mean Measurements to form the Mean. 
+
+w band                         TBD 
+
+
+Derived Data Product Tables 
+
+pcsPhotoZ                       populated from PCS
+pcsPhotoZProbability            populated from PCS
+pcsStarGalQSOSep                populated from PCS
+pcsStellarParams                populated from PCS
+mopsMovingObject                populated from MOPS database
+ppmObj                          proper motion and parallax populated from IPP  
+tcsClassification               populated from transient server database
+galExtinction                   populated from Dust team
+stargal                         populated from various algorithms, combos of ipp parameters, fits to population as function of magnitude, or Support Vector Machine
+GoodObject                      selected and populated post-facto  
+StarGalaxySep                   selected and populated post-facto 
+
+
+Observational Metadata and System MetaData Tables
+
+CameraConfig
+DetectionFlags
+DiffMeta
+Filter
+FitModel
+ForcedWarpMeta
+FrameMeta
+ImageFlags
+ImageMeta                       add psf 3nd and 4th  moments
+Mask
+MovingObjectToDet
+MovingObjectToDiffDet
+MovingObjToObject
+ObjectFilterFlags               flag info not in current schema but in PSI interface...
+ObjectInfoFlags
+ObjectQualityFlags
+PhotoCal
+ProjectionCell
+ProcessingVersion
+SkyCell 
+StackDetectionFlags
+StackMeta                       
+StackToImage
+StackType
+Survey
+TelescopeConfig
+fitModel
+pcsGalaxyModel
+pcsPhotoZRecipe
+pcsSGSepRecipe
+pcsStarModel
+pcsStellarParamsRecipe
+
+
+
+PSPS VIEWS - examples  
+
+ObjectMean        = ObjectThin join MeanObject 
+ObjectStack       = ObjectThin join StackObject
+ObjectApFlx       = ObjectThin join StackApFlx  
+ObjectModel       = ObjectThin join StackModelFit   
+ObjectStackAll    = ObjectThin join StackObject and StackAp and StackModelFit 
+ObjectForcedMean  = ObjectThin join ForcedMeanObject
+ObjectPrimary     = ObjectThin join StackObject join StackApFlx where primaryDection is true
+ObjectBest        = ObjectThin join StackObject join StackApFlx where bestDetection is true
+
+
+PSPS Indicies 
+
+DetectionID
+ObjectID
+BatchID
+StackTypeID
+MovingObjID
+DiffObjID 
+RandomID           between 1 and 2^16 = 4,294,967,296 so you pick how many random objects you want ,
+                   i.e 10,000 pick randomid < 10,000 and if indexed, this will be very fast. 
+RandomStackID      between 1 and 2^16 = 4,294,967,296 so you pick how many random objects you want ,
+                   i.e 10,000 pick randomid < 10,000 and if indexed, this will be very fast. 
+
+
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema11.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema11.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema11.txt	(revision 38152)
@@ -0,0 +1,132 @@
+Notes on Schema Version 9
+
+
+Proposed Image Products and PSPS Tables and Views
+
+IMAGE PRODUCTS 
+
+Survey  | Description               |  Image Products Saved
+
+3pi     | 3pi                       | 3pi warps, 3pi stacks
+CNP     | Celestial North Pole (3pi)| CNP warps, stacks
+SS      | ecliptic w band data      |   w warps, w stack
+MDD     | Medium Deep Deep          |  MD warps, deep stacks 
+MDT     | Medium Deep Template      |            template stacks
+MDN     | Medium Deep Nightly Stack |            nightly stacks 
+MDN     | Medium Deep Off Year      |            off year template stacks 
+M31     | M31                       | M31 warps, M31 stacks, template
+STS     | STS                       | STS warps, STS template - best iq stack 
+
+
+Survey  | Description               |  Image Products NOT Saved, but analyzed for difference detections and discarded 
+
+3pi     | difference                |3pi warps - stack 
+CNP     | difference                |CNP warps - stack 
+SS      | difference image          |  w warps - stack 
+MDD     | difference image          | MD warps - off year template stacks  
+MDO     | difference image          | MDN stacks - off year template stacks  
+M31     | difference image          | M31 warps - stack 
+STS     | difference image          | STS warps - template 
+
+
+
+PSPS TABLES                                                 
+
+
+Fundamental IPP Data Products  Origin 
+
+Detection                      detections found in detrended images   
+ObjectThin                     positonal and flag data, no fluxes   
+MeanObject                     extracted Mean properties as determined from individual Detections.   
+StackObject                    Stack Detections in all filters, with forced upperlimits, separate rows for primary, secondary, best stack detections (80% time only primary)  
+StackApFlx                     all filters in one table, unconvolved and convolved apertures (up to  6 , 8, 10(?) pixels  in all bands) 
+StackModelFit                  all filters in one table. Models of high signal to noise objects in low density regions.     
+DiffDet                        difference detections found in difference image = image - template 
+DiffObject                     associations of Difference Detections
+ForcedWarpMeasure              forced measurements on each warp in all filters at the position of an object found in a stack. Includes StackApFlx-like table   
+ForcedMeanObject               like MeanObject, but using the Forced Mean Measurements to form the Mean. 
+
+w band                         TBD 
+
+
+Derived Data Product Tables 
+
+pcsPhotoZ                       populated from PCS
+pcsPhotoZProbability            populated from PCS
+pcsStarGalQSOSep                populated from PCS
+pcsStellarParams                populated from PCS
+mopsMovingObject                populated from MOPS database
+ppmObj                          proper motion and parallax populated from IPP  
+tcsClassification               populated from transient server database
+galExtinction                   populated from Dust team
+stargal                         populated from various algorithms, combos of ipp parameters, fits to population as function of magnitude, or Support Vector Machine
+GoodObject                      selected and populated post-facto  
+StarGalaxySep                   selected and populated post-facto 
+
+
+Observational Metadata and System MetaData Tables
+
+CameraConfig
+DetectionFlags
+DiffMeta
+Filter
+FitModel
+ForcedWarpMeta
+FrameMeta
+ImageFlags
+ImageMeta                       add psf 3nd and 4th  moments
+Mask
+MovingObjectToDet
+MovingObjectToDiffDet
+MovingObjToObject
+ObjectFilterFlags               flag info not in current schema but in PSI interface...
+ObjectInfoFlags
+ObjectQualityFlags
+PhotoCal
+ProjectionCell
+ProcessingVersion
+SkyCell 
+StackDetectionFlags
+StackMeta                       
+StackToImage
+StackType
+Survey
+TelescopeConfig
+fitModel
+pcsGalaxyModel
+pcsPhotoZRecipe
+pcsSGSepRecipe
+pcsStarModel
+pcsStellarParamsRecipe
+
+
+
+PSPS VIEWS - examples  
+
+ObjectMean        = ObjectThin join MeanObject 
+ObjectStack       = ObjectThin join StackObject
+ObjectApFlx       = ObjectThin join StackApFlx  
+ObjectModel       = ObjectThin join StackModelFit   
+ObjectStackAll    = ObjectThin join StackObject and StackAp and StackModelFit 
+ObjectForcedMean  = ObjectThin join ForcedMeanObject
+ObjectPrimary     = ObjectThin join StackObject join StackApFlx where primaryDection is true
+ObjectBest        = ObjectThin join StackObject join StackApFlx where bestDetection is true
+
+
+PSPS Indicies 
+
+DetectionID
+ObjectID
+BatchID
+StackTypeID
+MovingObjID
+DiffObjID 
+RandomID           between 1 and 2^16 = 4,294,967,296 so you pick how many random objects you want ,
+                   i.e 10,000 pick randomid < 10,000 and if indexed, this will be very fast. 
+RandomStackID      between 1 and 2^16 = 4,294,967,296 so you pick how many random objects you want ,
+                   i.e 10,000 pick randomid < 10,000 and if indexed, this will be very fast. 
+
+
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema12.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema12.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema12.txt	(revision 38152)
@@ -0,0 +1,2 @@
+Heather cleaned up the column names and types to make them consistent.
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema13.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema13.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/Notes_on_Schema13.txt	(revision 38152)
@@ -0,0 +1,8 @@
+changes by EAM:
+* added lensing terms to ForcedWarpMeasurement & ForcedMeanObject
+* removed fluxPeak and momentRH generally
+* changed psfWidMajor,Minor to psfMajorFWHM,psfMinorFWHM
+* added psfCore (k term in psf model : 1 / (1 + kz + k^1.667)
+* fixed stack flux & mag names
+* set units for moments to be in arcsec everywhere.
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/GoodObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/GoodObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/GoodObject	(revision 38152)
@@ -0,0 +1,4 @@
+objName         string          VAR     8       NA      IAU Name constructed from objID postion PS1.x JHHMMSS.SS+/-DDMMSS.S where x is leading number of procesing version
+objID           dimensionless   BIGINT  8       NA      ODM object identifier index
+ippObjID        dimensionless   BIGINT  8       NA      IPP object number
+goodObjectID    dimensionless   BIGINT  8       NA      index for post-facto "good objects" subset from ObjID 
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/StarGalaxySep
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/StarGalaxySep	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/StarGalaxySep	(revision 38152)
@@ -0,0 +1,9 @@
+objName         string          VAR     8       NA      IAU Name constructed from objID postion PS1.x JHHMMSS.SS+/-DDMMSS.S where x is leading number of procesing version
+objID           dimensionless   BIGINT  8       NA      ODM object identifier index
+ippObjID        dimensionless   BIGINT  8       NA      IPP object number
+sgbinarySep1    dimensionless   TINYINT 2       255     binary flag for star galaxy separator - technique 1
+sgbinarySep2    dimensionless   TINYINT 2       255     binary flag for star galaxy separator - technique 2
+sgbinarySep3    dimensionless   TINYINT 2       255     binary flag for star galaxy separator - technique 3
+sgSep1          dimensionless   REAL    4       -999    probility of star/galaxy technique 1  
+sgSep2          dimensionless   REAL    4       -999    probility of star/galaxy technique 2  
+sgSep3          dimensionless   REAL    4       -999    probility of star/galaxy technique 3  
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/galExtinction
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/galExtinction	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/galExtinction	(revision 38152)
@@ -0,0 +1,28 @@
+galExtinction 
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID				dimensionless	BIGINT	8	NA	ODM object identifier index
+ippObjID			dimensionless	BIGINT	8	NA	IPP object number
+
+From Doug and Eddie ?
+
+E(B-V)
+
+gGalext
+rGalext
+iGalext
+zGalext
+yGalext
+wGalext
+probability vector
+
+stellar parameters
+Teff
+g_surf
+[Fe/H]
+
+
+
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/mopsMovingObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/mopsMovingObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/mopsMovingObject	(revision 38152)
@@ -0,0 +1,28 @@
+Name Unit Data Type Size Default Value Description
+
+MovingObjName   dimensionless	STRING 	x	-999	MPC Name 
+MovingObjType   dimensionless 	STRING 	x	-999 	Type of moving object (NEO, PHA, COMET, ...)
+MovingObjID     dimensionless	BIGINT 8 	-999  	Moving Object identifier     
+OrbEpoch        date		DATE     	-999  	The epoch of osculation of the orbital elements.
+Moid       	au		REAL   	4 	-999  	Minimum orbit intersection distance 
+OrbM       	dimensionles	REAL	4	-999	Mean anomaly at the epoch.
+OrbT       	date 		DATE 	  	-999    Date of perihelion passage.
+ORBn 		deg/day		REAL	4	-999	Mean daily motion (in degrees/day).
+ORBa       	AU		REAL	4	-999	Semimajor axis (in AU).
+ORBz       	1/AU		REAL	4	-999 	Reciprocal semimajor axis (in 1/AU).
+ORBq       	AU		REAL	4	-999	Perihelion distance (in AU).
+ORBe       	dimensionless	REAL	4	-999	Orbital eccentricity.
+OrbP       	years		REAL	4	-999	Orbital period (in years).
+OrbPeri    	degrees		REAL	4	-999	The J2000.0 argument of perihelion (in degrees).
+OrbNode    	degrees		REAL	4	-999	The J2000.0 longitude of the ascending node (in degrees).
+OrbIncl    	degrees		REAL	4	-999	The J2000.0 inclination (in degrees).
+P1         	dimensionless	REAL	4	-999	P1 first component of P vector
+P2	        dimensionless   REAL    4       -999    P2 second component of P vector 
+P3              dimensionless   REAL    4       -999    P3 third component of P vector
+Q1         	dimensionless   REAL    4       -999    Q1 first component of Q vector
+Q2         	dimensionless 	REAL    4	-999    Q2 second component of Q vector
+Q3         	dimensionless   REAL    4       -999    Q3 third component of Q vector
+U               dimensionless   REAL    4       -999    Uncertainty parameter.
+H               dimensionless   REAL    4       -999    Absolute visual magnitude. A table converting H to a diameter is available.
+G               dimensionless   REAL    4       -999    Slope parameter. 
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZ
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZ	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZ	(revision 38152)
@@ -0,0 +1,21 @@
+pcsPhotoZ
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID			BIGINT	8	NA	ODM object identifier index
+ippObjID		BIGINT	8	NA	IPP object number
+pcsPhotoZRecipeID	INT	4	-999	Recipe of the photoZ calculation
+galExt			REAL	4	-999	Galactic extinction E(B-V) used for photoz determination (derived from Schlegel Maps)
+photoz_1		REAL	4	-999	PhotoZ for best fitting template
+photozErr_1		REAL	4	-999	Estimated error for this tempalte
+chi2_1			REAL	4	-999	Chi^2 for this template
+modelID_1		INT	4	-999	Identifier for the template for this recipe
+photoz_2		REAL	4	-999	PhotoZ for second template
+photozErr_2		REAL	4	-999	Estimated error for this tempalte
+chi2_2			REAL	4	-999	Chi^2 for this template
+modelID_2		INT	4	-999	Identifier for the template for this recipe
+flags_gtfit		INT	4	-999	warning flags (e.g. missing band(s), unreliable galExt value etc.), TBD
+av			REAL	4	-999	determined extinction
+chi2			REAL	4	-999	chi2 for the best fitting stellar template
+modelID			INT	4	-999	modelID of the best fitting stellar template
+flags_stfit		INT	4	-999	warning flags from stellar template fitting
+starGalQSOSep		INT	4	-999	0: Object is a star (chi2
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZProbabiity
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZProbabiity	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsPhotoZProbabiity	(revision 38152)
@@ -0,0 +1,37 @@
+PhotoZProbability
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID			dimensionless	BIGINT	8	NA	ODM object identifier index
+ippObjID		dimensionless	BIGINT	8	NA	IPP object number
+pcsPhotoZRecipeID	dimensionless	INT	4	-999	recipe for the photoz determination
+modelID			dimensionless	INT	4	-999	modelID of the template
+sp1	dimensionless	REAL	4	-999	spline params 1
+sp2	dimensionless	REAL	4	-999	spline params 2
+sp3	dimensionless	REAL	4	-999	spline params 3
+sp4	dimensionless	REAL	4	-999	spline params 4
+sp5	dimensionless	REAL	4	-999	spline params 5
+sp6	dimensionless	REAL	4	-999	spline params 6
+sp7	dimensionless	REAL	4	-999	spline params 7
+sp8	dimensionless	REAL	4	-999	spline params 8
+sp9	dimensionless	REAL	4	-999	spline params 9
+sp10	dimensionless	REAL	4	-999	spline params 10
+sp11	dimensionless	REAL	4	-999	spline params 11
+sp12	dimensionless	REAL	4	-999	spline params 12
+sp13	dimensionless	REAL	4	-999	spline params 13
+sp14	dimensionless	REAL	4	-999	spline params 14
+sp15	dimensionless	REAL	4	-999	spline params 15
+sp16	dimensionless	REAL	4	-999	spline params 16
+sp17	dimensionless	REAL	4	-999	spline params 17
+sp18	dimensionless	REAL	4	-999	spline params 18
+sp19	dimensionless	REAL	4	-999	spline params 19
+sp20	dimensionless	REAL	4	-999	spline params 20
+sp21	dimensionless	REAL	4	-999	spline params 21
+sp22	dimensionless	REAL	4	-999	spline params 22
+sp23	dimensionless	REAL	4	-999	spline params 23
+sp24	dimensionless	REAL	4	-999	spline params 24
+sp25	dimensionless	REAL	4	-999	spline params 25
+sp26	dimensionless	REAL	4	-999	spline params 26
+sp27	dimensionless	REAL	4	-999	spline params 27
+sp28	dimensionless	REAL	4	-999	spline params 28
+sp29	dimensionless	REAL	4	-999	spline params 29
+sp30	dimensionless	REAL	4	-999	spline params 30
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStarGalQSOSep
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStarGalQSOSep	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStarGalQSOSep	(revision 38152)
@@ -0,0 +1,10 @@
+pcsStarGalQSOSep
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID		dimensionless	BIGINT	8	NA	ODM object identifier index
+ippObjID	dimensionless	BIGINT	8	NA	IPP object number
+pcsSGSepRecipeIDdimensionless	INT	4	NA	recipe for the star/galaxy/quasar separation
+probStar	percentage	FLOAT	8	-999	probability object is a star
+probGalaxy	percentage	FLOAT	8	-999	probability object is a galaxy
+probQuasar	percentage	FLOAT	8	-999	probability object is a quasar
+flags		dimensionless	INT	4	-999	flags
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStellarParams
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStellarParams	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/pcsStellarParams	(revision 38152)
@@ -0,0 +1,11 @@
+pcsStellarParams s
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID				dimensionless	BIGINT	8	NA	ODM object identifier index
+ippObjID			dimensionless	BIGINT	8	NA	IPP object number
+pcsStellarParamsRecipeID	dimensionless	INT	4	-999	recipe for the star/galaxy/quasar separation
+Teff	dimensionless	REAL	4	-999	N/A
+A0	dimensionless	REAL	4	-999	N/A
+Fe_H	dimensionless	REAL	4	-999	N/A
+flags	dimensionless	INT	4	-999	flags
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/ppmObj
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/ppmObj	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/ppmObj	(revision 38152)
@@ -0,0 +1,25 @@
+PPM
+Description: Proper motions and parallax associated with defined objects. 
+
+Name Unit Data Type Size Default Value Description
+objID		BIGINT 8 NA ODM object identifier
+ippObjID   	BIGINT 8 NA IPP object identifier index
+ppmID           BIGINT 8 NA ppm object identifier ( ppmToObject metatable?)
+meanEpoch	FLOAT 	8 	-999 	mean epoch of observations in Mean Julian Days
+elapseTime 	REAL 4 -999 Elapsed time of astrometric observations
+muRa 		REAL 4 -999 proper motion in RA
+muRaErr 	REAL 4 -999 error in proper motion in RA
+muDec 		REAL 4 -999 proper motion in DEC
+muDecErr 	REAL 4 -999 error in proper motion in Dec
+mu 		REAL 4 -999 total proper motion
+muErr 		REAL 4 -999 error in total proper motion
+theta 		REAL 4 -999 angle of parallax vector from N in degrees
+plx 		REAL 4 -999 total parallax
+plxErr 		REAL 4 -999 error in total parallax
+nAstro 		SMALLINT 2 -999 number of measures in astrometric fit
+rmsRA 		REAL 4 -999 rms of astrometric error in RA
+rmsDec 		REAL 4 -999 rms of astrometric error in Dec
+wiggle 		TINYINT 1 255 flag/pointer to astrometric orbit
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/tcsClassification
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/tcsClassification	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Derived_Data_Product_Tables/tcsClassification	(revision 38152)
@@ -0,0 +1,16 @@
+galExtinction 
+Name	Unit	Data Type	Size	Default Value	Description
+
+objID				dimensionless	BIGINT	8	NA	ODM object identifier index
+ippObjID			dimensionless	BIGINT	8	NA	IPP object number
+diffobjID 			dimensionless	BIGINT	8	NA	IPP object number
+
+From Stephen and Ken?
+
+TransientName                                                           eg. PS1-10jh
+transientClass                                                          TDE
+ATEL                                                           -999     Astronomical Telegram number
+
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection	(revision 38152)
@@ -0,0 +1,65 @@
+objID           dimensionless   BIGINT  8         NA    ODM object identifier
+uniquePspsP2id dimensionless BIGINT  8         NA    unique identifier for psps based on batch_id, OTA, and counter (per detection)
+detectID        dimensionless   BIGINT  8         NA    ODM detection identifier
+ippObjID        dimensionless   BIGINT  8         NA    detection id generated by IPP
+ippDetectID     dimensionless   BIGINT  8         NA    detection id generated by IPP
+filterID        dimensionless   TINYINT 1         NA    filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+surveyID        dimensionless   TINYINT 1         NA    survey flag identifier
+imageID         dimensionless   BIGINT  8         NA    image id hash of frame identifier & OTA/CCD number
+randomDetID     dimensionless   BIGINT  8         NA    random detection Id
+dvoRegionID     dimensionless   INT     4          0    identifier to dvo spatial region
+obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+xPos            raw pixels      REAL    4       -999    measured x on CCD from PSF fit
+yPos            raw pixels      REAL    4       -999    measured y on CCD from PSF fit
+xPosErr         raw pixels      REAL    4       -999    estimated error in x
+yPosErr         raw pixels      REAL    4       -999    estimated error in y
+pltScale        arcsec/pix      REAL    4       -999    plate scale at this location (from DVO)
+posAngle        degrees         REAL    4       -999    position angle (sky-to-chip) at this location (from DVO)
+------------------------------------------------------  Note - next 8 lines came from previous DetCalib table
+ra              degrees         FLOAT   8         NA    Right Ascension
+dec             degrees         FLOAT   8         NA    Declination
+raErr           arcsec          REAL    4         NA    Right Ascension error
+decErr          arcsec          REAL    4         NA    Declination error
+extNSigma       dimensionless          REAL    4        -999   measure of extendedness
+zp              magnitude       REAL    4          0    zeropoint (only thing needed to convert adu/sec to AB mag), note no zpErr
+telluricExt     magnitude       REAL    4         NA    estimated extinction due to non-photometric conditions  
+expTime         seconds         REAL    4       -999    exposure time (informational)
+airMass         dimensionless   REAL    4          0    airmass (informational)
+------------------------------------------------------  
+psfFlux         adu/seconds     REAL    4       -999    PSF instrumental flux (in analog-to-digital units/sec) or adu/sec
+psfFluxErr      adu/seconds     REAL    4       -999    estimated error in flux
+psfMajorFWHM    arcsec          REAL    4       -999    model PSF width in major axis
+psfMinorFWHM    arcsec          REAL    4       -999    model PSF width in minor axis
+psfTheta        degrees         REAL    4       -999    model PSF orientation angle degrees East of North
+psfCore         dimensionless   REAL    4       -999    model PSF core parameter [k in (1 + kz + z^1.66)]
+psfQf           dimensionless   REAL    4       -999    PSF coverage factor
+psfQfPerfect    dimensionless   REAL    4       -999    PSF-weighted fraction of pixels totally unmasked
+psfChiSq        dimensionless   REAL    4       -999    reduced-chisq of the psf model fit. (ndof?, npix?)
+psfLikelihood   dimensionless   REAL    4       -999    PSF likelihood
+momentXX        arcsec^2        REAL    4       -999    moment XX
+momentXY        arcsec^2        REAL    4       -999    moment XY
+momentYY        arcsec^2        REAL    4       -999    momeny YY
+momentR1        arcsec          REAL    4       -999    first radial moment 
+momentRH        arcsec          REAL    4       -999    half light radius
+momentM3C       arcsec^n        REAL    4       -999    3rd moment sin(theta) 
+momentM3S       arcsec^n        REAL    4       -999    3rd moment cos(theta) 
+momentM4C       arcsec^n        REAL    4       -999    4th moment sin(theta)
+momentM4S       arcsec^n        REAL    4       -999    4th moment cos(theta) 
+apFlux          adu/seconds     REAL    4       -999    Aperture flux
+apFluxErr       adu/seconds     REAL    4       -999    Aperture flux error
+apFillF         dimensionless   REAL    4       -999    Aperture fill factor 
+apRadius        arcsec          REAL    4       -999    Aperture radius
+kronFlux        adu/seconds     REAL    4       -999    Kron flux
+kronFluxErr     adu/seconds     REAL    4       -999    Kron flux error
+kronRad         arcsec      	REAL    4       -999    Kron radius
+sky             adu/sec/pixel   REAL    4       -999    PSF sky level at source
+skyErr          adu/sec/pixel   REAL    4       -999    estimated error in sky
+infoFlag        dimensionless   INT     4       -999    flag indicating provenance information
+infoFlag2       dimensionless   INT     4       -999    flag indicating provenance information
+dataRelease     dimensionless   TINYINT 1         NA    Data release when this detection was originally taken. Recalibrations do not affect this value.
+--
+-- [231 bytes/det]
+
+### do we want apRadius?
+### relevant code spots:
+### config/tables.P2.vot, detectionbatch.py:315
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/Detection.txt	(revision 38152)
@@ -0,0 +1,59 @@
+
+objID           + dvo = average.extID [calculated in addstar]
+uniquePspsP2id + ipptopsps : combination of batch_id, ota, and counter
+detectID        + dvo = measure.extID [calculated in addstar]
+ippObjID        + dvo = average.objID + (average.catID << 32) [NOTE: this is a change in definition]
+ippDetectID     + smf:IPP_IDET
+filterID        + ipptopsps : internal, lookup from filter (grizy)
+surveyID        + ipptopsps : internal, from survey name
+imageID         - ipptopsps : expID x y (*** is this right???) (smf:IMAGEID / gpc1.chipRun.chip_image_id)_
+randomDetID     + ipptopsps : RANDOM from sql
+dvoRegionID     + dvo:average.catID
+obsTime         + smf:MJD-OBS + 0.5 EXPTIME / 84600
+xPos            + smf:X_PSF 
+yPos            + smf:Y_PSF
+xPosErr         + smf:X_PSF_SIG
+yPosErr         + smf:Y_PSF_SIG
+pltScale        + smf:PLTSCALE (negative -> sky parity)
+posAngle        + smf:POSANGLE
+---------------
+ra              + dvo:measure.ra
+dec             + dvo:measure.dec
+raErr           + smf:X_PSF_SIG * abs(PLTSCALE)
+decErr          + smf:Y_PSF_SIG * abs(PLTSCALE)
+extNSigma       + smf:EXT_NSIGMA
+zp              + dvo / dvopsps : zp
+telluricExt     + dvo / dvopsps : zp - zpNominal (dvopsps)
+expTime         + dvo:measure.dt [converted to seconds]
+airMass         + dvo:measure.airmass
+---------------
+psfFlux         + smf:PSF_INST_FLUX / EXPTIME
+psfFluxErr      + smf:PSF_INST_FLUX_SIG / EXPTIME
+psfMajorFWHM    + smf:PSF_FWHM_MAJ
+psfMinorFWHM    + smf:PSF_FWHM_MIN
+psfTheta        + smf:PSF_THETA
+psfCore         + smf:PSF_CORE
+psfQf           + smf:PSF_QF
+psfQfPerfect    + smf:PSF_QF_PERFECT
+psfChiSq        + smf:PSF_CHISQ
+psfLikelihood   + smf:EXT_NSIGMA
+momentXX        + smf:MOMENTS_XX
+momentXY        + smf:MOMENTS_XY
+momentYY        + smf:MOMENTS_YY
+momentR1        + smf:MOMENTS_R1
+momentRH        + smf:MOMENTS_RH
+momentM3C       + smf:MOMENTS_M3C
+momentM3S       + smf:MOMENTS_M3S
+momentM4C       + smf:MOMENTS_M4C
+momentM4S       + smf:MOMENTS_M4S
+apFlux          + smf:AP_FLUX
+apFluxErr       + smf:AP_FLUX_SIG
+apFillF         + smf:AP_NPIX / (pi * (AP_MAG_RADIUS - 0.5)^2)
+kronFlux        + smf:KRON_FLUX
+kronFluxErr     + smf:KRON_FLUX_ERR
+kronRad         + smf:2.5*MOMENTS_R1
+sky             + smf:SKY / exptime
+skyErr          + smf:SKY_SIGMA / exptime
+infoFlag        + smf:FLAGS
+infoFlag2       + smf:FLAGS2 | (dvo.measure.flags << 13)
+dataRelease     + ippToPsps : user input (skychunk.dataRelease)
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject	(revision 38152)
@@ -0,0 +1,37 @@
+
+diffObjName     string          VAR     8       NA      IAU Name constructed from objID postion PS1.x JHHMMSS.SS+/-DDMMSS.S x procesing version       
+diffObjID	dimensionless 	BIGINT 	8 	NA 	ODM object identifier index
+uniquePspsDOid dimentionless BIGINT  8	NA	unique id provided by ipptopsps, based on batch_Id + counter
+ippObjID  	dimensionless 	BIGINT 	8 	NA 	IPP object number
+surveyID 	dimensionless 	TINYINT 1 	255 	Survey ID
+htmID 		dimensionless 	BIGINT 	8 	NA 	HTM index
+zoneID 		dimensionless 	INT 	4 	NA 	Zone index
+randomDiffObjID 	dimensionless 	BIGINT 	8 	0 	Random integer between 0 and 2^32 = 4,394,967,296 remaining ramdom integer 0  
+batchID 	dimensionless	BIGINT 	8 	-999 	
+dvoRegionID     dimensionless  	INT     4       -999    identifier to dvo spatial region
+objInfoFlag 	dimensionless 	BIGINT 	8 	-999 	flag indicating odd properties
+qualityFlag 	dimensionless 	TINYINT 1 	0 	subset of objInfoFlag - flags related to goodness of object
+consistencyFlag	dimensionless 	SMALLINT2 	0 	Value computed from associated detections, it is originally given by IPP and should agree with the ODM validation (DROP)
+ra 		degrees 	FLOAT 	8 	NA 	Right Ascension
+dec 		degrees 	FLOAT 	8 	NA 	Declination
+raErr 		arcsec 		REAL 	4 	0.0 	Right Ascension error
+decErr 		arcsec 		REAL 	4 	0.0 	Declination error
+cx              dimensionless	FLOAT 	8 	NA 	Cartesian x
+cy 	        dimensionless	FLOAT 	8 	NA 	Cartesian y
+cz              dimensionless	FLOAT 	8 	NA 	Cartesian z
+lambda 		degrees 	FLOAT 	8 	-999 	ecliptic longitude
+beta 		degrees 	FLOAT 	8 	-999 	ecliptic latitude
+l 		degrees 	FLOAT 	8 	-999 	galactic longitude
+b 		degrees 	FLOAT 	8 	-999 	galactic latitude
+gQfPerfect 	dimensionless 	REAL 	4 	-999 	qfPerfect for g filter
+rQfPerfect 	dimensionless 	REAL 	4 	-999 	qfPerfect for r filter
+iQfPerfect 	dimensionless 	REAL 	4 	-999 	qfPerfect for i filter
+zQfPerfect 	dimensionless 	REAL 	4 	-999 	qfPerfect for z filter
+yQfPerfect 	dimensionless 	REAL 	4 	-999 	qfPerfect for y filter
+dataRelease 	dimensionless 	TINYINT 1 	NA 	Data release Version of this table
+nDetections 	dimensionless 	SMALLINT2 	-999 	total number of detection measurements in all filters
+ng 		dimensionless 	SMALLINT2 	-999 	number of detections in g filter
+nr 		dimensionless 	SMALLINT2 	-999 	number of detections in g filter
+ni 		dimensionless 	SMALLINT2 	-999 	number of detections in g filter
+nz 		dimensionless 	SMALLINT2 	-999 	number of detections in g filter
+ny 		dimensionless 	SMALLINT2 	-999 	number of detections in g filter
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetObject.txt	(revision 38152)
@@ -0,0 +1,37 @@
+		
+diffObjName      = ipptopsps
+diffObjID	 = dvo:cpt.extID
+uniquePspsDOid = ipptopsps
+ippObjID  	 = dvo:cpt.objID | cpt.catID <<32
+surveyID 	 = ipptopsps
+htmID 		 = PSPS
+zoneID 		 = PSPS
+randomDiffObjID 	 = ipptopsps
+batchID 	 = ipptopsps
+dvoRegionID      = dvo:cpt:catID 
+objInfoFlag 	 = dvo:cpt.flags
+qualityFlag 	 = dvo:cpt.flags >> 24 & 0xff (needed??)
+consistencyFlag	 = ?
+ra 		 = dvo:cpt.RA_MEAN
+dec 		 = dvo:cpt.DEC_MEAN
+raErr 		 = dvo:cpt.RA_ERR
+decErr 		 = dvo:cpt.DEC_ERR
+cx               = PSPS
+cy 	         = PSPS
+cz               = PSPS
+lambda 		 = PSPS
+beta 		 = PSPS
+l 		 = PSPS
+b 		 = PSPS
+gQfPerfect 	 = dvo:secfilt.PSF_QF_PERF_MAX
+rQfPerfect 	 = dvo:secfilt.PSF_QF_PERF_MAX
+iQfPerfect 	 = dvo:secfilt.PSF_QF_PERF_MAX
+zQfPerfect 	 = dvo:secfilt.PSF_QF_PERF_MAX
+yQfPerfect 	 = dvo:secfilt.PSF_QF_PERF_MAX
+dataRelease 	 = ipptopsps
+nDetections 	 = ipptopsps:sum of ng+nr+ni+nz+ny
+ng 		 = dvo:secfilt.nwarp
+nr 		 = dvo:secfilt.nwarp
+ni 		 = dvo:secfilt.nwarp
+nz 		 = dvo:secfilt.nwarp
+ny 		 = dvo:secfilt.nwarp
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection	(revision 38152)
@@ -0,0 +1,70 @@
+
+diffObjID	dimensionless 	BIGINT 	8 	NA 	diff object identifier
+uniquePspsDFid dimensionless BIGINT  8	NA	unique psps id (combination of batch_id, and counter) provided by ipptopsps
+diffDetID 	dimensionless 	BIGINT 	8 	NA 	diff detection identifier
+diffDetMetaID 	dimensionless 	BIGINT 	8 	NA 	diff detection meta identifier
+ippDetectID 	dimensionless 	BIGINT 	8 	NA 	ipp detection id generated by IPP
+ippObjID 	dimensionless 	BIGINT 	8 	NA 	ipp object id generated by IPP
+filterID 	dimensionless 	TINYINT	1 	NA 	filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+surveyID 	dimensionless 	TINYINT	1 	NA 	survey flag identifierr
+randomDiffID 	dimensionless 	BIGINT 	8 	NA 	random diff id  
+skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+dvoRegionID     dimensionless   INT     4          0    identifier to dvo spatial region
+obsTime 	MeanJulianDays 	FLOAT 	8 	-999 	Time of mid observation of positive detection in Mean Julian Days of positive detection
+xPos 		pixels 		REAL 	4 	-999 	measured x on diff image sky cell PSF fit
+yPos 		pixels 		REAL 	4 	-999 	measured y on diff image sky cell from PSF fit
+xPosErr 	pixels 		REAL 	4 	-999 	estimated error in x
+yPosErr 	pixels 		REAL 	4 	-999 	estimated error in y
+pltScale        arcsec/pix      REAL    4       -999    plate scale at this location (from DVO)
+posAngle        degrees         REAL    4       -999    position angle (sky-to-chip) at this location (from DVO)
+----------------------------------------------------    next 8 came from old DiffDetCalib, zp derived from cpt tables of BOTH images 
+ra              degrees         FLOAT   8       NA      Right Ascension
+dec             degrees         FLOAT   8       NA      Declination
+raErr           arcsec          REAL    4       NA      Right Ascension error -> posErr because RA,Dec same?
+decErr          arcsec          REAL    4       NA      Declination error
+zp              magnitude       REAL    4       0       zeropoint (all that is needed to convert adu/sec to AB mag), no zpErr
+telluricExt     magnitude       REAL    4       NA      estimated extinction due to non-photometric conditions  
+expTime         seconds         REAL    4       -999    exposure time (informational)
+airMass         dimensionless   REAL    4       0       airmass (informational)
+-----------------------------------------------------   attributes of positive detection
+psfFlux 	adu/seconds 	REAL 	4 	-999 	PSF instrumental flux (in analog-to-digital units/sec) or adu/sec
+psfFluxErr 	adu/seconds 	REAL 	4 	-999 	estimated error in flux
+psfMajorFWHM    arcsec          REAL    4       -999    model PSF width in major axis
+psfMinorFWHM    arcsec          REAL    4       -999    model PSF width in minor axis
+psfTheta        degrees         REAL    4       -999    model PSF orientation angle degrees East of North
+psfCore         dimensionless   REAL    4       -999    model PSF core parameter [k in (1 + kz + z^1.66)]
+psfQf 		dimensionless 	REAL 	4 	-999 	PSF coverage factor
+psfQfPerfect 	dimensionless 	REAL 	4 	-999 	PSF-weighted fraction of pixels totally unmasked
+psfChiSq 	dimensionless 	REAL 	4 	-999 	reduced-chisq of the psf model fit. (ndof?, npix?)
+psfLikelihood 	dimensionless 	REAL 	4 	-999 	PSF likelihood
+momentXX 	arcsec^2     	REAL 	4 	-999 	moment XX
+momentXY 	arcsec^2     	REAL 	4 	-999 	moment XY
+momentYY 	arcsec^2     	REAL 	4 	-999 	momeny YY
+momentR1 	arcsec       	REAL 	4 	-999 	first radial moment 
+momentRH 	arcsec       	REAL 	4 	-999 	half light radius  
+momentM3C 	arcsec^3     	REAL 	4 	-999 	3rd moment sin(theta) 
+momentM3S 	arcsec^3     	REAL 	4 	-999 	3rd moment cos(theta) 
+momentM4C 	arcsec^4     	REAL 	4 	-999 	4th moment sin(theta)
+momentM4S  	arcsec^4     	REAL 	4 	-999 	4th moment cos(theta) 
+apFlux 		adu/seconds 	REAL 	4 	-999 	Aperture flux
+apFluxErr 	adu/seconds 	REAL 	4 	-999 	Aperture flux error
+apFillF         dimensionless   REAL    4       -999    Aperture fill factor 
+kronFlux 	adu/seconds 	REAL 	4 	-999 	Kron flux
+kronFluxErr 	adu/seconds 	REAL 	4 	-999 	Kron flux error
+kronRad 	raw pixels 	REAL 	4 	-999 	Kron radius
+------------------------------------------------------- from diff image cmf/smf files 
+diffNPos        dimensionless   REAL    4       -999    npix > 3sigma
+diffFRatio      dimensionless   REAL    4       -999    fPos/(fPos +fNeg)
+diffNBad        dimensionless   REAL    4       -999    nPos/(nPos+nNeg)
+diffNMask       dimensionless   REAL    4       -999    nPos/(nPos + nMask)
+diffNAll        dimensionless   REAL    4       -999    nPos/(nPos + nMask + nNeg)
+diffPdist       arcsec          REAL    4       -999    distance to positive match source
+diffNdist       arcsec          REAL    4       -999    distance to negative match source
+diffPSN         dimensionless   REAL    4       -999    signal to noise of pos match source
+diffNSN         dimensionless   REAL    4       -999    signal to noise of neg match source
+-------------------------------------------------------
+sky 		adu/sec/pixel 	REAL 	4 	-999 	PSF sky level at source
+skyErr 		adu/sec/pixel 	REAL 	4 	-999 	estimated error in sky
+infoFlag 	dimensionless 	INT     4 	-999 	flag indicating provenance information
+infoFlag2	dimensionless 	INT     4 	-999 	flag indicating provenance information
+dataRelease 	dimensionless 	TINYINT	1 	NA 	Data release when this detection was originally taken. Recalibrations do not affect this value.
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/DiffDetection.txt	(revision 38152)
@@ -0,0 +1,71 @@
+		
+diffObjID	 = dvo / addstar
+uniquePspsDFid   = ipptopsps		 
+diffDetID 	 = dvo / addstar
+diffDetMetaID 	 = dvo / addstar
+ippDetectID 	 = dvo / addstar
+ippObjID 	 = dvo / addstar
+filterID 	 = smf / ipptopsps
+surveyID 	 = ipptopsps
+randomDiffID 	 = ipptopsps
+skyCellID        = smf header
+dvoRegionID      = dvo / catID
+obsTime 	 = smf
+xPos 		 = smf
+yPos 		 = smf
+xPosErr 	 = smf
+yPosErr 	 = smf
+pltScale         = smf
+posAngle         = smf
+---------------- = 
+ra               = dvo / relastro? [allow / require relastro recalibration?]
+dec              = dvo / relastro?
+raErr            = dvo / relastro?
+decErr           = dvo / relastro?
+zp               = dvo / relphot
+telluricExt      = (zp - zpNominal) dvopsps
+expTime          = smf
+airMass          = smf
+---------------- = 
+psfFlux 	 = smf
+psfFluxErr 	 = smf
+psfMajorFWHM     = [PSF_MAJOR is Sxx parameter, NOT FWHM] [ADD PSF_MAJ_FWHM to smf, keep PSF_MAJOR]
+psfMinorFWHM     = [PSF_MAJOR is Sxx parameter, NOT FWHM] [ditto]
+psfTheta         = smf
+psfCore          = [XXX : not currently written out!!]
+psfQf 		 = smf
+psfQfPerfect 	 = smf
+psfChiSq 	 = smf
+psfLikelihood 	 = ipptopsps
+momentXX 	 = smf
+momentXY 	 = smf
+momentYY 	 = smf
+momentR1 	 = smf
+momentRH 	 = smf [XXX : MOMENTS_RH is NOT half-light radius]
+momentM3C 	 = smf
+momentM3S 	 = smf
+momentM4C 	 = smf
+momentM4S  	 = smf
+apFlux 		 = smf [PS1_DV2 or later]
+apFluxErr 	 = smf [PS1_DV2 or later]
+apFillF          = [XXX : not currently calculated]
+kronFlux 	 = smf
+kronFluxErr 	 = smf
+kronRad 	 = (2.5*R1)
+---------------- = 
+diffNPos         = smf
+diffFRatio       = smf
+diffNBad         = smf
+diffNMask        = smf
+diffNAll         = smf
+diffPdist        = smf
+diffNdist        = smf
+diffPSN          = smf
+diffNSN          = smf
+---------------- = 
+sky 		 = smf
+skyErr 		 = smf
+infoFlag 	 = smf
+infoFlag2	 = smf
+dataRelease 	 = ipptopsps
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing	(revision 38152)
@@ -0,0 +1,34 @@
+
+objID           dimensionless   BIGINT   8        NA    ODM object identifier index
+uniquePspsFOid dimensionless BIGINT   8	  NA 	unique id supplied by ipptopsps
+ippObjID        dimensionless   BIGINT   8        NA    IPP object identifier
+randomForcedMeanObjID dimensionless BIGINT   8    NA    random number for this object  
+nDetections     dimensionless   SMALLINT 2      -999    total number of detection measurements in all filters
+batchID         dimensionless   BIGINT   8        NA    batch id 
+-----------------------------------------------------   replicate to bottom for each filter
+gLensObjSmearX11 arcsec^-2      REAL     4      -999    per-object smear polarizability X11 term
+gLensObjSmearX12 arcsec^-2      REAL     4      -999    per-object smear polarizability X12 term
+gLensObjSmearX22 arcsec^-2      REAL     4      -999    per-object smear polarizability X22 term
+gLensObjSmearE1  arcsec^-2      REAL     4      -999    per-object smear polarizability E1 term
+gLensObjSmearE2  arcsec^-2      REAL     4      -999    per-object smear polarizability E2 term
+gLensObjShearX11 dimensionless  REAL     4      -999    per-object shear polarizability X11 term
+gLensObjShearX12 dimensionless  REAL     4      -999    per-object shear polarizability X12 term
+gLensObjShearX22 dimensionless  REAL     4      -999    per-object shear polarizability X22 term
+gLensObjShearE1  dimensionless  REAL     4      -999    per-object shear polarizability E1 term
+gLensObjShearE2  dimensionless  REAL     4      -999    per-object shear polarizability E2 term
+gLensPSFSmearX11 arcsec^-2      REAL     4      -999    psf model smear polarizability X11 term
+gLensPSFSmearX12 arcsec^-2      REAL     4      -999    psf model smear polarizability X12 term
+gLensPSFSmearX22 arcsec^-2      REAL     4      -999    psf model smear polarizability X22 term
+gLensPSFSmearE1  arcsec^-2      REAL     4      -999    psf model smear polarizability E1 term
+gLensPSFSmearE2  arcsec^-2      REAL     4      -999    psf model smear polarizability E2 term
+gLensPSFShearX11 dimensionless  REAL     4      -999    psf model shear polarizability X11 term
+gLensPSFShearX12 dimensionless  REAL     4      -999    psf model shear polarizability X12 term
+gLensPSFShearX22 dimensionless  REAL     4      -999    psf model shear polarizability X22 term
+gLensPSFShearE1  dimensionless  REAL     4      -999    psf model shear polarizability E1 term
+gLensPSFShearE2  dimensionless  REAL     4      -999    psf model shear polarizability E2 term
+gpsfE1		 dimensionless	REAL	 4	-999    psf model E1
+gpsfE2		 dimensionless	REAL	 4	-999    psf model E2
+
+-- duplicated for other filters
+-- [184 byte/obj/filter + 22 byte/obj]
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanLensing.txt	(revision 38152)
@@ -0,0 +1,38 @@
+		 
+objID            = cpt.extID
+uniquePspsFOid   = ipptopsps
+ippObjID         = cpt.objID | cpt.catID << 32
+randomForcedObjID = ipptopsps
+nDetections      = sql sum of cps.NCODE (xnTotal)
+batchID          = ipptopsps
+---------------- = 
+gLensObjSmearX11 = cpy.X11_SM_OBJ
+gLensObjSmearX12 = cpy.X12_SM_OBJ
+gLensObjSmearX22 = cpy.X22_SM_OBJ
+gLensObjSmearE1  = cpy.E1_SM_OBJ
+gLensObjSmearE2  = cpy.E2_SM_OBJ
+gLensObjShearX11 = cpy.X11_SH_OBJ
+gLensObjShearX12 = cpy.X12_SH_OBJ
+gLensObjShearX22 = cpy.X22_SH_OBJ
+gLensObjShearE1  = cpy.E1_SH_OBJ
+gLensObjShearE2  = cpy.E2_SH_OBJ
+gLensPSFSmearX11 = cpy.X11_SM_PSF
+gLensPSFSmearX12 = cpy.X12_SM_PSF
+gLensPSFSmearX22 = cpy.X22_SM_PSF
+gLensPSFSmearE1  = cpy.E1_SM_PSF
+gLensPSFSmearE2  = cpy.E2_SM_PSF
+gLensPSFShearX11 = cpy.X11_SH_PSF
+gLensPSFShearX12 = cpy.X12_SH_PSF
+gLensPSFShearX22 = cpy.X22_SH_PSF
+gLensPSFShearE1  = cpy.E1_SH_PSF
+gLensPSFShearE2  = cpy.E2_SH_PSF
+gpsfE1		 = cpy.PSF_E1
+gpsfE2		 = cpy.PSF_E2
+[NOTES:
+
+ * PSF Flux, Kron Flux, Ap Flux stats are all 
+   calculated from values in the existing Measure table
+
+ * R5 & R6 ap flux values & lensing parameters need
+   a new table
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject	(revision 38152)
@@ -0,0 +1,48 @@
+
+objID           dimensionless   BIGINT   8        NA    ODM object identifier index
+uniquePspsFOid dimensionless BIGINT   8	  NA 	unique id supplied by ipptopsps
+ippObjID        dimensionless   BIGINT   8        NA    IPP object identifier
+randomForcedObjID dimensionless BIGINT   8        NA    random number generated by ipptopsps
+nDetections     dimensionless   SMALLINT 2      -999    total number of detection measurements in all filters
+batchID         dimensionless   BIGINT   8        NA    batch id 
+-----------------------------------------------------   replicate to bottom for each filter
+gnTotal         dimensionless   SMALLINT 2      -999    number of detections in g filter
+gnIncPSFFlux     dimensionless   SMALLINT 2      -999    number of detections included in robust psf mean in g filter 
+gnIncKronFlux    dimensionless   SMALLINT 2      -999    number of detections included in robust mean of Kron flux in g filter
+gnIncApFlux      dimensionless   SMALLINT 2      -999    number of detections included in robust mean of Ap flux in g filter
+gnIncR5         dimensionless   SMALLINT 2      -999    number of detections included in robust mean of sdss ApFlx 5 in g filter
+gnIncR6         dimensionless   SMALLINT 2      -999    number of detections included in robust mean of sdss ApFlx 6 in g filter
+gnIncR7		dimensionless   SMALLINT 2	-999 	number of detections included in robust mean of sdss ApFlx 7 in g filter 
+------------------------------------------------------- one of the above also corresponds to the moments
+gPSFFlux         adu/seconds    REAL     4      -999    robust mean g psf AB magnitude (sigma clipping or MAP or go to 5 or 7 number sumary? 1/12 is ~9th percentile 
+gPSFFluxErr      adu/seconds    REAL     4      -999    estimated error of g psf AB magnitude mean (individual errors added in quadrature)
+gPSFFluxStd      dimensionless   REAL     4      -999    standard deviation of measurements included in the robust mean  
+gKronFlux        adu/seconds    REAL     4      -999    mean g kron AB magnitude
+gKronFluxErr     adu/seconds    REAL     4      -999    estimated error of g kron AB magnitude mean
+gKronFluxStd     dimensionless   REAL     4      -999    standard deviation of measurements included in the robust mean  
+gApFlux          adu/seconds    REAL     4      -999    mean g kron AB magnitude
+gApFluxErr       adu/seconds    REAL     4      -999    estimated error of g kron AB magnitude mean
+gApFluxStd       dimensionless   REAL     4      -999    standard deviation of measurements included in the robust mean  
+------------------------------------------------------
+gFmeanflxR5     adu/seconds     REAL     4      -999    Flux inside sdss r = 5 in g unconvolved stack  
+gFmeanflxR5Err  adu/seconds     REAL     4      -999    estimated error is flxR5
+gFmeanflxR5Std  adu/seconds     REAL     4      -999    estimated standard deviation in flxR5
+gFmeanflxR5Fill dimensionless   REAL     4      -999    estimated filling factor at R5
+gFmeanflxR6     adu/seconds     REAL     4      -999    Flux inside sdss r = 6 in g unconvolved stack 
+gFmeanflxR6Err  adu/seconds     REAL     4      -999    estimated error is flxR6
+gFmeanflxR6Std  adu/seconds     REAL     4      -999    estimated standard deviation in flxR6
+gFmeanflxR6Fill dimensionless   REAL     4      -999    estimated filling factor at R6
+gFmeanflxR7     adu/seconds     REAL     4      -999    Flux inside sdss r = 7 in g unconvolved stack 
+gFmeanflxR7Err  adu/seconds     REAL     4      -999    estimated error is flxR7
+gFmeanflxR7Std  adu/seconds     REAL     4      -999    estimated standard deviation in flxR7
+gFmeanflxR7Fill dimensionless   REAL     4      -999    estimated fillingfactor at R7
+
+gFlags          dimensionless   BIGINT   8        NA    flags for g forced
+------------------------------------------------------
+gGamma           arcsec^2       REAL     4      -999    second moment (Mxx + Myy)
+gE1              dimensionless  REAL     4      -999    polarization, KSB-corrected (Mxx - Myy) / (Mxx + Myy)
+gE2              dimensionless  REAL     4      -999    polarization, KSB-corrected 2Mxy / (Mxx + Myy)
+
+-- duplicated for other filters
+-- [184 byte/obj/filter + 22 byte/obj]
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedMeanObject.txt	(revision 38152)
@@ -0,0 +1,52 @@
+		 
+objID            = cpt.extID
+uniquePspsFOid   = ipptopsps
+ippObjID         = cpt.objID | cpt.catID << 32
+randomForcedObjID = ipptopsps
+nDetections      = sql sum of cps.NCODE (xnTotal)
+batchID          = ipptopsps
+---------------- = 
+gnTotal          = cps.NWARP
+gnIncPSFFlux     = cps.NUSED_WRP
+gnIncKronFlux    = cps.NUSED_KRON_WRP 
+gnIncApFlux      = cps.NUSED_AP_WRP
+gnIncR5          = cpy.NMEAS 
+gnIncR6          = cpy.NMEAS 
+gnIncR7		 = cpy.NMEAS
+---------------- = 
+gPSFFlux         = cps.FLUX_PSF_WRP
+gPSFFluxErr      = cps.FLUX_PSF_WRP_ERR
+gPSFFluxStd      = cps.FLUX_PSF_WRP_STD
+gKronFlux        = cps.FLUX_KRON_WRP
+gKronFluxErr     = cps.FLUX_KRON_WRP_ERR
+gKronFluxStd     = cps.FLUX_KRON_WRP_STD
+gApFlux          = cps.FLUX_AP_WRP
+gApFluxErr       = cps.FLUX_AP_WRP_ERR
+gApFluxStd       = cps.FLUX_AP_WRP_STD
+---------------- = 
+gFmeanflxR5      = cpy.FLUX_AP_R3
+gFmeanflxR5Err   = cpy.FLUX_ERR_AP_R3
+gFmeanflxR5Std   = cpy.FLUX_STD_AP_R3
+gFmeanflxR5Fill  = cpy.FLUX_FIL_AP_R3
+gFmeanflxR6      = cpy.FLUX_AP_R4
+gFmeanflxR6Err   = cpy.FLUX_ERR_AP_R4
+gFmeanflxR6Std   = cpy.FLUX_STD_AP_R4
+gFmeanflxR6Fill  = cpy.FLUX_FIL_AP_R4
+gFmeanflxR7      = cpy.FLUX_AP_R5
+gFmeanflxR7Err   = cpy.FLUX_ERR_AP_R5
+gFmeanflxR7Std   = cpy.FLUX_STD_AP_R5
+gFmeanflxR7Fill  = cpy.FLUX_FIL_AP_R5
+gFlags           = cps.FLAGS
+---------------- = 
+gGamma           = cpy.GAMMA
+gE1              = cpy.E1
+gE2              = cpy.E2
+
+[NOTES:
+
+ * PSF Flux, Kron Flux, Ap Flux stats are all 
+   calculated from values in the existing Measure table
+
+ * R5 & R6 ap flux values & lensing parameters need
+   a new table
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended	(revision 38152)
@@ -0,0 +1,31 @@
+
+objID           dimensionless   BIGINT  8       NA      ODM object identifier
+uniquePspsFWid dimentionless BIGINT  8	NA 	unique id supplied by ipptopsps
+detectID        dimensionless   BIGINT  8       NA      ODM detection identifier
+ippObjID        dimensionless   BIGINT  8       NA      ippobject id generated by IPP
+ippDetectID     dimensionless   BIGINT  8       NA      detection id generated by IPP
+filterID        dimensionless   TINYINT 1       NA      filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+surveyID        dimensionless   TINYINT 1       NA      survey flag identifier
+forcedWarpID    dimensionless   BIGINT  8       NA      IPP warp_id
+randomWarpID    dimensionless   BIGINT  8       NA      Random warp_id
+skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+dvoRegionID     dimensionless   INT     4       -999    identifier to dvo spatial region
+obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+------------------------------------------------------ 
+flxR5           adu/seconds     REAL    4       -999    Flux inside sdss r = 5
+flxR5Err        adu/seconds     REAL    4       -999    estimated error is flxR5
+flxR5Std        adu/seconds     REAL    4       -999    estimated standard deviation in flxR5
+flxR5Fill       dimensionless   REAL    4       -999    estimated filling factor at R5
+flxR6           adu/seconds     REAL    4       -999    Flux inside sdss r = 6
+flxR6Err        adu/seconds     REAL    4       -999    estimated error is flxR6
+flxR6Std        adu/seconds     REAL    4       -999    estimated standard deviation in flxR6
+flxR6Fill       dimensionless   REAL    4       -999    estimated filling factor at R6
+flxR7           adu/seconds     REAL    4       -999    Flux inside sdss r = 7
+flxR7Err        adu/seconds     REAL    4       -999    estimated error is flxR7
+flxR7Std        adu/seconds     REAL    4       -999    estimated standard deviation in flxR7
+flxR7Fill       dimensionless   REAL    4       -999    estimated filling factor at R7
+
+------------------------------------------------------ 
+
+-- [295 byte/det]
+-- this table is only for non-Galatic-plane data
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpExtended.txt	(revision 38152)
@@ -0,0 +1,28 @@
+
+objID            = cpt.extID
+uniquePspsFWid   = ipptopsps 
+detectID         = cpm.extID (???)
+ippObjID         = cpt.obj_ID | cpx.cat_ID << 32
+ippDetectID      = cmf.IPP_IDET
+filterID         = ipptopsps / gpc1
+surveyID         = ipptopsps 
+forcedWarpID     = ipptopsps / gpc1
+randomWarpID     = ipptopsps 
+skyCellID        = ipptopsps / gpc1
+dvoRegionID      = ipptopsps / gpc1
+obsTime          = cmf
+---------------- = 
+flxR5            = cmf.FLX_AP_R3
+flxR5Err         = cmf.FLX_ERR_AP_R3
+flxR5Std         = cmf.FLX_STD_AP_R3
+flxR5Fill        = cmf.FLX_FIL_AP_R3
+flxR6            = cmf.FLX_AP_R4
+flxR6Err         = cmf.FLX_ERR_AP_R4
+flxR6Std         = cmf.FLX_STD_AP_R4
+flxR6Fill        = cmf.FLX_FIL_AP_R4
+flxR7            = cmf.FLX_AP_R5
+flxR7Err         = cmf.FLX_ERR_AP_R5
+flxR7Std         = cmf.FLX_STD_AP_R5
+flxR7Fill        = cmf.FLX_FIL_AP_R5
+
+---------------- = 
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing	(revision 38152)
@@ -0,0 +1,41 @@
+
+objID           dimensionless   BIGINT  8       NA      ODM object identifier
+uniquePspsFWid dimentionless BIGINT  8	NA 	unique id supplied by ipptopsps
+detectID        dimensionless   BIGINT  8       NA      ODM detection identifier
+ippObjID        dimensionless   BIGINT  8       NA      ippobject id generated by IPP
+ippDetectID     dimensionless   BIGINT  8       NA      detection id generated by IPP
+filterID        dimensionless   TINYINT 1       NA      filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+surveyID        dimensionless   TINYINT 1       NA      survey flag identifier
+forcedWarpID    dimensionless   BIGINT  8       NA      IPP warp_id
+randomWarpID    dimensionless   BIGINT  8       NA      Random warp_id
+skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+dvoRegionID     dimensionless   INT     4       -999    identifier to dvo spatial region
+obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+------------------------------------------------------ 
+lensObjSmearX11 arcsec^-2       REAL    4       -999    per-object smear polarizability X11 term
+lensObjSmearX12 arcsec^-2       REAL    4       -999    per-object smear polarizability X12 term
+lensObjSmearX22 arcsec^-2       REAL    4       -999    per-object smear polarizability X22 term
+lensObjSmearE1  arcsec^-2       REAL    4       -999    per-object smear polarizability E1 term
+lensObjSmearE2  arcsec^-2       REAL    4       -999    per-object smear polarizability E2 term
+lensObjShearX11 dimensionless   REAL    4       -999    per-object shear polarizability X11 term
+lensObjShearX12 dimensionless   REAL    4       -999    per-object shear polarizability X12 term
+lensObjShearX22 dimensionless   REAL    4       -999    per-object shear polarizability X22 term
+lensObjShearE1  dimensionless   REAL    4       -999    per-object shear polarizability E1 term
+lensObjShearE2  dimensionless   REAL    4       -999    per-object shear polarizability E2 term
+lensPSFSmearX11 arcsec^-2       REAL    4       -999    psf model smear polarizability X11 term
+lensPSFSmearX12 arcsec^-2       REAL    4       -999    psf model smear polarizability X12 term
+lensPSFSmearX22 arcsec^-2       REAL    4       -999    psf model smear polarizability X22 term
+lensPSFSmearE1  arcsec^-2       REAL    4       -999    psf model smear polarizability E1 term
+lensPSFSmearE2  arcsec^-2       REAL    4       -999    psf model smear polarizability E2 term
+lensPSFShearX11 dimensionless   REAL    4       -999    psf model shear polarizability X11 term
+lensPSFShearX12 dimensionless   REAL    4       -999    psf model shear polarizability X12 term
+lensPSFShearX22 dimensionless   REAL    4       -999    psf model shear polarizability X22 term
+lensPSFShearE1  dimensionless   REAL    4       -999    psf model shear polarizability E1 term
+lensPSFShearE2  dimensionless   REAL    4       -999    psf model shear polarizability E2 term
+psfE1		dimensionless	REAL	4	-999 	psf model E1
+psfE2		dimensionless	REAL	4	-999 	psf model E2
+
+------------------------------------------------------ 
+
+-- [295 byte/det]
+-- this table is only for non-Galatic-plane data
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpLensing.txt	(revision 38152)
@@ -0,0 +1,38 @@
+
+objID            = cpt.extID
+uniquePspsFWid   = ipptopsps 
+detectID         = cpm.extID (???)
+ippObjID         = cpt.obj_ID | cpx.cat_ID << 32
+ippDetectID      = cmf.IPP_IDET
+filterID         = ipptopsps / gpc1
+surveyID         = ipptopsps 
+forcedWarpID     = ipptopsps / gpc1
+randomWarpID     = ipptopsps 
+skyCellID        = ipptopsps / gpc1
+dvoRegionID      = ipptopsps / gpc1
+obsTime          = cmf
+---------------- = 
+lensObjSmearX11  = cmf.X11_SM_OBJ
+lensObjSmearX12  = cmf.X12_SM_OBJ
+lensObjSmearX22  = cmf.X22_SM_OBJ
+lensObjSmearE1   = cmf.E1_SM_OBJ
+lensObjSmearE2   = cmf.E2_SM_OBJ
+lensObjShearX11  = cmf.X11_SH_OBJ
+lensObjShearX12  = cmf.X12_SH_OBJ
+lensObjShearX22  = cmf.X22_SH_OBJ
+lensObjShearE1   = cmf.E1_SH_OBJ
+lensObjShearE2   = cmf.E2_SH_OBJ
+lensPSFSmearX11  = cmf.X11_SM_PSF
+lensPSFSmearX12  = cmf.X12_SM_PSF
+lensPSFSmearX22  = cmf.X22_SM_PSF
+lensPSFSmearE1   = cmf.E1_SM_PSF
+lensPSFSmearE2   = cmf.E2_SM_PSF
+lensPSFShearX11  = cmf.X11_SH_PSF
+lensPSFShearX12  = cmf.X12_SH_PSF
+lensPSFShearX22  = cmf.X22_SH_PSF
+lensPSFShearE1   = cmf.E1_SH_PSF
+lensPSFShearE2   = cmf.E2_SH_PSF
+psfE1            = cmf.psf_E1
+psfE2            = cmf.psf_E2
+
+---------------- = 
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement	(revision 38152)
@@ -0,0 +1,53 @@
+
+objID           dimensionless   BIGINT  8       NA      ODM object identifier
+uniquePspsFWid dimensionless BIGINT  8 	NA	unique identifier provided by ipptopsps
+detectID        dimensionless   BIGINT  8       NA      ODM detection identifier
+ippObjID        dimensionless   BIGINT  8       NA      ippobject id generated by IPP
+ippDetectID     dimensionless   BIGINT  8       NA      detection id generated by IPP
+filterID        dimensionless   TINYINT 1       NA      filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+surveyID        dimensionless   TINYINT 1       NA      survey flag identifier
+forcedWarpID    dimensionless   BIGINT  8       NA      IPP warp_id
+randomWarpID    dimensionless   BIGINT  8       NA      Random warp_id
+skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+dvoRegionID     dimensionless   INT     4       -999    identifier to dvo spatial region
+obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+------------------------------------------------------ 
+zp              magnitude       REAL    4       0       zeropoint (only thing needed to convert adu/sec to AB mag), note no zpErr
+telluricExt     magnitude       REAL    4       NA      estimated extinction due to non-photometric conditions  
+expTime         seconds         REAL    4       -999    exposure time (informational)
+airMass         dimensionless   REAL    4       0       airmass (informational)
+------------------------------------------------------ 
+psfFlux         adu/seconds     REAL    4       -999    PSF instrumental flux (in analog-to-digital units/sec) or adu/sec
+psfFluxErr      adu/seconds     REAL    4       -999    estimated error in flux
+psfMajorFWHM    arcsec          REAL    4       -999    model PSF width in major axis
+psfMinorFWHM    arcsec          REAL    4       -999    model PSF width in minor axis
+psfTheta        degrees         REAL    4       -999    model PSF orientation angle degrees East of North
+psfCore         dimensionless   REAL    4       -999    model PSF core parameter [k in (1 + kz + z^1.66)]
+psfQf           dimensionless   REAL    4       -999    PSF coverage factor
+psfQfPerfect    dimensionless   REAL    4       -999    PSF-weighted fraction of pixels totally unmasked
+psfChiSq        dimensionless   REAL    4       -999    reduced-chisq of the psf model fit. (ndof?, npix?)
+psfLikelihood   dimensionless   REAL    4       -999    PSF likelihood
+momentXX        arcsec^2        REAL    4       -999    moment XX
+momentXY        arcsec^2        REAL    4       -999    moment XY
+momentYY        arcsec^2        REAL    4       -999    momeny YY
+momentR1        arcsec^1        REAL    4       -999    first radial moment 
+momentRH        arcsec          REAL    4       -999    to be half light radius   (DROP)
+momentM3C       arcsec^3        REAL    4       -999    3rd moment sin(theta) 
+momentM3S       arcsec^3        REAL    4       -999    3rd moment cos(theta) 
+momentM4C       arcsec^4        REAL    4       -999    4th moment sin(theta)
+momentM4S       arcsec^4        REAL    4       -999    4th moment cos(theta) 
+
+apFlux          adu/seconds     REAL    4       -999    Aperture flux
+apFluxErr       adu/seconds     REAL    4       -999    Aperture flux error
+apFillF         dimensionless   REAL    4       -999    Aperture fill factor 
+kronFlux        adu/seconds     REAL    4       -999    Kron flux
+kronFluxErr     adu/seconds     REAL    4       -999    Kron flux error
+kronRad         arcsec          REAL    4       -999    Kron radius
+------------------------------------------------------ 
+sky             adu/sec/pixel   REAL    4       -999    PSF sky level at source
+skyErr          adu/sec/pixel   REAL    4       -999    estimated error in sky
+infoFlag        dimensionless   BIGINT  8       -999    flag indicating provenance information
+infoFlag2        dimensionless   BIGINT  8       -999    FLAG2 | flags << 13
+dataRelease     dimensionless   TINYINT 1       NA      Data release when this detection was originally taken. Recalibrations do not affect this value.
+
+-- [295 byte/det]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ForcedWarpMeasurement.txt	(revision 38152)
@@ -0,0 +1,51 @@
+
+objID            = cpt.extID (???)
+uniquePspsFWid   = ipptopsps 
+detectID         = cpm.extID (???)
+ippObjID         = cpt.obj_id | cpt.cat_id << 32
+ippDetectID      = smf:IPP_IDET
+filterID         = ipptopsps /gpc1
+surveyID         = ipptopsps
+forcedWarpID     = ipptopsps / gpc1
+randomWarpID     = ipptopsps
+skyCellID        = ipptopsps / gpc1
+dvoRegionID      = ipptopsps / gpc1
+obsTime          = smf
+---------------- = 
+zp               = dvopsps zp
+telluricExt      = dvopsps (zp - zpNominal)
+expTime          = smf
+airMass          = smf
+---------------- = 
+psfFlux          = smf:PSF_INST_FLUX / EXPTIME	 
+psfFluxErr       = smf:PSF_INST_FLUX_SIG / EXPTIME
+psfMajorFWHM     = smf:PSF_FWHM_MAJ
+psfMinorFWHM     = smf:PSF_FWHM_MIN
+psfTheta         = smf:PSF_THETA	    
+psfCore          = smf:PSF_CORE	    
+psfQf            = smf:PSF_QF	    
+psfQfPerfect     = smf:PSF_QF_PERFECT
+psfChiSq         = smf:PSF_CHISQ
+psfLikelihood    = smf:NEXT_NSIGMA
+momentXX         = smf:MOMENTS_XX
+momentXY         = smf:MOMENTS_XY
+momentYY         = smf:MOMENTS_YY
+momentR1         = smf:MOMENTS_R1
+momentRH         = smf:MOMENTS_RH
+momentM3C        = smf:MOMENTS_M3C
+momentM3S        = smf:MOMENTS_M3S
+momentM4C        = smf:MOMENTS_M4C
+momentM4S        = smf:MOMENTS_M4S
+		 = 
+apFlux           = smf:AP_FLUX				       
+apFluxErr        = smf:AP_FLUX_SIG			       
+apFillF          = smf:AP_NPIX / (pi * (AP_MAG_RADIUS - 0.5)^2)
+kronFlux         = smf:KRON_FLUX	    
+kronFluxErr      = smf:KRON_FLUX_ERR 
+kronRad          = smf:2.5*MOMENTS_R1
+---------------- = 
+sky              = smf:SKY / exptime	 
+skyErr           = smf:SKY_SIGMA / exptime
+infoFlag         = smf:FLAGS
+infoFlag2        = smf:FLAGS2 | (dvo.measure.flags << 13)
+dataRelease      = ipptopsps
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject	(revision 38152)
@@ -0,0 +1,28 @@
+             
+--              The  "best available" measurements refer first to those objects with qfPerfect > 0.85 and good flags, 
+--              but descends down a "waterfall logic" in ipp so that there exists a mean mag for less than ideal objects. The logic is given in Magnier etal 2013.
+
+objID           dimensionless   BIGINT   8       NA      ODM object identifier index
+uniquePspsOBid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+gQfPerfect      dimensionless   REAL     4       -999    maximum psf qfPerfect from best available g band detections 
+gMeanPSFMag     AB_magnitude    REAL     4       -999    mean g psf AB magnitude from best available measurements (best available as current defined by ipp "waterfall logic"  
+gMeanPSFMagErr  AB_magnitude    REAL     4       -999    estimated error of best availalbe g-band psf AB magnitudes (individual errors added in quadrature)
+gMeanPSFMagStd  dimensioless    REAL     4       -999    standard deviation of best available measurements - compared with MeanErr this is one measure of true variability  
+gMeanPSFMagMin  AB_magnitude    REAL     4       -999    minimum best available PSFMag - min and max are given for PSFMag as they may indicate variability.  
+gMeanPSFMagMax  AB_magnitude    REAL     4       -999    maximum best available PSFMag   
+gMeanPSFMagNpt  dimensionless   SMALLINT 2       -999    number of best available detections included in mean psfMag 
+					 
+gMeanKronMag    AB_magnitude    REAL     4       -999    mean g kron AB magnitude from best available measurements     
+gMeanKronMagErr AB_magnitude    REAL     4       -999    estimated error of mean g kron AB magnitude 
+gMeanKronMagStd dimensionless   REAL     4       -999    standard deviation of best available measurements   
+gMeanKronMagNpt dimensionless   SMALLINT 2       -999    number of best available detections included mean Kron mag 
+					 
+gMeanApMag      AB_magnitude    REAL     4       -999    mean g kron AB magnitude from best available measurements
+gMeanApMagErr   AB_magnitude    REAL     4       -999    estimated error of g kron AB magnitude mean
+gMeanApMagStd   dimensioless    REAL     4       -999    standard deviation of best available measurements   
+gMeanApMagNpt   dimensionless   SMALLINT 2       -999    number of detections included in best available mean of Kron mag in g filter
+
+gFlags          dimensionless   INT      4          0    flags for g mean [XXX secfilt.flags is 4byte] 
+-- duplicate for other filters
+
+[62 byte/obj/filter + 8 byte/filter]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/MeanObject.txt	(revision 38152)
@@ -0,0 +1,24 @@
+
+*** I've checked that these are plausible, not exact
+
+objID           + dvo / addstar
+uniquePspsOBid = ipptopsps 
+gQfPerfect      + dvo / relphot / secfilt.psfQfMax 
+gMeanPSFMag     + dvo / relphot / secfilt.M 
+gMeanPSFMagErr  + dvo / relphot / secfilt.dM
+gMeanPSFMagStd  + dvo / relphot / secfilt.Mstdev 
+gMeanPSFMagMin  + dvo / relphot / secfilt.Min
+gMeanPSFMagMax  + dvo / relphot / secfilt.Max
+gMeanPSFMagNpt  + dvo / relphot / secfilt.Nused
+
+gMeanKronMag    + dvo / relphot / secfilt.Mkron 
+gMeanKronMagErr + dvo / relphot / secfilt.dMkron
+gMeanKronMagStd + dvo / relphot / secfilt.sMkron
+gMeanKronMagNpt + dvo / relphot / secfilt.NusedKron
+
+gMeanApMag      + dvo / relphot / secfilt.Map
+gMeanApMagErr   + dvo / relphot / secfilt.dMap
+gMeanApMagStd   + dvo / relphot / secfilt.sMap
+gMeanApMagNpt   + dvo / relphot / secfilt.NusedAp
+
+gFlags          + dvo / relphot / secfilt.flags
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin	(revision 38152)
@@ -0,0 +1,52 @@
+
+objName          string         VAR      8      NA      IAU Name constructed from objID postion PS1.x JHHMMSS.SS+/-DDMMSS.S where x is leading number of procesing version       
+objID            dimensionless  BIGINT   8      NA      ODM object identifier index
+uniquePspsOBid   dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT   8      NA      IPP object number
+surveyID         dimensionless  TINYINT  1      255     Survey ID
+htmID            dimensionless  BIGINT   8      NA      HTM index
+zoneID           dimensionless  INT      4      NA      Zone index
+tessID           dimensionless  TINYINT  1       -1     ID mapping to tessellation names (eg, RINGS.V3, MD01.V3, etc)
+projectionID     dimensionless  SMALLINT 2       -999   valid values 0 - < 10000
+skyCellID        dimensionless  TINYINT  1       255    valid values 0 - 143 (12x12 grid)
+randomID         dimensionless  BIGINT   8      0       Random integer between 0 and 2^32 = 4,394,967,296 remaining ramdom integer 0  
+batchID          dimensionless  BIGINT   8      -999    batch id        
+dvoRegionID      dimensionless  INT      4      -999    identifier of dvo spatial region - dvo cat id
+dataRelease      dimensionless  TINYINT  1      NA      Data release Version of this table
+objInfoFlag      dimensionless  BIGINT   8      -999    flag indicating odd properties
+qualityFlag      dimensionless  TINYINT  1      0       subset of objInfoFlag - flags related to goodness of object
+consistencyFlag  dimensionless  SMALLINT 2      0       Value computed from associated detections, it is originally given by IPP and should agree with the ODM validation (DROP)
+raStack          degrees        FLOAT    8      -999    Right Ascension - best weighted RA across filters from stack WHENEVER an object is detected in the stack  
+decStack         degrees        FLOAT    8      -999    Declination - best weighted Dec across filters from stack WHENEVER an object is detected in the stack 
+raStackErr       arcsec         REAL     4      -999    Error in stack Right Ascension, note will have a systematic floor, and is not necessary the best ra,dec for all objects 
+decStackErr      arcsec         REAL     4      -999    Error in stack Declination, note will have a systematic floor, and is not necessarily the best ra,dec for all objects
+raMean           degrees        FLOAT    8      -999    Right Ascension from the Mean of RA from individual detections if it exists. This is for information only  
+decMean          degrees        FLOAT    8      -999    Declination from the Mean of Dec from individual detections if it exists  This is for information only.  
+raMeanErr        arcsec         REAL     4      -999    Combination of the measurement Errors in the Right Ascension from the mean detections if they exist 
+decMeanErr       arcsec         REAL     4      -999    Combination of the measurement Errors in the  Declination measurements if they exist  
+posMeanChisq     dimensionless  REAL     4      -999    chisq of mean position
+--------------------------------------------------------------------------------------------------------
+--                                                      Note: the following three sets of coordinate systems are based on stack if it exists, and mean if it does not.
+--                                                      This means cone or box searches work on the stack and consistent with Primary and Best stack detection.
+--                                                      For objects without a stack postion, (moving, transient, or false dectection) a cone search may be incomplete for
+--                                                      an object within less than 1 arc sec of the boundary edge. But science cases here will want to work from Detection
+--                                                      Table anyway, or can vary cone search by 1'' radius to check for incompleteness.  
+cx               dimensionless  FLOAT    8      NA      Cartesian x from Stack RA,Dec WHENEVER a stack detection exists, and Mean RA, Dec (mean of one?) when it doesn't 
+cy               dimensionless  FLOAT    8      NA      Cartesian y from Stack RA,Dec WHENEVER a stack detection exists, and mean RA, Dec (mean of one?) when it doesn't 
+cz               dimensionless  FLOAT    8      NA      Cartesian z from Stack RA,Dec WHENEVER a stack detection exists, ditto
+lambda           degrees        FLOAT    8      -999    ecliptic longitude from Stack RA,Dec WHENEVER A STACK MEASURMENT EXISTS and Mean RA,Dec (mean of one?) otherwise 
+beta             degrees        FLOAT    8      -999    ecliptic latitude ditto
+l                degrees        FLOAT    8      -999    galactic longitude ditto
+b                degrees        FLOAT    8      -999    galactic latitude ditto
+---------------------------------------------------------------------------------
+nStackObjectRows dimensionless  SMALLINT 2      -999    number of independent StackObjectRows this object has. 
+--                                                      zero if not detected in the Stack, 1 if there is a primary, 2 or more if it is in an overlap region
+nStackDetections dimensionless  TINYINT  2       255    which filter bands it is detected in (not forced) or if it was masked in a band.        
+nDetections      dimensionless  SMALLINT 2      -999    total number of detection measurements in all filters
+ng               dimensionless  SMALLINT 2      -999    number of detections in individual g filter exposures
+nr               dimensionless  SMALLINT 2      -999    number of detections in individual r filter exposures
+ni               dimensionless  SMALLINT 2      -999    number of detections in individual i filter exposures
+nz               dimensionless  SMALLINT 2      -999    number of detections in individual z filter exposures
+ny               dimensionless  SMALLINT 2      -999    number of detections in individual y filter exposures
+
+-- [197 byte/obj]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/ObjectThin.txt	(revision 38152)
@@ -0,0 +1,50 @@
+
+objName           - ipptopsps : move to dvopsps?
+objID             + dvo:average.extID
+uniquePspsOBid    = ipptopsps 
+ippObjID          + dvo:(average.objID | average.catID << 32)
+surveyID          + ipptopsps : internal, from survey name
+htmID             - PSPS
+zoneID            - PSPS
+tessID            + average.tessID
+projectionID      + average.projectionID
+skycellID         + average.skycellID
+randomID          + ipptopsps : RANDOM from sql
+batchID           + ipptopsps : internal
+dvoRegionID       + dvo:average.catID
+dataRelease       + ipptopsps : user input (skychunk.dataRelease)
+objInfoFlag       + dvo:average.flags
+qualityFlag       - (dvo:average.flags >> 24) & 0xFF *** correct??
+consistencyFlag   - *** hard-wired in ipptopsps to 0
+raStack           + dvo:average.Rstk *** not calculated?
+decStack          + dvo:average.Dstk *** not calculated?
+raStackErr        + dvo:average.dRstk *** not calculated?
+decStackErr       + dvo:average.dDstk *** not calculated?
+raMean            + dvo:average.R
+decMean           + dvo:average.D
+raMeanErr         + dvo:average.dR
+decMeanErr        + dvo:average.dD
+posMeanChisq      + dvo:average.ChiSqAve
+-----------------   
+--                  
+--                  
+--                  
+--                  
+--                  
+cx                - PSPS
+cy                - PSPS
+cz                - PSPS
+lambda            - PSPS
+beta              - PSPS
+l                 - PSPS
+b                 - PSPS
+----------------- 
+nStackObjectRows  - do in dvopsps
+--                
+nStackDetections  - sum of secfilt.NstackDet (sum in sql)
+nDetections       + ipptopsps:Sum of ng+nr in sql 
+ng                + dvo:secfilt.ncode ** check that this is right
+nr                + dvo:secfilt.ncode ** check that this is right
+ni                + dvo:secfilt.ncode ** check that this is right
+nz                + dvo:secfilt.ncode ** check that this is right
+ny                + dvo:secfilt.ncode ** check that this is right
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx	(revision 38152)
@@ -0,0 +1,56 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid   dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      ipp object identifier
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+------------------------------------------------------- replicate to end for each filter g,r,i,z,y
+gippDetectID    dimensionless   BIGINT  8       NA      stack identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+--------------------------------------------------------unconvolved
+gflxR5          Jy              REAL    4       -999    Flux inside sdss r = 5
+gflxR5Err       Jy              REAL    4       -999    estimated error is flxR5
+gflxR5Std       Jy              REAL    4       -999    estimated standard deviation in flxR5
+gflxR5Fill      dimensionless   REAL    4       -999    estimated filling factor at R5
+gflxR6          Jy              REAL    4       -999    Flux inside sdss r = 6
+gflxR6Err       Jy              REAL    4       -999    estimated error is flxR6
+gflxR6Std       Jy              REAL    4       -999    estimated standard deviation in flxR6
+gflxR6Fill      dimensionless   REAL    4       -999    estimated filling factor at R6
+gflxR7          Jy              REAL    4       -999    Flux inside sdss r = 7
+gflxR7Err       Jy              REAL    4       -999    estimated error is flxR7
+gflxR7Std       Jy              REAL    4       -999    estimated standard deviation in flxR7
+gflxR7Fill      dimensionless   REAL    4       -999    estimated filling factor at R7
+----------------------------------------------------    convolved across all bands to 6 or 8 pixels
+gc6flxR5        Jy              REAL    4       -999    Flux inside sdss r = 5
+gc6flxR5Err     Jy              REAL    4       -999    estimated error is c1flxR5
+gc6flxR5Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR5
+gc6flxR5Fill    dimensionless   REAL    4       -999    estimated filling factor at R5
+gc6flxR6        Jy              REAL    4       -999    Flux inside sdss r = 6
+gc6flxR6Err     Jy              REAL    4       -999    estimated error is c1flxR6
+gc6flxR6Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR6
+gc6flxR6Fill    dimensionless   REAL    4       -999    estimated filling factor at R6
+gc6flxR7        Jy              REAL    4       -999    Flux inside sdss r = 7
+gc6flxR7Err     Jy              REAL    4       -999    estimated error is c1flxR7
+gc6flxR7Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR7
+gc6flxR7Fill    dimensionless   REAL    4       -999    estimated filling factor at R7
+----------------------------------------------------    convolved across all bands to 6 or 8 pixels
+gc8flxR5        Jy              REAL    4       -999    Flux inside sdss r = 5
+gc8flxR5Err     Jy              REAL    4       -999    estimated error in c2flxR5
+gc8flxR5Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR5
+gc8flxR5Fill    dimensionless   REAL    4       -999    estimated filling factor at R5
+gc8flxR6        Jy              REAL    4       -999    Flux inside sdss r = 6
+gc8flxR6Err     Jy              REAL    4       -999    estimated error in c2flxR6
+gc8flxR6Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR6
+gc8flxR6Fill    dimensionless   REAL    4       -999    estimated filling factor at R6
+gc8flxR7        Jy              REAL    4       -999    Flux inside sdss r = 7
+gc8flxR7Err     Jy              REAL    4       -999    estimated error in c2flxR7
+gc8flxR7Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR7
+gc8flxR7Fill    dimensionless   REAL    4       -999    estimated filling factor at R7
+
+-- repeat for other filters with appropriate leading prefex.
+-- [168 byte/filter/obj + 44 byte/obj]
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlx.txt	(revision 38152)
@@ -0,0 +1,52 @@
+
+objID            + from StackObjectThin			      	      
+uniquePspsSTid = ipptopsps 
+ippObjID         + from StackObjectThin			      	      
+randomStackObjID + from StackObjectThin			      	      
+stackDetectRowID - PSPS					      	      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin 
+gstackMetaID     + from StackObjectThin 
+----------------  
+gflxR5           + cmf : APER_FLUX_3
+gflxR5Err        + cmf : APER_FLUX_ERR_3
+gflxR5Std        - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gflxR5Fill       + cmf : APER_FILL_3      
+gflxR6           + cmf : APER_FLUX_4	  
+gflxR6Err        + cmf : APER_FLUX_ERR_4  
+gflxR6Std        - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gflxR6Fill       + cmf : APER_FILL_4      
+gflxR7           + cmf : APER_FLUX_5	  
+gflxR7Err        + cmf : APER_FLUX_ERR_5  
+gflxR7Std        - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gflxR7Fill       + cmf : APER_FILL_5      
+---------------- 
+gc6flxR5         + cmf : APER_FLUX_3	  
+gc6flxR5Err      + cmf : APER_FLUX_ERR_3  
+gc6flxR5Std      - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gc6flxR5Fill     + cmf : APER_FILL_3      
+gc6flxR6         + cmf : APER_FLUX_4	  
+gc6flxR6Err      + cmf : APER_FLUX_ERR_4  
+gc6flxR6Std      - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gc6flxR6Fill     + cmf : APER_FILL_4      
+gc6flxR7         + cmf : APER_FLUX_5	  
+gc6flxR7Err      + cmf : APER_FLUX_ERR_5  
+gc6flxR7Std      - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gc6flxR7Fill     + cmf : APER_FILL_5      
+---------------- 
+gc8flxR5         + cmf : APER_FLUX_3	  
+gc8flxR5Err      + cmf : APER_FLUX_ERR_3  
+gc8flxR5Std      - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gc8flxR5Fill     + cmf : APER_FILL_3      
+gc8flxR6         + cmf : APER_FLUX_4	  
+gc8flxR6Err      + cmf : APER_FLUX_ERR_4  
+gc8flxR6Std      - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gc8flxR6Fill     + cmf : APER_FILL_4      
+gc8flxR7         + cmf : APER_FLUX_5	  
+gc8flxR7Err      + cmf : APER_FLUX_ERR_5  
+gc8flxR7Std      - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gc8flxR7Fill     + cmf : APER_FILL_5      
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6	(revision 38152)
@@ -0,0 +1,52 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid  dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gc6flxR3        Jy              REAL    4       -999    Flux inside sdss r = 3
+gc6flxR3Err     Jy              REAL    4       -999    estimated error is c1flxR3
+gc6flxR3Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR3
+gc6flxR3Fill    dimensionless   REAL    4       -999    estimated filling factor at R3
+gc6flxR4        Jy              REAL    4       -999    Flux inside sdss r = 4
+gc6flxR4Err     Jy              REAL    4       -999    estimated error is c1flxR4
+gc6flxR4Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR4
+gc6flxR4Fill    dimensionless   REAL    4       -999    estimated filling factor at R4
+gc6flxR5        Jy              REAL    4       -999    Flux inside sdss r = 5
+gc6flxR5Err     Jy              REAL    4       -999    estimated error is c1flxR5
+gc6flxR5Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR5
+gc6flxR5Fill    dimensionless   REAL    4       -999    estimated filling factor at R5
+gc6flxR6        Jy              REAL    4       -999    Flux inside sdss r = 6
+gc6flxR6Err     Jy              REAL    4       -999    estimated error is c1flxR6
+gc6flxR6Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR6
+gc6flxR6Fill    dimensionless   REAL    4       -999    estimated filling factor at R6
+gc6flxR7        Jy              REAL    4       -999    Flux inside sdss r = 7
+gc6flxR7Err     Jy              REAL    4       -999    estimated error is c1flxR7
+gc6flxR7Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR7
+gc6flxR7Fill    dimensionless   REAL    4       -999    estimated filling factor at R7
+gc6flxR8        Jy              REAL    4       -999    Flux inside sdss r = 8
+gc6flxR8Err     Jy              REAL    4       -999    estimated error is c1flxR8
+gc6flxR8Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR8
+gc6flxR8Fill    dimensionless   REAL    4       -999    estimated filling factor at R8
+gc6flxR9        Jy              REAL    4       -999    Flux inside sdss r = 9
+gc6flxR9Err     Jy              REAL    4       -999    estimated error is c1flxR9
+gc6flxR9Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR9
+gc6flxR9Fill    dimensionless   REAL    4       -999    estimated filling factor at R9
+gc6flxR10        Jy              REAL    4       -999    Flux inside sdss r = 10
+gc6flxR10Err     Jy              REAL    4       -999    estimated error is c1flxR10
+gc6flxR10Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR10
+gc6flxR10Fill    dimensionless   REAL    4       -999    estimated filling factor at R10
+gc6flxR11        Jy              REAL    4       -999    Flux inside sdss r = 11
+gc6flxR11Err     Jy              REAL    4       -999    estimated error is c1flxR11
+gc6flxR11Std     Jy              REAL    4       -999    estimated standard deviation in c1flxR11
+gc6flxR11Fill    dimensionless   REAL    4       -999    estimated filling factor at R11
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon6.txt	(revision 38152)
@@ -0,0 +1,51 @@
+
+objID            + from StackObjectThin			      	      
+uniquePspsSTid   = ipptopsps
+ippObjID         + from StackObjectThin			      	      
+randomStackObjID + from StackObjectThin			      	      
+stackDetectRowID - PSPS					      	      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin 
+gstackMetaID     + from StackObjectThin 
+---------------- 
+gc6flxR3         + cmf : APER_FLUX_1	  
+gc6flxR3Err      + cmf : APER_FLUX_ERR_1  
+gc6flxR3Std      - cmf : APER_FLUX_STDEV_1 : ** badly defined in cmf
+gc6flxR3Fill     + cmf : APER_FILL_1      
+gc6flxR4         + cmf : APER_FLUX_2	  
+gc6flxR4Err      + cmf : APER_FLUX_ERR_2  
+gc6flxR4Std      - cmf : APER_FLUX_STDEV_2 : ** badly defined in cmf
+gc6flxR4Fill     + cmf : APER_FILL_2      
+gc6flxR5         + cmf : APER_FLUX_3	  
+gc6flxR5Err      + cmf : APER_FLUX_ERR_3  
+gc6flxR5Std      - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gc6flxR5Fill     + cmf : APER_FILL_3      
+gc6flxR6         + cmf : APER_FLUX_4	  
+gc6flxR6Err      + cmf : APER_FLUX_ERR_4  
+gc6flxR6Std      - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gc6flxR6Fill     + cmf : APER_FILL_4      
+gc6flxR7         + cmf : APER_FLUX_5	  
+gc6flxR7Err      + cmf : APER_FLUX_ERR_5  
+gc6flxR7Std      - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gc6flxR7Fill     + cmf : APER_FILL_5      
+gc6flxR8         + cmf : APER_FLUX_6	  
+gc6flxR8Err      + cmf : APER_FLUX_ERR_6  
+gc6flxR8Std      - cmf : APER_FLUX_STDEV_6 : ** badly defined in cmf
+gc6flxR8Fill     + cmf : APER_FILL_6      
+gc6flxR9         + cmf : APER_FLUX_7	  
+gc6flxR9Err      + cmf : APER_FLUX_ERR_7  
+gc6flxR9Std      - cmf : APER_FLUX_STDEV_7 : ** badly defined in cmf
+gc6flxR9Fill     + cmf : APER_FILL_7      
+gc6flxR10         + cmf : APER_FLUX_8	  
+gc6flxR10Err      + cmf : APER_FLUX_ERR_8  
+gc6flxR10Std      - cmf : APER_FLUX_STDEV_8 : ** badly defined in cmf
+gc6flxR10Fill     + cmf : APER_FILL_8      
+gc6flxR11         + cmf : APER_FLUX_9	  
+gc6flxR11Err      + cmf : APER_FLUX_ERR_9  
+gc6flxR11Std      - cmf : APER_FLUX_STDEV_9 : ** badly defined in cmf
+gc6flxR11Fill     + cmf : APER_FILL_9      
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8	(revision 38152)
@@ -0,0 +1,52 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gc8flxR3        Jy              REAL    4       -999    Flux inside sdss r = 3
+gc8flxR3Err     Jy              REAL    4       -999    estimated error is c2flxR3
+gc8flxR3Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR3
+gc8flxR3Fill    dimensionless   REAL    4       -999    estimated filling factor at R3
+gc8flxR4        Jy              REAL    4       -999    Flux inside sdss r = 4
+gc8flxR4Err     Jy              REAL    4       -999    estimated error is c2flxR4
+gc8flxR4Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR4
+gc8flxR4Fill    dimensionless   REAL    4       -999    estimated filling factor at R4
+gc8flxR5        Jy              REAL    4       -999    Flux inside sdss r = 5
+gc8flxR5Err     Jy              REAL    4       -999    estimated error is c2flxR5
+gc8flxR5Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR5
+gc8flxR5Fill    dimensionless   REAL    4       -999    estimated filling factor at R5
+gc8flxR6        Jy              REAL    4       -999    Flux inside sdss r = 6
+gc8flxR6Err     Jy              REAL    4       -999    estimated error is c2flxR6
+gc8flxR6Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR6
+gc8flxR6Fill    dimensionless   REAL    4       -999    estimated filling factor at R6
+gc8flxR7        Jy              REAL    4       -999    Flux inside sdss r = 7
+gc8flxR7Err     Jy              REAL    4       -999    estimated error is c2flxR7
+gc8flxR7Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR7
+gc8flxR7Fill    dimensionless   REAL    4       -999    estimated filling factor at R7
+gc8flxR8        Jy              REAL    4       -999    Flux inside sdss r = 8
+gc8flxR8Err     Jy              REAL    4       -999    estimated error is c2flxR8
+gc8flxR8Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR8
+gc8flxR8Fill    dimensionless   REAL    4       -999    estimated filling factor at R8
+gc8flxR9        Jy              REAL    4       -999    Flux inside sdss r = 9
+gc8flxR9Err     Jy              REAL    4       -999    estimated error is c2flxR9
+gc8flxR9Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR9
+gc8flxR9Fill    dimensionless   REAL    4       -999    estimated filling factor at R9
+gc8flxR10        Jy              REAL    4       -999    Flux inside sdss r = 10
+gc8flxR10Err     Jy              REAL    4       -999    estimated error is c2flxR10
+gc8flxR10Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR10
+gc8flxR10Fill    dimensionless   REAL    4       -999    estimated filling factor at R10
+gc8flxR11        Jy              REAL    4       -999    Flux inside sdss r = 11
+gc8flxR11Err     Jy              REAL    4       -999    estimated error is c2flxR11
+gc8flxR11Std     Jy              REAL    4       -999    estimated standard deviation in c2flxR11
+gc8flxR11Fill    dimensionless   REAL    4       -999    estimated filling factor at R11
+
+-- repeat for other filters with appropriate leading prefex.
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalCon8.txt	(revision 38152)
@@ -0,0 +1,51 @@
+
+objID            + from StackObjectThin			      	      
+uniquePspsSTid   = ipptopsps
+ippObjID         + from StackObjectThin			      	      
+randomStackObjID + from StackObjectThin			      	      
+stackDetectRowID - PSPS					      	      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin 
+gstackMetaID     + from StackObjectThin 
+---------------- 
+gc8flxR3         + cmf : APER_FLUX_1	  
+gc8flxR3Err      + cmf : APER_FLUX_ERR_1  
+gc8flxR3Std      - cmf : APER_FLUX_STDEV_1 : ** badly defined in cmf
+gc8flxR3Fill     + cmf : APER_FILL_1      
+gc8flxR4         + cmf : APER_FLUX_2	  
+gc8flxR4Err      + cmf : APER_FLUX_ERR_2  
+gc8flxR4Std      - cmf : APER_FLUX_STDEV_2 : ** badly defined in cmf
+gc8flxR4Fill     + cmf : APER_FILL_2      
+gc8flxR5         + cmf : APER_FLUX_3	  
+gc8flxR5Err      + cmf : APER_FLUX_ERR_3  
+gc8flxR5Std      - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gc8flxR5Fill     + cmf : APER_FILL_3      
+gc8flxR6         + cmf : APER_FLUX_4	  
+gc8flxR6Err      + cmf : APER_FLUX_ERR_4  
+gc8flxR6Std      - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gc8flxR6Fill     + cmf : APER_FILL_4      
+gc8flxR7         + cmf : APER_FLUX_5	  
+gc8flxR7Err      + cmf : APER_FLUX_ERR_5  
+gc8flxR7Std      - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gc8flxR7Fill     + cmf : APER_FILL_5      
+gc8flxR8         + cmf : APER_FLUX_6	  
+gc8flxR8Err      + cmf : APER_FLUX_ERR_6  
+gc8flxR8Std      - cmf : APER_FLUX_STDEV_6 : ** badly defined in cmf
+gc8flxR8Fill     + cmf : APER_FILL_6      
+gc8flxR9         + cmf : APER_FLUX_7	  
+gc8flxR9Err      + cmf : APER_FLUX_ERR_7  
+gc8flxR9Std      - cmf : APER_FLUX_STDEV_7 : ** badly defined in cmf
+gc8flxR9Fill     + cmf : APER_FILL_7      
+gc8flxR10        + cmf : APER_FLUX_8	  
+gc8flxR10Err      + cmf : APER_FLUX_ERR_8  
+gc8flxR10Std      - cmf : APER_FLUX_STDEV_8 : ** badly defined in cmf
+gc8flxR10Fill     + cmf : APER_FILL_8      
+gc8flxR11        + cmf : APER_FLUX_9	  
+gc8flxR11Err      + cmf : APER_FLUX_ERR_9  
+gc8flxR11Std      - cmf : APER_FLUX_STDEV_9 : ** badly defined in cmf
+gc8flxR11Fill     + cmf : APER_FILL_9      
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc	(revision 38152)
@@ -0,0 +1,50 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid  dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gflxR3          Jy              REAL    4       -999    Flux inside sdss r = 3
+gflxR3Err       Jy              REAL    4       -999    estimated error is flxR3
+gflxR3Std       Jy              REAL    4       -999    estimated standard deviation in flxR3
+gflxR3Fill      dimensionless   REAL    4       -999    estimated filling factor at R3
+gflxR4          Jy              REAL    4       -999    Flux inside sdss r = 4
+gflxR4Err       Jy              REAL    4       -999    estimated error is flxR4
+gflxR4Std       Jy              REAL    4       -999    estimated standard deviation in flxR4
+gflxR4Fill      dimensionless   REAL    4       -999    estimated filling factor at R4
+gflxR5          Jy              REAL    4       -999    Flux inside sdss r = 5
+gflxR5Err       Jy              REAL    4       -999    estimated error is flxR5
+gflxR5Std       Jy              REAL    4       -999    estimated standard deviation in flxR5
+gflxR5Fill      dimensionless   REAL    4       -999    estimated filling factor at R5
+gflxR6          Jy              REAL    4       -999    Flux inside sdss r = 6
+gflxR6Err       Jy              REAL    4       -999    estimated error is flxR6
+gflxR6Std       Jy              REAL    4       -999    estimated standard deviation in flxR6
+gflxR6Fill      dimensionless   REAL    4       -999    estimated filling factor at R6
+gflxR7          Jy              REAL    4       -999    Flux inside sdss r = 7
+gflxR7Err       Jy              REAL    4       -999    estimated error is flxR7
+gflxR7Std       Jy              REAL    4       -999    estimated standard deviation in flxR7
+gflxR7Fill      dimensionless   REAL    4       -999    estimated filling factor at R7
+gflxR8          Jy              REAL    4       -999    Flux inside sdss r = 8
+gflxR8Err       Jy              REAL    4       -999    estimated error is flxR8
+gflxR8Std       Jy              REAL    4       -999    estimated standard deviation in flxR8
+gflxR8Fill      dimensionless   REAL    4       -999    estimated filling factor at R8
+gflxR9          Jy              REAL    4       -999    Flux inside sdss r = 9
+gflxR9Err       Jy              REAL    4       -999    estimated error is flxR9
+gflxR9Std       Jy              REAL    4       -999    estimated standard deviation in flxR9
+gflxR9Fill      dimensionless   REAL    4       -999    estimated filling factor at R9
+gflxR10          Jy              REAL    4       -999    Flux inside sdss r = 10
+gflxR10Err       Jy              REAL    4       -999    estimated error is flxR10
+gflxR10Std       Jy              REAL    4       -999    estimated standard deviation in flxR10
+gflxR10Fill      dimensionless   REAL    4       -999    estimated filling factor at R10
+gflxR11          Jy              REAL    4       -999    Flux inside sdss r = 11
+gflxR11Err       Jy              REAL    4       -999    estimated error is flxR11
+gflxR11Std       Jy              REAL    4       -999    estimated standard deviation in flxR11
+gflxR11Fill      dimensionless   REAL    4       -999    estimated filling factor at R11
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackApFlxExGalUnc.txt	(revision 38152)
@@ -0,0 +1,51 @@
+
+objID            + from StackObjectThin			      	      
+uniquePspsSTid   = ipptopsps
+ippObjID         + from StackObjectThin			      	      
+randomStackObjID + from StackObjectThin			      	      
+stackDetectRowID - PSPS					      	      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin 
+gstackMetaID     + from StackObjectThin 
+---------------- 
+gflxR3           + cmf : APER_FLUX_1	  
+gflxR3Err        + cmf : APER_FLUX_ERR_1  
+gflxR3Std        - cmf : APER_FLUX_STDEV_1 : ** badly defined in cmf
+gflxR3Fill       + cmf : APER_FILL_1      
+gflxR4           + cmf : APER_FLUX_2	  
+gflxR4Err        + cmf : APER_FLUX_ERR_2  
+gflxR4Std        - cmf : APER_FLUX_STDEV_2 : ** badly defined in cmf
+gflxR4Fill       + cmf : APER_FILL_2      
+gflxR5           + cmf : APER_FLUX_3	  
+gflxR5Err        + cmf : APER_FLUX_ERR_3  
+gflxR5Std        - cmf : APER_FLUX_STDEV_3 : ** badly defined in cmf
+gflxR5Fill       + cmf : APER_FILL_3      
+gflxR6           + cmf : APER_FLUX_4	  
+gflxR6Err        + cmf : APER_FLUX_ERR_4  
+gflxR6Std        - cmf : APER_FLUX_STDEV_4 : ** badly defined in cmf
+gflxR6Fill       + cmf : APER_FILL_4      
+gflxR7           + cmf : APER_FLUX_5	  
+gflxR7Err        + cmf : APER_FLUX_ERR_5  
+gflxR7Std        - cmf : APER_FLUX_STDEV_5 : ** badly defined in cmf
+gflxR7Fill       + cmf : APER_FILL_5      
+gflxR8           + cmf : APER_FLUX_6	  
+gflxR8Err        + cmf : APER_FLUX_ERR_6  
+gflxR8Std        - cmf : APER_FLUX_STDEV_6 : ** badly defined in cmf
+gflxR8Fill       + cmf : APER_FILL_6      
+gflxR9           + cmf : APER_FLUX_7	  
+gflxR9Err        + cmf : APER_FLUX_ERR_7  
+gflxR9Std        - cmf : APER_FLUX_STDEV_7 : ** badly defined in cmf
+gflxR9Fill       + cmf : APER_FILL_7      
+gflxR10           + cmf : APER_FLUX_8	  
+gflxR10Err        + cmf : APER_FLUX_ERR_8  
+gflxR10Std        - cmf : APER_FLUX_STDEV_8 : ** badly defined in cmf
+gflxR10Fill       + cmf : APER_FILL_8      
+gflxR11           + cmf : APER_FLUX_9	  
+gflxR11Err        + cmf : APER_FLUX_ERR_9  
+gflxR11Std        - cmf : APER_FLUX_STDEV_9 : ** badly defined in cmf
+gflxR11Fill       + cmf : APER_FILL_9      
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV	(revision 38152)
@@ -0,0 +1,28 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gDeVRadius      arcsec          REAL    4       -999    DeVaucouleurs radius
+gDeVRadiusErr   arcsec          REAL    4       -999    estimated error in DeVaucouleurs radius
+gDeVMag         AB_mag          REAL    4       -999    DeVaucouleurs flux
+gDeVMagErr      AB_mag          REAL    4       -999    estimated error in DeVaucouleurs flux
+gDeVAb          dimensionless   REAL    4       -999    DeVaucoulerus axis ratio
+gDeVAbErr       dimensionless   REAL    4       -999    estimated error in DeVaucoulerus axis ratio
+gDeVPhi         degrees         REAL    4       -999    estmated phi of DeVaucouleurs axis. Degrees East of North.
+gDeVPhiErr      degrees         REAL    4       -999    estmated error of phi of DeVaucouleurs axis
+graDeVOff       arcsec          REAL    4       -999    Offset in RA of DeVaucouleurs fit from PSF RA
+gdecDeVOff      arcsec          REAL    4       -999    Offset in DEC of DeVaucouleurs fit from PSF DEC
+graDeVOffErr    arcsec          REAL    4       -999    estimated error in ra offset
+gdecDeVOffErr   arcsec          REAL    4       -999    estimated error in dec offset
+gDeVCf          dimensionless   REAL    4       -999    DeVaucouleurs fit coverage factor
+gDevChisq
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitDeV.txt	(revision 38152)
@@ -0,0 +1,29 @@
+
+objID            + from StackObjectThin			      
+uniquePspsSTid = ipptopsps
+ippObjID         + from StackObjectThin			      
+randomStackObjID + from StackObjectThin			      
+stackDetectRowID - PSPS					      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin
+gstackMetaID     + from StackObjectThin
+---------------- 
+gDeVRadius       + cmf : EXT_WIDTH_MAJ
+gDeVRadiusErr    - cmf : EXT_WIDTH_MAJ_SIG ** NULL in cmf
+gDeVMag          + cmf : EXT_INST_MAG + 2.5log(exptime) + dvo.zp
+gDeVMagErr       + cmf : EXT_INST_MAG_SIG ** seems kind of small in CMF
+gDeVAb           + cmf : EXT_WIDTH_MAJ/EXT_WIDTH_MIN ** should this be Minor / Major?
+gDeVAbErr        - cmf : EXT_WIDTH_MIN_ERR
+gDeVPhi          + cmf : EXT_THETA
+gDeVPhiErr       - cmf : EXT_THETA_ERR
+gDeVRa           + cmf : use X_EXT and X_PSF, PLTSCALE to offset StackObjectThin.gra
+gDeVDec          + cmf : use Y_EXT and Y_PSF, PLTSCALE to offset StackObjectThin.gdec
+gDeVRaErr        + cmf : X_EXT_SIG * PLTSCALE					    
+gDeVDecErr       + cmf : Y_EXT_SIG * PLTSCALE					    
+gDeVCf           - ** I do not have a source for this in the CMF
+gDeVChisq        - cmf : EXT_CHISQ / EXT_NDOF
+-- gDeVLikelihood   - ** replace with chisq?
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp	(revision 38152)
@@ -0,0 +1,29 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gExpRadius      arcsec          REAL    4       -999    Exponential fit radius
+gExpRadiusErr   arcsec          REAL    4       -999    estimated error in Exponential fit radius
+gExpMag         AB_mag          REAL    4       -999    Exponential fit flux
+gExpMagErr      AB_mag          REAL    4       -999    estimated error in expFlux
+gExpAb          dimensionless   REAL    4       -999    Exponential fit axis ratio (minor / major)
+gExpAbErr       dimensionless   REAL    4       -999    estimated error in Exponential fit axis ratio
+gExpPhi         degrees         REAL    4       -999    estmated phi of Exponential axis
+gExpPhiErr      degrees         REAL    4       -999    estmated error of phi of Exponential axis
+gExpRa          degrees         DOUBLE  8       -999    RA of Exponential fit
+gExpDec         degrees         DOUBLE  8       -999    DEC of Exponential fit
+gExpRaErr       arcsec          REAL    4       -999    estimated error in RA
+gExpDecErr      arcsec          REAL    4       -999    estimated error in DEC
+gExpCf          dimensionless   REAL    4       -999    Exponential fit coverage factor
+gExpChisq       dimensionless   REAL    4       -999    Exponential fit chi square 
+-- gExpLikelihood  dimensionless   REAL    4       -999    Exponential fit likelihood factor
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExp.txt	(revision 38152)
@@ -0,0 +1,28 @@
+
+objID            + from StackObjectThin			      
+uniquePspsSTid = ipptopsps
+ippObjID         + from StackObjectThin			      
+randomStackObjID + from StackObjectThin			      
+stackDetectRowID - PSPS					      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin
+gstackMetaID     + from StackObjectThin
+---------------- 
+gExpRadius       + cmf : EXT_WIDTH_MAJ
+gExpRadiusErr    - cmf : EXT_WIDTH_MAJ_SIG ** NULL in cmf
+gExpMag          + cmf : EXT_INST_MAG + 2.5log(exptime) + dvo.zp
+gExpMagErr       + cmf : EXT_INST_MAG_SIG ** seems kind of small in CMF
+gExpAb           + cmf : EXT_WIDTH_MIN/EXT_WIDTH_MAJ
+gExpAbErr        - cmf : EXT_WIDTH_MIN_ERR
+gExpPhi          + cmf : EXT_THETA ** in radians, not degrees (fixed, check)
+gExpPhiErr       - cmf : EXT_THETA_ERR
+gExpRa           + cmf : use X_EXT and X_PSF, PLTSCALE to offset StackObjectThin.gra
+gExpDec          + cmf : use Y_EXT and Y_PSF, PLTSCALE to offset StackObjectThin.gdec
+gExpRaErr        + cmf : X_EXT_SIG * PLTSCALE
+gExpDecErr       + cmf : Y_EXT_SIG * PLTSCALE
+gExpCf           - ** I do not have a source for this in the CMF
+gExpChisq        - cmf : EXT_CHISQ / EXT_NDOF
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExtra
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExtra	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitExtra	(revision 38152)
@@ -0,0 +1,22 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8	NA	unique ipptopsps id
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+-------------------------------------------------------- 
+gS2             dimensionless   REAL    4       -999    (un)smoothness (Cheng 2012, Simard 2002)
+glogRT		dimensionless   REAL    4       -999    total residual (from ellipcally symmetric model)
+glogRA		dimensionless   REAL    4       -999    asymmetric residual (from ellipcally symmetric model)
+glogC           dimensionless   REAL    4       -999    concentration index  (Petrosian R_50 / R_90)
+glogA           dimensionless   REAL    4       -999    log of asymmetry index (Gyory & Bell 2010)
+gbumpy          dimensionless   REAL    4       -999    Blakeslee bumpiness
+ghalfLightRad   arcsec          REAL    4       -999    half-light radius
+-------------------------------------------------------- replicate below for all filters (grizy)
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer	(revision 38152)
@@ -0,0 +1,31 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID         dimensionless  BIGINT  8       NA      object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gSerRadius      arcsec          REAL    4       -999    Sersic radius
+gSerRadiusErr   arcsed          REAL    4       -999    estimated error in Sersic radius
+gSerMag         AB_mag          REAL    4       -999    Sersic Flux
+gSerMagErr      AB_mag          REAL    4       -999    estimated error in serFlux
+gSerAb          dimensionless   REAL    4       -999    Sersic axis ratio
+gSerAbErr       dimensionlessn  REAL    4       -999    estimated error in Sersic axis ratio
+gSerNu          dimensionlessn  REAL    4       -999    Sersic index
+gSerNuErr       diemensionless  REAL    4       -999    estimated error in Sersic index
+gSerPhi         degrees         REAL    4       -999    estmated phi of Sersic axis
+gSerPhiErr      degrees         REAL    4       -999    estmated error of phi of Sersic axis
+gSerRa       dimensionless   REAL    4       -999    Offset in RA of Sersic fit from PSF RA
+gSerDec      dimensionless   REAL    4       -999    Offset in DEC of Sersic fit from PSF DEC
+gSerRaErr    dimensionless   REAL    4       -999    estimated error in raSerOff
+gSerDecErr   dimensionless   REAL    4       -999    estimated error in decSerOff
+gserCf          dimensionless   REAL    4       -999    Sersic fit coverage factor
+gserChisq
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackModelFitSer.txt	(revision 38152)
@@ -0,0 +1,31 @@
+
+objID            + from StackObjectThin			      
+uniquePspsSTid   = ipptopsps
+ippObjID         + from StackObjectThin			      
+randomStackObjID + from StackObjectThin			      
+stackDetectRowID - PSPS					      
+primaryDetection - from StackObjectThin NOT YET TESTED		      
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3 
+--               
+---------------- 
+gippDetectID     + from StackObjectThin 
+gstackDetectID   + from StackObjectThin
+gstackMetaID     + from StackObjectThin
+---------------- 
+gSerRadius       + cmf : EXT_WIDTH_MAJ
+gSerRadiusErr    - cmf : EXT_WIDTH_MAJ_SIG ** NULL in cmf
+gSerMag          + cmf : EXT_INST_MAG + 2.5log(exptime) + dvo.zp
+gSerMagErr       + cmf : EXT_INST_MAG_SIG ** seems kind of small in CMF
+gSerAb           - cmf : EXT_WIDTH_MAJ/EXT_WIDTH_MIN ** should this be Minor / Major?
+gSerAbErr        - cmf : EXT_WIDTH_MIN_ERR
+gSerNu           + cmf : EXT_PAR_07
+gSerNuErr        - cmf : 0.1 ** NOTE this is hard-wired
+gSerPhi          - cmf : EXT_THETA ** in radians, not degrees
+gSerPhiErr       - cmf : EXT_THETA_ERR
+gSerRa           + cmf : use X_EXT and X_PSF, PLTSCALE to offset StackObjectThin.gra
+gSerDec          + cmf : use Y_EXT and Y_PSF, PLTSCALE to offset StackObjectThin.gdec
+gSerRaErr        + cmf : X_EXT_SIG * PLTSCALE					    
+gSerDecErr       + cmf : Y_EXT_SIG * PLTSCALE					    
+gSerCf           - ** I do not have a source for this in the CMF
+gSerChisq        - cmf : EXT_CHISQ / EXT_NDOF
+--gSerLikelihood   - ** replace with chisq?
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes	(revision 38152)
@@ -0,0 +1,45 @@
+
+objID             dimensionless   BIGINT  8       NA      ODM object identifie
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID          dimensionless   BIGINT  8       NA      object ID generated by IPP
+randomStackObjID  dimensionless   BIGINT  8       NA      random stack id
+stackDetectRowID  dimensionless   BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection  dimensionless   TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection     dimensionless   TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+                                                          the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+------------------------------------------------------------------------------------------
+gippDetectID      dimensionless   BIGINT  8       NA      detection ID generated by IPP
+gstackDetectID    dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID      dimensionless   BIGINT  8       NA      stack identifier
+------------------------------------------------------------------------------------------
+gxPos             pixels          REAL    4       -999    measured x in sky Cell from PSF fit
+gyPos             pixels          REAL    4       -999    measured y in sky Cell from PSF fit
+gxPosErr          pixels          REAL    4       -999    estimated error in x
+gyPosErr          pixels          REAL    4       -999    estimated error in y
+gpsfMajorFWHM     arcsec          REAL    4       -999    PSF width in major axis
+gpsfMinorFWHM     arcsec          REAL    4       -999    PSF width in minor axis
+gpsfTheta         degrees         REAL    4       -999    PSF orientation angle. Degrees East of North.
+gpsfCore          dimensionless   REAL    4       -999    PSF core parameter [k in (1 + kz + z^1.66)]
+gpsfLikelihood    dimensionless   REAL    4       -999    PSF likelihood
+gpsfQf            dimensionless   REAL    4       -999    PSF coverage factor
+gpsfQfPerfect     dimensionless   REAL    4       -999    PSF-weighted fraction of arcsec totally unmasked
+gpsfChiSq         dimensionless   REAL    4       -999    PSF-weighted fraction of arcsec to.
+gmomentXX         arcsec^2        REAL    4       -999    moment XX
+gmomentXY         arcsec^2        REAL    4       -999    moment XY
+gmomentYY         arcsec^2        REAL    4       -999    moment YY
+gmomentR1         arcsec          REAL    4       -999    moment R1
+gmomentRH         arcsec          REAL    4       -999    moment RH - or half light radius (REMOVE)
+gPSFFlux     	  adu/sec         REAL    4       -999    g psf flux from stack
+gPSFFluxErr  	  adu/sec         REAL    4       -999    estimated error of g psf flux from stack
+gApFlux           adu/seconds     REAL    4       -999    Aperture magnitude
+gApFluxErr        adu/seconds     REAL    4       -999    Aperture magnitude error
+gApFillFac        dimensionless   REAL    4       -999    Aperture fill factor - ~ redundant with psfQF, keep?
+gKronFlux         adu/seconds     REAL    4       -999    Kron flux
+gKronFluxErr      adu/seconds     REAL    4       -999    Kron flux error
+gKronRad          arcsec          REAL    4       -999    Kron radius
+gexpTime          seconds         REAL    4       -999    total exposure time (informational)
+gExtNSigma	  dimensionless	  REAL	  4	  -999	  EXT_NSIGMA, how extended something is
+gsky              adu/secs/arcsec REAL     4      -999    PSF sky level at source (adu)
+gskyErr           adu/secs/arcsec REAL     4      -999 estimated error in sky
+gzp               magnitude       REAL    4       0       zeropoint , no error given 
+gPlateScale       arcsec/pixel    REAL    4       0       plate scale
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectAttributes.txt	(revision 38152)
@@ -0,0 +1,46 @@
+
+objID             + from StackObjectThin
+uniquePspsSTid = ipptopsps
+ippObjID          + from StackObjectThin
+randomStackObjID  + from StackObjectThin
+stackDetectRowID  - PSPS
+primaryDetection  - from StackObjectThin NOT YET TESTED
+bestDetection     - from StackObjectThin CANNOT BE SET until after PV3
+                  
+------------------
+gippDetectID      + from StackObjectThin
+gstackDetectID    + from StackObjectThin
+gstackMetaID      + from StackObjectThin
+------------------
+gxPos             + cmf : X_PSF
+gyPos             + cmf : Y_PSF
+gxPosErr          + cmf : X_PSF_SIG
+gyPosErr          + cmf : Y_PSF_SIG
+gpsfMajorFWHM     + cmf : PSF_FWHM_MAJ
+gpsfMinorFWHM     + cmf : PSF_FWHM_MIN
+gpsfTheta         + cmf : PSF_THETA
+gpsfCore          + cmf : PSF_CORE
+gpsfLikelihood    - cmf : psfLikelihood(EXT_NSIGMA) ** problem with calculation? plot 
+gpsfQf            + cmf : PSF_QF
+gpsfQfPerfect     + cmf : PSF_QF_PERFECT
+gpsfChiSq         + cmf : PSF_CHISQ / PSF_NDOF
+gmomentXX         + cmf : MOMENTS_XX
+gmomentXY         + cmf : MOMENTS_XY
+gmomentYY         + cmf : MOMENTS_YY
+gmomentR1         + cmf : MOMENTS_R1
+gmomentRH         + cmf : MOMENTS_RH
+gPSFFlux     	  + cmf : PSF_INST_FLUX / exptime
+gPSFFluxErr  	  + cmf : PSF_INST_FLUX_SIG / exptime
+gApFlux           + cmf : AP_FLUX / exptime
+gApFluxErr        + cmf : AP_FLUX_SIG / exptime
+gApFillFac        + cmf : AP_NPIX / (3.14159265359 * POW(b.AP_MAG_RADIUS - 0.5, 2)) ** adjusted formula, re-check
+gApRadius         + cmf : AP_MAG_RADIUS
+gKronFlux         + cmf : KRON_FLUX / exptime
+gKronFluxErr      + cmf : KRON_FLUX_ERR / exptime
+gKronRad          + cmf : MOMENTS_R1 * 2.5
+gexpTime          + cmf : header EXPTIME
+gExtNsigma	  + cmg : EXT_NSIGMA
+gsky               + smf : SKY / exptime
+gskyErr            + smf : SKY_SIGMA / exptime  
+gzp               + dvo : zp ** clarify in dvopsps
+gPlateScale       + cmf : PLTSCALE
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin	(revision 38152)
@@ -0,0 +1,38 @@
+
+objID             dimensionless   BIGINT   8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippObjID          dimensionless   BIGINT   8       NA      object ID generated by IPP  [this is a per-object, not per-filter value]
+surveyID          dimensionless   TINYINT  1       NA      survey flag identifier
+tessID            dimensionless   TINYINT  1       -1      ID mapping to tessellation names (eg, RINGS.V3, MD01.V3, etc)
+projectionID      dimensionless   SMALLINT 2       -999    valid values 0 - < 10000
+skyCellID         dimensionless   TINYINT  1       255     valid values 0 - 143 (12x12 grid)
+randomStackObjID  dimensionless   BIGINT   8       NA      random stack id
+stackDetectRowID  dimensionless   BIGINT   8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection  dimensionless   TINYINT  1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection     dimensionless   TINYINT  1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                         the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+dvoRegionID       dimensionless   INT      4       -999    identifier to dvo spatial region
+dataRelease       dimensionless   TINYINT  1       NA      Data release when this detection was originally taken.
+------------------------------------------------------------------------------------------
+-- attributes for all stack detections in all filters (these are currently forced anyway) 
+-- Replicate the section below for each filter, changing the prefex ("g" in this example) 
+------------------------------------------------------------------------------------------
+gippDetectID      dimensionless   BIGINT   8       NA      detection ID generated by IPP
+gstackDetectID    dimensionless   BIGINT   8       NA      ODM detection identifier
+gstackMetaID      dimensionless   BIGINT   8       NA      stack identifier
+------------------------------------------------------------------------------------------
+gra               degrees         FLOAT    8       NA      Right Ascension   
+gdec              degrees         FLOAT    8       NA      Declination       
+graErr            arcsec          REAL     4       NA      Right Ascension error
+gdecErr           arcsec          REAL     4       NA      Declination error  (same as RA error - need?)
+gPSFMag      	  AB_magnitude    REAL     4       -999    g psf AB magnitude from stack
+gPSFMagErr   	  AB_magnitude    REAL     4       -999    estimated error of g psf AB magnitude from stack
+gApMag       	  AB_magnitude    REAL     4       -999    g Aperture AB magnitude from stack
+gApMagErr    	  AB_magnitude    REAL     4       -999    estimated error of g Ap Mag AB magnitude from stack
+gKronMag     	  AB_magnitude    REAL     4       -999    g kron AB magnitude from stack
+gKronMagErr  	  AB_magnitude    REAL     4       -999    estimated error of g kron AB magnitude from stack
+ginfoFlag         dimensionless   INT      4          0    informational bits
+ginfoFlag2        dimensionless   INT      4          0    informational bits
+gnFrames          dimensionless   INT      4       -999    Number of frames contributing to source
+
+-- [220 byte/filter/obj + 44 byte/obj]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackObjectThin.txt	(revision 38152)
@@ -0,0 +1,38 @@
+		  
+-- fields marked with + below have been verified by EAM in the ippToPsps output mysql tables
+
+objID              + dvo = average.extID   [calculated in addstar]
+uniquePspsSTid = ipptopsps
+ippObjID           + dvo = average.objID + (average.catID << 32) [NOTE: this is a change in definition]
+surveyID           + ipptopsps : internal, from survey name
+tessID             + smf : TESS_ID (table mapping)
+projectionID       + smf : parse SKYCELL (skycell.NNN or skycell.MMMM.NNN)
+skycellID          + smf : parse SKYCELL (skycell.NNN or skycell.MMMM.NNN)
+randomStackObjID   + ipptopsps (RANDOM on sql into mysql)
+stackDetectRowID   - set by PSPS
+primaryDetection   + (dvo:measure.dbFlags >> 16)
+bestDetection      - dvo * THIS CANNOT BE SET UNTIL LATER (after PV3 initial ingest to psps)
+                    
+dvoRegionID        + dvo = measure.catID
+dataRelease        + ippToPsps : user input (skychunk.dataRelease)
+--
+--
+--
+--
+gippDetectID       + dvopsps.ippDetectID = dvo:measure.detID = smf / IPP_IDET
+gstackDetectID     + dvopsps.detectID = dvo:measure.extID [calculated in addstar: psps stack detect ID]
+gstackMetaID       + ipptopsps : gpc1 db, matches cmf IMAGEID
+--
+gra                + dvo = measure.ra
+gdec               + dvo = measure.dec
+graErr             + dvo = X_PSF_SIG * PLTSCALE
+gdecErr            + dvo = X_PSF_SIG * PLTSCALE
+gPSFMag      	   + dvo = measure.Mpsf
+gPSFMagErr   	   + dvo = measure.dMpsf
+gApMag       	   + dvo = measure.Map
+gApMagErr    	   + dvo = measure.dMap
+gKronMag     	   + dvo = measure.Mkron
+gKronMagErr  	   + dvo = measure.dMkron
+ginfoFlag          + smf : FLAGS
+ginfoFlag2         - smf + dvo : FLAGS2 | measure.flags << 13 *** we only include measure.dbflags, not secfilt.flags
+gnFrames           + smf : N_FRAMES
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian	(revision 38152)
@@ -0,0 +1,23 @@
+
+objID            dimensionless  BIGINT  8       NA      ODM object identifier
+uniquePspsSTid dimensionless BIGINT  8       NA      unique identifier provided by ipptopsps
+ippbjID		 dimensionless	BIGINT	8	NA 	object ID generated by IPP
+randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+stackDetectRowID dimensionless  BIGINT  8       NA      identifies which of up to 5 possible stackdetctions this Row refers to: Primary, up to 3 Secondary, 1 best  
+primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+--                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-------------------------------------------------------- replicate below for all filters (grizy)
+gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+----------------------------------------------------------------------------------------
+gpetRadius      arcsec          REAL    4       -999    Petrosian radius
+gpetRadiusErr   arcsec          REAL    4       -999    estimated error inPetrosian radius
+gpetMag         AB_mag          REAL    4       -999    Petrosian Flux
+gpetMagErr      AB_mag          REAL    4       -999    estimated error in petFlux
+gpetR50         arcsec          REAL    4       -999    Petrosian radius at 50% light
+gpetR50Err      arcsec          REAL    4       -999    estimated error inPetrosian radius at 50% light
+gpetR90         arcsec          REAL    4       -999    Petrosian radius at 90% light
+gpetR90Err      arcsec          REAL    4       -999    estimated error in Petrosian radius at 90% light
+gpetCf          dimensionless   REAL    4       -999    Petrosian fit coverage factor
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/StackPetrosian.txt	(revision 38152)
@@ -0,0 +1,23 @@
+
+objID            + from StackObjectThin
+uniquePspsSTid = ipptopsps
+ippobjID		 + from StackObjectThin
+randomStackObjID + from StackObjectThin
+stackDetectRowID - PSPS
+primaryDetection - from StackObjectThin NOT YET TESTED		     
+bestDetection    - from StackObjectThin CANNOT BE SET until after PV3
+--                
+----------------  
+gippDetectID     + from StackObjectThin
+gstackDetectID   + from StackObjectThin
+gstackMetaID     + from StackObjectThin
+----------------  
+gpetRadius       + cmf : PETRO_RADIUS
+gpetRadiusErr    + cmf : PETRO_RADIUS_ERR
+gpetMag          + cmf : PETRO_MAG - header:FPA.ZP + dvo.zp
+gpetMagErr       + cmf : PETRO_MAG_ERR
+gpetR50          + cmf : PETRO_RADIUS_50
+gpetR50Err       + cmf : PETRO_RADIUS_50_ERR
+gpetR90          + cmf : PETRO_RADIUS_90
+gpetR90Err       + cmf : PETRO_RADIUS_90_ERR
+gpetCf           - cmf : PETRO_FILL ** consistently > 1.0?? [problem in cmf]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/changes.r36847
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/changes.r36847	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/changes.r36847	(revision 38152)
@@ -0,0 +1,199 @@
+Index: Detection
+===================================================================
+--- Detection	(revision 36838)
++++ Detection	(working copy)
+@@ -7,7 +7,7 @@
+ surveyID        dimensionless   TINYINT 1         NA    survey flag identifier
+ imageID         dimensionless   BIGINT  8         NA    image id hash of frame identifier & OTA/CCD number
+ randomDetID     dimensionless   BIGINT  8         NA    random detection Id
+-dvoRegionID     dimensionless   REAL    4       -999    identifier to dvo spatial region
++dvoRegionID     dimensionless   INT     4          0    identifier to dvo spatial region
+ obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+ xPos            raw pixels      REAL    4       -999    measured x on CCD from PSF fit
+ yPos            raw pixels      REAL    4       -999    measured y on CCD from PSF fit
+@@ -53,7 +53,8 @@
+ kronRadErr      arcsec      	REAL    4       -999    Kron radius error
+ sky             adu/sec/pixel   REAL    4       -999    PSF sky level at source
+ skyErr          adu/sec/pixel   REAL    4       -999    estimated error in sky
+-infoFlag        dimensionless   BIGINT  8       -999    flag indicating provenance information
++infoFlag        dimensionless   INT     4       -999    flag indicating provenance information
++infoFlag2       dimensionless   INT     4       -999    flag indicating provenance information
+ dataRelease     dimensionless   TINYINT 1         NA    Data release when this detection was originally taken. Recalibrations do not affect this value.
+ --
+ -- [231 bytes/det]
+Index: StackApFlx
+===================================================================
+--- StackApFlx	(revision 36838)
++++ StackApFlx	(working copy)
+@@ -1,6 +1,7 @@
+ 
+ objID            dimensionless  BIGINT  8       NA      ODM object identifier
+ gcObjID		dimensionless	BIGINT	8	  NA 	ODM galactic coordinates identifier
++ippObjID         dimensionless  BIGINT  8       NA      ipp object identifier
+ surveyID         dimensionless  TINYINT 1       0       stack type identifier
+ skyCellID        dimensionless  REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+ randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+@@ -8,13 +9,12 @@
+ primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+ bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+ --                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-dvoRegionID      dimensionless  REAL    4       -999    identifier to dvo spatial region
++dvoRegionID     dimensionless   INT    4       -999    identifier to dvo spatial region
+ dataRelease     dimensionless   TINYINT 1       NA      Data release when this table was loaded.
+ ------------------------------------------------------- replicate to end for each filter g,r,i,z,y
++gippDetectID    dimensionless   BIGINT  8       NA      stack identifier
+ gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+ gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+-gippObjID        dimensionless  BIGINT  8       NA      ipp object identifier
+-gippDetectID    dimensionless   BIGINT  8       NA      stack identifier
+ --------------------------------------------------------unconvolved
+ gflxR3          adu/seconds     REAL    4       -999    Flux inside r = 3
+ gflxR3Err       adu/seconds     REAL    4       -999    estimated error is flxR3
+Index: ForcedWarpMeasurement
+===================================================================
+--- ForcedWarpMeasurement	(revision 36838)
++++ ForcedWarpMeasurement	(working copy)
+@@ -8,7 +8,7 @@
+ forcedWarpID    dimensionless   BIGINT  8       NA      IPP warp_id
+ randomWarpID    dimensionless   BIGINT  8       NA      Random warp_id
+ skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+-dvoRegionID     dimensionless   REAL    4       -999    identifier to dvo spatial region
++dvoRegionID     dimensionless   INT     4       -999    identifier to dvo spatial region
+ obsTime         MeanJulianDays  FLOAT   8       -999    Time of mid observation in Mean Julian Days
+ ------------------------------------------------------ 
+ zp              magnitude       REAL    4       0       zeropoint (only thing needed to convert adu/sec to AB mag), note no zpErr
+Index: DiffDetection
+===================================================================
+--- DiffDetection	(revision 36838)
++++ DiffDetection	(working copy)
+@@ -1,3 +1,4 @@
++
+ diffObjID	dimensionless 	BIGINT 	8 	NA 	diff object identifier
+ diffgcObjID		dimensionless	BIGINT	8	  NA 	ODM galactic coordinates identifier
+ diffDetID 	dimensionless 	BIGINT 	8 	NA 	diff detection identifier
+@@ -8,7 +9,7 @@
+ surveyID 	dimensionless 	TINYINT	1 	NA 	survey flag identifierr
+ randomDiffID 	dimensionless 	BIGINT 	8 	NA 	random diff id  
+ skyCellID       dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+-dvoRegionID     dimensionless   REAL    4       -999    identifier to dvo spatial region
++dvoRegionID     dimensionless   INT     4          0    identifier to dvo spatial region
+ obsTime 	MeanJulianDays 	FLOAT 	8 	-999 	Time of mid observation of positive detection in Mean Julian Days of positive detection
+ xPos 		pixels 		REAL 	4 	-999 	measured x on diff image sky cell PSF fit
+ yPos 		pixels 		REAL 	4 	-999 	measured y on diff image sky cell from PSF fit
+@@ -65,5 +66,6 @@
+ -------------------------------------------------------
+ sky 		adu/sec/pixel 	REAL 	4 	-999 	PSF sky level at source
+ skyErr 		adu/sec/pixel 	REAL 	4 	-999 	estimated error in sky
+-infoFlag 	dimensionless 	BIGINT 	8 	-999 	flag indicating provenance information
++infoFlag 	dimensionless 	INT     4 	-999 	flag indicating provenance information
++infoFlag2	dimensionless 	INT     4 	-999 	flag indicating provenance information
+ dataRelease 	dimensionless 	TINYINT	1 	NA 	Data release when this detection was originally taken. Recalibrations do not affect this value.
+Index: ObjectThin
+===================================================================
+--- ObjectThin	(revision 36838)
++++ ObjectThin	(working copy)
+@@ -9,7 +9,7 @@
+ zoneID           dimensionless  INT      4      NA      Zone index
+ randomID         dimensionless  BIGINT   8      0       Random integer between 0 and 2^32 = 4,394,967,296 remaining ramdom integer 0  
+ batchID          dimensionless  BIGINT   8      -999    batch id        
+-dvoRegionID      dimensionless  REAL     4      -999    identifier of dvo spatial region - dvo cat id
++dvoRegionID      dimensionless  INT      4      -999    identifier of dvo spatial region - dvo cat id
+ dataRelease      dimensionless  TINYINT  1      NA      Data release Version of this table
+ objInfoFlag      dimensionless  BIGINT   8      -999    flag indicating odd properties
+ qualityFlag      dimensionless  TINYINT  1      0       subset of objInfoFlag - flags related to goodness of object
+Index: StackModelFit
+===================================================================
+--- StackModelFit	(revision 36838)
++++ StackModelFit	(working copy)
+@@ -1,6 +1,7 @@
+ 
+ objID            dimensionless  BIGINT  8       NA      ODM object identifier
+ gcObjID		dimensionless	BIGINT	8	  NA 	ODM galactic coordinates identifier
++ippObjID         dimensionless  BIGINT  8       NA      ipp object identifier
+ surveyID         dimensionless  TINYINT 1       NA      survey flag identifier
+ skyCellID        dimensionless  REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+ randomStackObjID dimensionless  BIGINT  8       NA      random stack id
+@@ -8,17 +9,17 @@
+ primaryDetection dimensionless  TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+ bestDetection    dimensionless  TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+ --                                                      the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-dvoRegionID      dimensionless  REAL    4       -999    identifier to dvo spatial region
++dvoRegionID      dimensionless  INT     4       -999    identifier to dvo spatial region
+ dataRelease      dimensionless  TINYINT 1       NA      Data release when this table was loaded
+ -------------------------------------------------------- replicate below for all filters (grizy)
+ glogC           dimensionless   REAL    4       -999    concentration index 
+ glogA           dimensionless   REAL    4       -999    asymmetry index
+ gclump          dimensionless   REAL    4       -999    clumpiness factor   
+ -------------------------------------------------------- replicate below for all filters (grizy)
++gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
+ gstackDetectID  dimensionless   BIGINT  8       NA      ODM detection identifier
+ gstackMetaID    dimensionless   BIGINT  8       NA      stack identifier
+-gippObjID       dimensionless  BIGINT  8       NA      ipp object identifier
+-gippDetectID    dimensionless   BIGINT  8       NA      ipp detect identifier
++----------------------------------------------------------------------------------------
+ gdeVRadius      arcsec          REAL    4       -999    deVaucouleurs radius
+ gdeVRadiusErr   arcsec          REAL    4       -999    estimated error in deVaucouleurs radius
+ gdeVFlux        adu/seconds     REAL    4       -999    deVaucouleurs flux
+Index: ForcedMeanObject
+===================================================================
+--- ForcedMeanObject	(revision 36838)
++++ ForcedMeanObject	(working copy)
+@@ -1,3 +1,4 @@
++
+ objID           dimensionless   BIGINT   8        NA    ODM object identifier index
+ gcObjID		dimensionless	BIGINT	8	  NA 	ODM galactic coordinates identifier
+ ippObjID        dimensionless   BIGINT   8        NA    IPP object identifier
+Index: DiffDetObject
+===================================================================
+--- DiffDetObject	(revision 36838)
++++ DiffDetObject	(working copy)
+@@ -9,7 +9,7 @@
+ zoneID 		dimensionless 	INT 	4 	NA 	Zone index
+ randomID 	dimensionless 	BIGINT 	8 	0 	Random integer between 0 and 2^32 = 4,394,967,296 remaining ramdom integer 0  
+ batchID 	dimensionless	BIGINT 	8 	-999 	
+-dvoRegionID     dimensionless  	REAL    4       -999    identifier to dvo spatial region
++dvoRegionID     dimensionless  	INT     4       -999    identifier to dvo spatial region
+ objInfoFlag 	dimensionless 	BIGINT 	8 	-999 	flag indicating odd properties
+ qualityFlag 	dimensionless 	TINYINT 1 	0 	subset of objInfoFlag - flags related to goodness of object
+ consistencyFlag	dimensionless 	SMALLINT2 	0 	Value computed from associated detections, it is originally given by IPP and should agree with the ODM validation
+Index: StackObject
+===================================================================
+--- StackObject	(revision 36838)
++++ StackObject	(working copy)
+@@ -1,6 +1,7 @@
+ 
+ objID             dimensionless   BIGINT  8       NA      ODM object identifier
+ gcObjID		dimensionless	BIGINT	8	  NA 	ODM galactic coordinates identifier
++ippObjID          dimensionless   BIGINT  8       NA      object ID generated by IPP
+ surveyID          dimensionless   TINYINT 1       NA      survey flag identifier
+ skyCellID         dimensionless   REAL    4       -999    single float giving PrimaryCell.SkyCell identifier 
+ randomStackObjID  dimensionless   BIGINT  8       NA      random stack id
+@@ -8,16 +9,16 @@
+ primaryDetection  dimensionless   TINYINT 1       255     identifies if this row is a primary stack detection. True about 80% of time. 
+ bestDetection     dimensionless   TINYINT 1       255     identifies if this row is a best detection or not. Also set if only a primary detection exists.   
+                                                           the Primary Dectection, 0 to 3 possible secondary dectections, and the "best" per filter.  
+-dvoRegionID       dimensionless   REAL    4       -999    identifier to dvo spatial region
++dvoRegionID       dimensionless   INT     4       -999    identifier to dvo spatial region
+ dataRelease       dimensionless   TINYINT 1       NA      Data release when this detection was originally taken.
+ ------------------------------------------------------------------------------------------
+ -- attributes for all stack detections in all filters (these are currently forced anyway) 
+ -- Replicate the section below for each filter, changing the prefex ("g" in this example) 
+ ------------------------------------------------------------------------------------------
+-gippObjID         dimensionless   BIGINT  8       NA      object ID generated by IPP
+ gippDetectID      dimensionless   BIGINT  8       NA      detection ID generated by IPP
+ gstackDetectID    dimensionless   BIGINT  8       NA      ODM detection identifier
+ gstackMetaID      dimensionless   BIGINT  8       NA      stack identifier
++------------------------------------------------------------------------------------------
+ gxPos             arcsec          REAL    4       -999    measured x in sky Cell from PSF fit
+ gyPos             arcsec          REAL    4       -999    measured y in sky Cell from PSF fit
+ gxPosErr          arcsec          REAL    4       -999    estimated error in x
+@@ -57,7 +58,8 @@
+ gKronMagErr  	  AB magnitude    REAL    4       -999    estimated error of g kron AB magnitude from stack
+ gsky              adu/secs/arcsec REAL    4       -999    PSF sky level at source (adu)
+ gskyErr           adu/secs/arcsec REAL    4       -999    estimated error in sky
+-ginfoFlag         dimensionless   BIGINT  8       -999    indicator of strange propeties
++ginfoFlag         dimensionless   INT     4       -999    indicator of strange propeties
++ginfoFlag2        dimensionless   INT     4       -999    indicator of strange propeties
+ gnFrames          dimensionless   INT     4       -999    Number of frames contributing to source
+ 
+ -- [220 byte/filter/obj + 44 byte/obj]
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/notes.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/notes.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/notes.txt	(revision 38152)
@@ -0,0 +1,22 @@
+
+tables processed by the different batch types:
+
+objectbatch.py:
+    ObjectThin
+    MeanObject
+
+detectionbatch.py:
+    Detection
+
+stackbatch.py:
+    StackObjectThin    - populated for all stack detections * checked
+    StackObjectRaw     - populated for all stack detections * checked
+    StackModelFitThin  - populated for Galactic Cap regions 
+    StackModelFitDeV   - populated for Galactic Cap regions * checked
+    StackModelFitExp   - populated for Galactic Cap regions * checked
+    StackModelFitSer   - populated for Galactic Cap regions * checked
+    StackApFlx	       - populated for all stack detections 
+    StackApFlxFull     - populated for Galactic Cap regions * checked
+    StackApFlxFullC1   - populated for Galactic Cap regions * checked
+    StackApFlxFullC2   - populated for Galactic Cap regions * checked
+    StackPetrosian     - populated for Galactic Cap regions * checked
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/schema18.notes.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/schema18.notes.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/Fundamental_IPP_Data_Product_Tables/schema18.notes.txt	(revision 38152)
@@ -0,0 +1,160 @@
+
+This document describes the new PSPS schema (18.0) and identifies existing problems.
+
+ObjectThin
+
+  Changes since Schema 16.0:
+  
+    * DROPPED gcObjID (concept rejected by DRAVG)
+    * replaced skycellID (REAL) with combination of tessID, projectionID, skycellID (1,2,1 byte INTs)
+    * replaced raMeanStd, decMeanStd (not calculated) with posMeanChisq
+
+  Concerns:
+
+    * objName is generated by SQL in ippToPsps and is probably fragile: move to dvopsps?
+    * fields calculated by PSPS and not tested (htmID, zoneID, cx,cy,cz, lambda,beta, l,b)
+    * nStackObjectRows is not calculated 
+    * should nStackDetections be split per filter?
+    * quality flag is currently the upper byte of dvo:average.flags, is this reasonable?
+    * consistency flag is hard-wired as 0
+    * raStack, etc are not yet calculated by relastro (set to match raMean, etc)
+
+MeanObject
+
+  Changes since Schema 16.0:
+  
+    * DROPPED gcObjID (concept rejected by DRAVG)
+    * CHANGED gFlags to be 4 byte not 8 byte (secfilt.flags is 4 byte)
+    * renamed fields to have consistent naming structure:
+      * gMeanTYPEMagVALUE, where TYPE = (PSF, Kron, Ap) and VALUE = (Err, Std, Min Max, Npt)
+
+  Concerns:
+
+    * NONE
+
+Detections
+
+  Changes since Schema 16.0:
+  
+    * ADDED   apRadius
+    * DROPPED gcObjID (concept rejected by DRAVG)
+    * DROPPED kronRadErr (not measured by psphot, probably not needed?)
+  
+  Concerns:
+  
+    * imageID : this is currently generated from expID + ccd X,Y.
+      shouldn't we use gpc1.chipImfile.chip_imfile_id? (IMAGE_ID in
+      header)
+    * double-check reported value for zero point (needs to include airmass term, etc)
+  
+  Implementation Changes:
+  
+    * raErr,decErr are now taken from the SMF file not from dvo (x,y errors truncated in dvo)
+    * dvoRegion now uses CAT_ID from dvopsps
+    * psfMajor,MinorFWHM use PSF_FWHM_MJA,MIN
+    * added PSF_CORE to smf
+    * apFlux, kronFlux use FLUX values directly from smf
+
+Stacks
+
+  Measurements related to the stacks are now split into 11 separate
+  tables depending on the measurements and, in some cases, the Galactic
+  latitude.  The granularity of the split is partly mandated by the
+  inability of PSPS or its ingest system to handle excessively wide
+  tables.  Note that in all of the tables below, a single row represents
+  the set of measurements from all 5 filters (grizy) for the aparition
+  of an astronomical object in a single skycell.  The primaryDetection
+  flag is set to identify the row which comes from the primary skycell
+  for that location on the sky.  
+  
+  Several of the tables are meant to be filled only for the Galactic cap
+  regions.  As of 2014.08.09, ippToPsps is not setting this limit.
+  These tables are:
+  
+      StackModelFitDeV   
+      StackModelFitExp   
+      StackModelFitSer   
+      StackModelFitExtra 
+      StackApFlxFull     
+      StackApFlxFullC1   
+      StackApFlxFullC2   
+      StackPetrosian     
+
+  Other general concerns:
+
+    * various size-related fields are reported in pixels not arcseconds.
+    
+    * I need to double-check the reported zero point and telluric
+      extinction values.
+    
+    * are we defining too many radial apertures?
+
+  The tables are divided as follows:
+  
+    StackObjectThin : basic properties of the stack object detection.
+      * stackDetectRowID : this field will be set by PSPS and cannot be
+                           tested in the ippToPsps code
+
+      * bestDetection    : this field cannot be set until the entire PSPS is
+                           populated.  this will be deferred until the end of
+                           the ingest.
+
+      * primaryDetection : NOT YET TESTED
+      * xinfoFlag2           : currently only includes bits from
+                               dvo:measure.dbflags but not dvo:secfilt.flags
+    
+    * NOTE : stackDetectRowID, bestDetection, primaryDetection are
+      inherited by the following tables from StackObjectThin, so the issue
+      above are present in all Stack tables
+    
+    StackObjectRaw : raw measurement values from the PSF fits
+      * xpsfLikelihood   : some values seem to be negative, which should
+                           not be allowed
+    
+    StackModelFitExtra : extra properties derived from extended source
+                         fits.  NOTE: this table is not being generated
+    
+    StackModelFitExp : Exponential model fit parameters
+     * xExpRadiusErr : EXT_WIDTH_MAJ_SIG is not being set in the CMF file
+     * xExpAbErr     : EXT_WIDTH_MIN_SIG is not being set in the CMF file
+     * xExpPhiErr    : not set in CMF
+     * xExpRa,Dec    : this position is currently an approximation based on
+                       X_EXT, X_PSF and the plate scale
+     * xExpRa,DecErr : circularly symmetric approximation based on S/N
+     * xExpCf        : not calculated in psphot
+     * xExpChisq     : the fit chisq is provided, not the likelihood
+    
+    StackModelFitDeV : DeVaucouleur model fit parameters
+     * NOTE same issues as for Exp
+    
+    StackModelFitSer : Sersic model fit parameters
+     * NOTE same issues as for Exp, also:
+     * xSerNuErr     : value is hard-wired at 0.1, and not well-measured
+                       in CMF
+    
+    StackApFlx : flux measured in radial apertures (only 3 radii; raw and
+                 both convolutions)
+    
+     * standard deviation fields (eg, gflxR3Std) are measured in psphot as
+       the standard deviation across the full object.  Should this perhaps
+       be a measurement of the standard deviation after the radial profile
+       is subtracted?
+    
+    StackApFlxFull : flux measured in radial apertures (raw, all radii)
+    
+     * see note above on Standard Deviation
+     * radius 10 is not measured or reported in the CMF
+    
+    StackApFlxFullC1 : flux measured in radial apertures (first convolution, all radii)
+    
+     * see note above on Standard Deviation
+     * radius 10 is not measured or reported in the CMF
+    
+    StackApFlxFullC2 : flux measured in radial apertures (second convolution, all radii)
+    
+     * see note above on Standard Deviation
+     * radius 10 is not measured or reported in the CMF
+    
+    StackPetrosian : petrosian analysis data
+     * xpetCf  : fill factor is mis-calculated in psphot (consistently > 1.0)
+     * NOTE that PETRO_MAG_ERR is inverted in pmSourceIO_CMF.c.in r37244
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/CameraConfig
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/CameraConfig	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/CameraConfig	(revision 38152)
@@ -0,0 +1,12 @@
+CameraConfig
+Description: Camera configuration
+
+Name      	Unit		        DataType    Size	Default		ValueDescription 
+
+cameraID  	dimensionless   	SMALLINT 	2 	   -999         camera identifier (i.e. GPC1, ISP)
+cameraConfigID  dimensionless           SMALLINT        2          -999         camera configuration
+endDate         dimensionless               REAL        4          -999         ending date of this configuration in MJD
+configDetails   string           VARCHAR(MAX) 8000      0x00         NA         text/table giving the details of the camera configuration
+                                                                                NEED TO CHANGE and pass camera x from raw data file
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DetectionFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DetectionFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DetectionFlags	(revision 38152)
@@ -0,0 +1,10 @@
+DetectionFlags
+
+Description: Flags used to interpret the information flag provided
+with each detection (infoFlag in 'Detection' table)
+
+Name Unit Data Type Size Default Value Description
+
+name 		VARCHAR(32) 	32	NA 	Name of flag 
+value 		BIGINT 		8 	NA 	Flag value
+description     VARCHAR(2000) 2000      NA      Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffMeta	(revision 38152)
@@ -0,0 +1,26 @@
+diffMetaID   dimensionless   BIGINT 8 NA diff  identifier
+batchID      dimensionless   BIGINT 8 NA batch  identifier
+surveyID     dimensionless   TINYINT 1 NA survey flag identifier
+filterID     dimensionless   TINYINT 1 NA filter id 
+diffTypeID   dimensionless   TINYINT 1 0 diff type identifier
+posImageID   dimensionless   BIGINT 8 NA positive image identifier
+negImageID   dimensionless   BIGINT 8 NA negative image identifier
+skyCellID    dimensionless   REAL 4 NA skycell region identifier 
+photoCalID   dimensionless   INT 4 NA photometry code
+magSat       dimensionless   REAL 4 -999 saturation magnitude level
+analVer      alphanumeric   VARCHAR(100) 100 -999 analysis version index
+expTime      seconds         REAL 4 -999 exposure time of positive image
+ctype1       alphanumeric   VARCHAR(MAX) 8000 name of astrometric projection in RA
+ctype2       alphanumeric   VARCHAR(MAX) 8000 name of astrometric projection in DEC
+crval1       degrees        FLOAT 8 -999 RA corresponding to reference pixel
+crval2       degrees        FLOAT 8 -999 DEC corresponding to reference pixel
+crpix1       dimensionless  FLOAT 8 -999 reference pixel value for RA
+crpix2       dimensionless  FLOAT 8 -999 reference pixel value for DEC
+cdelt1       deg/pixel      FLOAT 8 -999 scale factor for RA
+cdelt2       deg/pixel      FLOAT 8 -999 scale factor for DEC
+pc001001     dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix 
+pc001002     dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002001     dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002002     dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+calibModNum  dimensionless  SMALLINT 2 NA calibration modification number
+dataRelease  dimensionless  TINYINT 1 NA Data release
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffToImage
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffToImage	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/DiffToImage	(revision 38152)
@@ -0,0 +1,2 @@
+diffMetaID 	BIGINT 	8 	NA 	diff identifier
+imageID 	BIGINT 	8 	NA 	hashed exposure-ccdID identifier
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Filter
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Filter	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Filter	(revision 38152)
@@ -0,0 +1,3 @@
+FilterID dimensionless TINYNT 1 NA filter ID: g=1, r=2, i=3, z=4, y=5, w=6, ...
+filterType VARCHAR(2) 2 NA filter name: g,r,i,z,y, etc.
+filterSpec VARCHAR(MAX) 8000 0x00 No comment
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FitModel
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FitModel	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FitModel	(revision 38152)
@@ -0,0 +1,42 @@
+fitModelID		SMALLINT	2	NA	indentifier of alternate model fit
+name		VARCHAR(30)	30		model name
+description		VARCHAR(MAX)	8000		string describing the model
+param1		VARCHAR(MAX)	8000		description of model parameter 1
+param2		VARCHAR(MAX)	8000		description of model parameter 2
+param3		VARCHAR(MAX)	8000		description of model parameter 3
+param4		VARCHAR(MAX)	8000		description of model parameter 4
+param5		VARCHAR(MAX)	8000		description of model parameter 5
+param6		VARCHAR(MAX)	8000		description of model parameter 6
+param7		VARCHAR(MAX)	8000		description of model parameter 7
+param8		VARCHAR(MAX)	8000		description of model parameter 8
+param9		VARCHAR(MAX)	8000		description of model parameter 9
+param10		VARCHAR(MAX)	8000		description of model parameter 10
+param11		VARCHAR(MAX)	8000		description of model parameter 11
+param12		VARCHAR(MAX)	8000		description of model parameter 12
+param13		VARCHAR(MAX)	8000		description of model parameter 13
+param14		VARCHAR(MAX)	8000		description of model parameter 14
+param15		VARCHAR(MAX)	8000		description of model parameter 15
+param16		VARCHAR(MAX)	8000		description of model parameter 16
+param17		VARCHAR(MAX)	8000		description of model parameter 17
+param18		VARCHAR(MAX)	8000		description of model parameter 18
+param19		VARCHAR(MAX)	8000		description of model parameter 19
+param20		VARCHAR(MAX)	8000		description of model parameter 20
+param21		VARCHAR(MAX)	8000		description of model parameter 21
+param22		VARCHAR(MAX)	8000		description of model parameter 22
+param23		VARCHAR(MAX)	8000		description of model parameter 23
+param24		VARCHAR(MAX)	8000		description of model parameter 24
+param25		VARCHAR(MAX)	8000		description of model parameter 25
+param26		VARCHAR(MAX)	8000		description of model parameter 26
+param27		VARCHAR(MAX)	8000		description of model parameter 27
+param28		VARCHAR(MAX)	8000		description of model parameter 28
+param29		VARCHAR(MAX)	8000		description of model parameter 29
+param30		VARCHAR(MAX)	8000		description of model parameter 30
+param31		VARCHAR(MAX)	8000		description of model parameter 31
+param32		VARCHAR(MAX)	8000		description of model parameter 32
+param33		VARCHAR(MAX)	8000		description of model parameter 33
+param34		VARCHAR(MAX)	8000		description of model parameter 34
+param35		VARCHAR(MAX)	8000		description of model parameter 35
+param36		VARCHAR(MAX)	8000		description of model parameter 36
+param37		VARCHAR(MAX)	8000		description of model parameter 37
+param38		VARCHAR(MAX)	8000		description of model parameter 38
+param39		VARCHAR(MAX)	8000		description of model parameter 39
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpMeta	(revision 38152)
@@ -0,0 +1,33 @@
+forcedWarpID dimensionless   BIGINT 8 NA stack identifier
+batchID          dimensionless   BIGINT 8 NA batch identifier
+surveyID         dimensionless   TINYINT 1 NA survey flag identifier
+filterID         dimensionless   TINYINT 1 NA fnilutemr eidriecnatl ifidier
+skyCellID        dimensionless   REAL 4 NA skycell region identifier 
+photoCalID       dimensionless   INT 4 NA photometry code
+magSat           dimensionless   REAL 4 -999 saturation magnitude level
+analVer          dimensionless   SMALLINT 2 -999 analysis version index
+expTime          seconds         REAL 4 -999 exposure time
+completMag       magnitudes      REAL 4 -999 95% completion level in mag
+astroScat        dimensionless   REAL 4 -999 astrometric scatter for chip
+photoScat        dimensionless   REAL 4 -999 photometric scatter for chip
+nAstroRef        dimensionless   INT 4 -999 number of astrometric reference sources
+nPhoRef          dimensionless   INT 4 -999 number of photometric reference sources
+psfModelID       dimensionless   VARCHAR(MAX) 8000 PSF model identifier
+psfFwhm_mean     arcsec         FLOAT 8 -999 mean PSF FWHM in the stack
+psfFwhm_max      arcsec         FLOAT 8 -999 maximum PSF FWHM in the stack 
+photoZero        magnitudes     REAL 4 -999 local derived photometric zero point
+photoColor       magnitudes     REAL 4 -999 local derived photometric color term
+ctype1           alphanumeric   VARCHAR(MAX) 8000 name of astrometric projection in RA
+ctype2           alphanumeric   VARCHAR(MAX) 8000 name of astrometric projection in DEC
+crval1           degrees        FLOAT 8 -999 RA corresponding to reference pixel
+crval2           degrees        FLOAT 8 -999 DEC corresponding to reference pixel
+crpix1           dimensionless  FLOAT 8 -999 reference pixel value for RA
+crpix2           dimensionless  FLOAT 8 -999 reference pixel value for DEC
+cdelt1           deg/pixel      FLOAT 8 -999 scale factor for RA
+cdelt2           deg/pixel      FLOAT 8 -999 scale factor for DEC
+pc001001         dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix 
+pc001002         dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002001         dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002002         dimensionless  FLOAT 8 -999 elements of rotation/Dcale matrix
+calibModNum      dimensionless  SMALLINT 2 NA calibration modification number
+dataRelease      dimensionless  TINYINT 1 NA Data release
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpToImage
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpToImage	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ForcedWarpToImage	(revision 38152)
@@ -0,0 +1,2 @@
+forcedWarpID 	BIGINT 	8 	NA 	forced warp identifier
+imageID 		BIGINT 	8 	NA 	hashed exposure-ccdID identifier
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta	(revision 38152)
@@ -0,0 +1,49 @@
+frameID         dimensionless   INT             4       NA      unique exposure/frame identifier.
+frameName       dimensionless   VARCHAR(32)     32      NA      frame name provided by camera software
+surveyID        dimensionless   TINYINT         1       NA      survey flag identifier
+filterID        dimensionless   TINYINT         1       NA      filter identifier
+cameraID        dimensionless   SMALLINT        2       NA      camera identifier
+cameraConfigID  dimensionless   SMALLINT        2       NA      camera configuration identifier
+telescopeID     dimensionless   SMALLINT        2       NA      telescope identifier
+analysisVer     alphanumeric    VARCHAR(MAX)    8000    NA      IPP software analysis release
+p1Recip         alphanumeric    VARCHAR(MAX)    8000    NA      IPP phase 1 MD5 Checksum
+p2Recip         alphanumeric    VARCHAR(MAX)    8000    NA      IPP phase 2 MD5 Checksum
+p3Recip         alphanumeric    VARCHAR(MAX)    8000    NA      IPP phase 3 MD5 Checksum
+nOTA            alphanumeric    SMALLINT        2       -999    number of valid OTA/CCD images in this exposure
+photoScat       magnitude       REAL            4       -999    global photometric scatter
+numPhotoRef     dimensionless   INT             4       -999    number of photometric reference sources
+expStart        days            FLOAT           8       -999    exposure start time in MJD
+expTime         seconds         REAL            4       -999    exposure time
+airmass         dimensionless   REAL            4       -999    airmass at mid-exposure
+raBore          degrees         FLOAT           8       -999    RA of telescope boresight
+decBore         degrees         FLOAT           8       -999    DEC of telescope boresight
+ctype1          alphanumeric    VARCHAR(MAX)    8000    NA      name of astrometric projection in RA
+ctype2          alphanumeric    VARCHAR(MAX)    8000    NA      name of astrometric projection in DEC
+crval1          degrees         FLOAT           8       -999    RA corresponding to reference pixel
+crval2          degrees         FLOAT           8       -999    DEC corresponding to reference pixel
+crpix1          dimensionless   FLOAT           8       -999    reference pixel value for RA
+crpix2          dimensionless   FLOAT           8       -999    reference pixel value for DEC
+cdelt1          degrees/pixel   FLOAT           8       -999    scale factor for RA
+cdelt2          degrees/pixel   FLOAT           8       -999    scale factor for DEC
+pc001001        dimensionless   FLOAT           8       -999    elements of rotation/Dcale matrix
+pc001002        dimensionless   FLOAT           8       -999    elements of rotation/Dcale matrix
+pc002001        dimensionless   FLOAT           8       -999    elements of rotation/Dcale matrix
+pc002002        dimensionless   FLOAT           8       -999    elements of rotation/Dcale matrix
+polyOrder       dimensionless   TINYINT         1       255     polynomial order of astrometry fit
+pca1x3y0        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x2y1        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x1y2        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x0y3        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x2y0        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x1y1        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca1x0y2        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x3y0        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x2y1        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x1y2        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x0y3        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x2y0        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x1y1        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+pca2x0y2        dimensionless   FLOAT           8       -999    polynomial coefficients for the astrometric fit
+calibModNum     dimensionless   SMALLINT        2       NA      calibration modification number
+batchID         dimensionless   BIGINT          8       NA      batch ID 
+dataRelease     dimensionless   TINYINT         1       NA      Data release Version of this table
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/FrameMeta.txt	(revision 38152)
@@ -0,0 +1,50 @@
+frameID         | ipptopsps : gpc1.rawExp.exp_id
+frameName       | ipptopsps : gpc1.rawExp.exp_name
+surveyID        | ipptopsps : internal, from survey name
+filterID        | ipptopsps : internal, lookup from filter (grizy)
+cameraID        | ipptopsps : hardwired to 1 ***
+cameraConfigID  | ipptopsps : hardwired to 1 ***
+telescopeID     | ipptopsps : hardwired to 1 ***
+analysisVer     | ipptopsps : gpc1.camRun.software_ver
+p1Recip         | * NOT SET
+p2Recip         | * NOT SET
+p3Recip         | * NOT SET
+nOTA            | ipptopsps : count of OTAs
+photoScat       | cmf: ZPT_ERR
+numPhotoRef     | sum(cmf:NASTRO)
+expStart        | cmf:MJD-OBS
+expTime         | cmf:EXPREQ
+airmass         | cmf:AIRMASS
+raBore          | cmf:RA
+decBore         | cmf:DEC
+ctype1          | cmf:CTYPE1
+ctype2          | cmf:CTYPE2
+crval1          | cmf:CRVAL1  
+crval2          | cmf:CRVAL2  
+crpix1          | cmf:CRPIX1  
+crpix2          | cmf:CRPIX2  
+cdelt1          | cmf:CDELT1  
+cdelt2          | cmf:CDELT2  
+pc001001        | cmf:PC001001
+pc001002        | cmf:PC001002
+pc002001        | cmf:PC002001
+pc002002        | cmf:PC002002
+polyOrder       | cmf:NPLYTERM        
+pca1x3y0        | cmf:PCA1X3Y0
+pca1x2y1        | cmf:PCA1X2Y1
+pca1x1y2        | cmf:PCA1X1Y2
+pca1x0y3        | cmf:PCA1X0Y3
+pca1x2y0        | cmf:PCA1X2Y0
+pca1x1y1        | cmf:PCA1X1Y1
+pca1x0y2        | cmf:PCA1X0Y2
+pca2x3y0        | cmf:PCA2X3Y0
+pca2x2y1        | cmf:PCA2X2Y1
+pca2x1y2        | cmf:PCA2X1Y2
+pca2x0y3        | cmf:PCA2X0Y3
+pca2x2y0        | cmf:PCA2X2Y0
+pca2x1y1        | cmf:PCA2X1Y1
+pca2x0y2        | cmf:PCA2X0Y2
+calibModNum     | ipptopsps: hardwired to 0 ***
+batchID         | ipptopsps: internal
+dataRelease     | ipptopsps: user input (skychunk.dataRelease)
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageDetEffMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageDetEffMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageDetEffMeta	(revision 38152)
@@ -0,0 +1,67 @@
+imageID		dimensionless	BIGINT	8	NA	unique ID for each image, hashed from frameID and ccdID 
+frameID		dimensionless	INT	4	NA	frame identifier, also known as exposure number
+offset01	dimensionless 	REAL	4	NA	det eff offset
+counts01	dimensionless 	REAL	4	NA	det eff counts
+diffMean01	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev01	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean01	dimensionless	REAL	4	NA	det eff err.mean
+offset02	dimensionless 	REAL	4	NA	det eff offset
+counts02	dimensionless 	REAL	4	NA	det eff counts
+diffMean02	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev02	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean02	dimensionless	REAL	4	NA	det eff err.mean
+offset03	dimensionless 	REAL	4	NA	det eff offset
+counts03	dimensionless 	REAL	4	NA	det eff counts
+diffMean03	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev03	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean03	dimensionless	REAL	4	NA	det eff err.mean
+offset04	dimensionless 	REAL	4	NA	det eff offset
+counts04	dimensionless 	REAL	4	NA	det eff counts
+diffMean04	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev04	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean04	dimensionless	REAL	4	NA	det eff err.mean
+offset05	dimensionless 	REAL	4	NA	det eff offset
+counts05	dimensionless 	REAL	4	NA	det eff counts
+diffMean05	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev05	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean05	dimensionless	REAL	4	NA	det eff err.mean
+offset06	dimensionless 	REAL	4	NA	det eff offset
+counts06	dimensionless 	REAL	4	NA	det eff counts
+diffMean06	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev06	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean06	dimensionless	REAL	4	NA	det eff err.mean
+offset07	dimensionless 	REAL	4	NA	det eff offset
+counts07	dimensionless 	REAL	4	NA	det eff counts
+diffMean07	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev07	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean07	dimensionless	REAL	4	NA	det eff err.mean
+offset08	dimensionless 	REAL	4	NA	det eff offset
+counts08	dimensionless 	REAL	4	NA	det eff counts
+diffMean08	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev08	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean08	dimensionless	REAL	4	NA	det eff err.mean
+offset09	dimensionless 	REAL	4	NA	det eff offset
+counts09	dimensionless 	REAL	4	NA	det eff counts
+diffMean09	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev09	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean09	dimensionless	REAL	4	NA	det eff err.mean
+offset10	dimensionless 	REAL	4	NA	det eff offset
+counts10	dimensionless 	REAL	4	NA	det eff counts
+diffMean10	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev10	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean10	dimensionless	REAL	4	NA	det eff err.mean
+offset11	dimensionless 	REAL	4	NA	det eff offset
+counts11	dimensionless 	REAL	4	NA	det eff counts
+diffMean11	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev11	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean11	dimensionless	REAL	4	NA	det eff err.mean
+offset12	dimensionless 	REAL	4	NA	det eff offset
+counts12	dimensionless 	REAL	4	NA	det eff counts
+diffMean12	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev12	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean12	dimensionless	REAL	4	NA	det eff err.mean
+offset13	dimensionless 	REAL	4	NA	det eff offset
+counts13	dimensionless 	REAL	4	NA	det eff counts
+diffMean13	dimensionless	REAL	4	NA	det eff diff.mean
+diffStdev13	dimensionless	REAL	4	NA	det eff diff.stdev
+errMean13	dimensionless	REAL	4	NA	det eff err.mean
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageFlags	(revision 38152)
@@ -0,0 +1,3 @@
+name VARCHAR(32) 32 NA Name of flag
+value BIGINT 8 NA Flag value
+description VARCHAR(2000) 2000 Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta	(revision 38152)
@@ -0,0 +1,71 @@
+imageID		dimensionless	BIGINT	8	NA	unique ID for each image, hashed from frameID and ccdID 
+frameID		dimensionless	INT	4	NA	frame identifier, also known as exposure number
+ccdID		dimensionless	SMALLINT	2	NA	ccd cell identifier in the focal plane
+photoCalID      dimensionless	INT	4	NA	photometry reduction code identifier
+filterID	dimensionless	TINYINT	1	NA	filter ID
+bias		ADU		REAL	4	-999	detector bias level
+biasScat	ADU		REAL	4	-999	scatter in bias level
+sky		ADU/pixel	REAL	4	-999	mean sky level
+skyScat		ADU/pixel	REAL	4	-999	scatter in mean sky level
+nDetect		dimensionless	INT	4	-999	number of detections on CCD
+magSat		magnitude	REAL	4	-999	saturation magnitude level
+completMag	magnitude	REAL	4	-999	95% completion level in mag
+astroScat	arcsec		REAL	4	-999	astrometric scatter for chip
+photoScat	magitude	REAL	4	-999	photometric scatter for chip
+numAstroRef	dimensionless	INT	4	-999	number of astrometric reference sources
+numPhotoRef	dimensionless	INT	4	-999	number of photometric reference sources
+nx		pixels		SMALLINT	2	-999	chip dimension in x
+ny		pixels		SMALLINT	2	-999	chip dimension in y
+psfModelID	dimensionless	INT	4	-999	PSF model identifier
+psfFwhm		arcsec		REAL	4	-999	model psf full width at half maximum at chip center
+psfWidMajor	arcsec		REAL	4	-999	model PSF parameters at chip center
+psfWidMinor	arcsec		REAL	4	-999	model PSF parameters at chip center
+psfTheta	degrees		REAL	4	-999	model PSF parameters at chip center
+momentMajor     pixels  	REAL    4       -999    momentMajor
+momentMinor     pixels  	REAL    4       -999    momentMinor
+momentM2C       pixels squared 	REAL    4       -999    momentM2C  
+momentM2S       pixels squared  REAL    4       -999    momentM2S  
+momentM3        pixels squared  REAL    4       -999    momentM3   
+momentM4        pixels squared  REAL    4       -999    momentM4   
+apResid		magnitude	REAL	4	-999	corrected aperture residual
+dapResid	magnitude	REAL	4	-999	scatter of aperture corrections
+detectorID	alphanumeric	VARCHAR(32)	32		identifier for actual CCD chip
+qaFlags		dimensionless	BIGINT	8	-999	Q/A flags for this OTA
+detrend1	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 1
+detrend2	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 2
+detrend3	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 3
+detrend4	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 4
+detrend5	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 5
+detrend6	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 6
+detrend7	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 7
+detrend8	alphanumeric	VARCHAR(MAX)	8000		identifier of detrend image 8
+photoZero	magnitude	REAL	4	-999	local derived photometric zero point
+ctype1		alphanumeric	VARCHAR(MAX)	8000		name of astrometric projection in RA
+ctype2		alphanumeric	VARCHAR(MAX)	8000		name of astrometric projection in DEC
+crval1		degrees	FLOAT	8	-999	RA corresponding to reference pixel
+crval2		degrees	FLOAT	8	-999	DEC corresponding to reference pixel
+crpix1		pixels	FLOAT	8	-999	reference pixel value for RA
+crpix2		pixels	FLOAT	8	-999	reference pixel value for DEC
+cdelt1		degrees/pixel	FLOAT	8	-999	scale factor for RA
+cdelt2		degrees/pixel	FLOAT	8	-999	scale factor for DEC
+pc001001	unknown	FLOAT	8	-999	elements of rotation/Dcale matrix
+pc001002	unknown	FLOAT	8	-999	elements of rotation/Dcale matrix
+pc002001	unknown	FLOAT	8	-999	elements of rotation/Dcale matrix
+pc002002	unknown	FLOAT	8	-999	elements of rotation/Dcale matrix
+polyOrder	dimensionless	TINYINT	1	255	polynomial order of astrometry fit
+pca1x3y0	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x2y1	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x1y2	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x0y3	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x2y0	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x1y1	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca1x0y2	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x3y0	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x2y1	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x1y2	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x0y3	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x2y0	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x1y1	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+pca2x0y2	dimensionless	FLOAT	8	-999	polynomial coefficients for the astrometric fit
+calibModNum	dimensionless	SMALLINT	2	NA	calibration modification number
+dataRelease	dimensionless	TINYINT	1	NA	Data release Version of this table
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ImageMeta.txt	(revision 38152)
@@ -0,0 +1,71 @@
+imageID      | 	ipptopsps : expID x y (*** is this right???) (smf:IMAGEID / gpc1.chipRun.chip_image_id)_
+frameID	     | 	ipptopsps : gpc1.rawExp.exp_id
+ccdID	     | 	ipptopsps : from XYnn
+photoCalID   |  dvo:photcode (from photcode table)
+filterID     | 	ipptopsps : internal, lookup from filter (grizy)
+bias	     | 	gpc1.rawExp.bg *** WRONG!
+biasScat     | 	gpc1.rawExp.bg_stdev *** WRONG!
+sky	     | 	MSKY_MN
+skyScat	     | 	MSKY_SIG
+nDetect	     | 	ipptopsps : rows(Detection table)
+magSat	     | 	FSATUR
+completMag   | 	FLIMIT
+astroScat    | 	CERROR
+photoScat    | 	ZPT_OBS ** wrong
+numAstroRef  | 	NASTRO
+numPhotoRef  | 	NASTRO
+nx	     |  CNAXIS1	
+ny	     |  CNAXIS2	
+psfModelID   | 	** NOT SET
+psfFwhm	     | 	0.5*(FWHM_MAJ + FWHM_MIN)
+psfWidMajor  | 	FWHM_MAJ
+psfWidMinor  | 	FWHM_MIN
+psfTheta     | 	ANGLE
+momentMajor  |  IQ_FW1
+momentMinor  |  IQ_FW1
+momentM2C    |  IQ_M2C
+momentM2S    |  IQ_M2S
+momentM3     |  IQ_M3
+momentM4     |  IQ_M4
+apResid	     | 	APMIFIT
+dapResid     | 	DAPMIFIT
+detectorID   | 	DETECTOR
+qaFlags	     | 	dvo:image.flags
+detrend1     | 	DETREND.MASK
+detrend2     | 	DETREND.DARK
+detrend3     | 	DETREND.FLAT
+detrend4     | 	** NOT SET
+detrend5     | 	** NOT SET
+detrend6     | 	** NOT SET
+detrend7     | 	** NOT SET
+detrend8     | 	** NOT SET
+photoZero    | 	ZPT_OBS
+ctype1	     | 	CTYPE1
+ctype2	     | 	CTYPE2
+crval1	     | 	CRVAL1')
+crval2	     | 	CRVAL2')
+crpix1	     | 	CRPIX1')
+crpix2	     | 	CRPIX2')
+cdelt1	     | 	CDELT1')
+cdelt2	     | 	CDELT2')
+pc001001     | 	PC001001
+pc001002     | 	PC001002
+pc002001     | 	PC002001
+pc002002     | 	PC002002
+polyOrder    | 	NPLYTERM
+pca1x2y0     | 	PCA1X2Y0
+pca1x1y1     | 	PCA1X1Y1
+pca1x0y2     | 	PCA1X0Y2
+pca2x2y0     | 	PCA2X2Y0
+pca2x1y1     | 	PCA2X1Y1
+pca2x0y2     | 	PCA2X0Y2
+pca1x3y0     | 	PCA1X3Y0
+pca1x2y1     | 	PCA1X2Y1
+pca1x1y2     | 	PCA1X1Y2
+pca1x0y3     | 	PCA1X0Y3
+pca2x3y0     | 	PCA2X3Y0
+pca2x2y1     | 	PCA2X2Y1
+pca2x1y2     | 	PCA2X1Y2
+pca2x0y3     | 	PCA2X0Y3
+calibModNum  | 	ipptopsps: hardwired to 0 ***
+dataRelease  | 	ipptopsps: user input (skychunk.dataRelease)
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Mask
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Mask	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Mask	(revision 38152)
@@ -0,0 +1,9 @@
+maskID BIGINT 8 NA mask identifier
+partitionKey BIGINT 8 NA fget(mask_center_ra, mask_center_dec, zoneH)
+frameID INT 4 NA reference to the P2FrameMeta table where the mask is defined
+imageID BIGINT 8 NA reference to the P2FrameMeta table where the mask is
+ra FLOAT 8 NA rdae finin ethde center
+dec FLOAT 8 NA dec in the center
+radius FLOAT 8 NA No comment
+maskString VARCHAR(MAX) 8000 string representation fo the mask region
+maskBinary VARBINARY(MAX) 8000 0x Binary object managed by the spatial library
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDet
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDet	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDet	(revision 38152)
@@ -0,0 +1,2 @@
+MovingObjID  	BIGINT 	8 	NA 	Moving Object identifier  
+DetectionID 	BIGINT 	8 	NA 	detection identifier  
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDiffDet
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDiffDet	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToDiffDet	(revision 38152)
@@ -0,0 +1,2 @@
+MovingObjID  	BIGINT 	8 	NA 	Moving Object identifier  
+DiffDetID 	BIGINT 	8 	NA 	difference image detection identifier  
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToObject
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToObject	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/MovingObjToObject	(revision 38152)
@@ -0,0 +1,2 @@
+MovingObjID  	BIGINT 	8 	NA 	Moving Object identifier
+ObjID 	 	BIGINT 	8 	NA 	Object identifier
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectFilterFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectFilterFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectFilterFlags	(revision 38152)
@@ -0,0 +1,3 @@
+name	dimensionless	VARCHAR(32)	32		Name of flag
+value	dimensionless	BIGINT	8	NA	Flag value
+description	dimensionless	VARCHAR(2000)	2000		Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectInfoFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectInfoFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectInfoFlags	(revision 38152)
@@ -0,0 +1,3 @@
+name	dimensionless	VARCHAR(32)	32		Name of flag
+value	dimensionless	BIGINT	8	NA	Flag value
+description	dimensionless	VARCHAR(2000)	2000		Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectQualityFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectQualityFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ObjectQualityFlags	(revision 38152)
@@ -0,0 +1,3 @@
+name	dimensionless	VARCHAR(32)	32		Name of flag
+value	dimensionless	BIGINT	8	NA	Flag value
+description	dimensionless	VARCHAR(2000)	2000		Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PhotoCal
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PhotoCal	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PhotoCal	(revision 38152)
@@ -0,0 +1,11 @@
+photoCalID		INT	4	NA	numerical code for this reduction
+filterID		TINYINT	1	NA	filter id
+photoCodeDesc		VARCHAR(MAX)	8000		Photometry reduction code name
+AB		REAL	4	1.0	AB magnitude
+zeropoint		REAL	4	-999	photometric zero point (excluding long term variation)
+extinction		REAL	4	-999	photometric extinction term (excluding long term variation)
+colorterm		REAL	4	-999	photometric color term (excluding long term variation)
+colorExtn		REAL	4	-999	photometric color dependent extinction (excluding long term variation)
+orphanCalColor		REAL	4	-999	color adopted for magnitude calculation
+orphanCalColorErr		REAL	4	-999	error in calibrating color
+startDate	day	REAL	4	NA	starting date of this configuration in MJD
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ProjectionCell
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ProjectionCell	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/ProjectionCell	(revision 38152)
@@ -0,0 +1,22 @@
+projectionCellID 		INT 4 NA projection cell unique identifier
+partitionKey 			BIGINT 8 NA fGetPanObjID(crval1,crval2)
+primaryCellRegionID 		BIGINT 8 NA reference to the primary cell region definition in the Region table
+projectionCellRegionID 		BIGINT 8 NA reference to the projectio cell region definition in the
+ctype1 				VARCHAR(MAX) 8000 NA nRaemgieo no ft aabsltero)metric projection in RA
+ctype2 				VARCHAR(MAX) 8000 NA name of astrometric projection in DEC
+crval1 deg 			FLOAT 8 NA RA corresponding to reference pixel
+crval2 deg 			FLOAT 8 NA DEC corresponding to reference pixel
+crpix1 				FLOAT 8 NA reference pixel value for RA
+crpix2 				FLOAT 8 NA reference pixel value for DEC
+pc001001 			FLOAT 8 NA elements of rotation/Dcale matrix
+pc001002 			FLOAT 8 NA elements of rotation/Dcale matrix
+pc002001 			FLOAT 8 NA elements of rotation/Dcale matrix
+pc002002 			FLOAT 8 NA elements of rotation/Dcale matrix
+raNEcornerPC   degrees          FLOAT  8 -999 ra of NE corner
+decNEcornerPC  degrees          FLOAT  8 -999 dec of NE corner
+raNWcornerPC   degrees          FLOAT  8 -999 ra of NE corner
+decNWcornerPC  degrees          FLOAT  8 -999 dec of NE corner
+raSEcornerPC   degrees          FLOAT  8 -999 ra of NE corner
+decSEcornerPC  degrees          FLOAT  8 -999 dec of NE corner
+raSWcornerPC   degrees          FLOAT  8 -999 ra of NE corner
+decSWcornerPC  degrees          FLOAT  8 -999 dec of NE corner
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PsConstant
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PsConstant	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/PsConstant	(revision 38152)
@@ -0,0 +1,4 @@
+name VARCHAR(32) 32 NA constant's name
+value FLOAT 8 NA constant's value
+unit VARCHAR(32) 32 unit of constant
+description VARCHAR(2000) 2000 description of the constant
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Region
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Region	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Region	(revision 38152)
@@ -0,0 +1,7 @@
+regionID dimensionless	BIGINT 8 NA Unique Region identifier 
+id 	 dimensionless	BIGINT 8 NA Custom Identifier
+type 	 string         VARCHAR(16) 16 NA Region type
+comment  string         VARCHAR(MAX) 8000 Comment
+area     sqdeg?         FLOAT 8 0 Area covered by the region
+region   dimensionless	Binary VARBINARY(MAX) 8000 0x Binary object managed by the spatial library
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/RegionPatch
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/RegionPatch	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/RegionPatch	(revision 38152)
@@ -0,0 +1,15 @@
+Unit Data Type Size Default Value Description
+regionid BIGINT 8 NA No comment
+convexid BIGINT 8 NA No comment
+patchid INT 4 NA No comment
+type (16) NA No comment
+radius FLOAT 8 0 No comment
+ra degree FLOAT 8 0 Right Ascension
+dec FLOAT 8 0 No comment
+x FLOAT 8 0 No comment
+y FLOAT 8 0 No comment
+z FLOAT 8 0 No comment
+c FLOAT 8 0 No comment
+htmid BIGINT 8 0 No comment
+area FLOAT 8 0 No comment
+convexString (MAX) No comment
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/SkyCell
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/SkyCell	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/SkyCell	(revision 38152)
@@ -0,0 +1,12 @@
+skyCellID   dimensionless I	INT 4 NA indentifier of the sky cell
+projectionCellID 		INT 4 -999 indentifier of the projection cell
+partitionKey 	 		BIGINT 8 -999 fgetPANobjID(skyCell_center_ra, skyCell_center_dec, zHeight)
+regionID 	 		BIGINT 8 -999 region identifier in the Region table
+raNEcorner   degrees            FLOAT  8 -999 ra of NE corner
+decNEcorner  degrees            FLOAT  8 -999 dec of NE corner
+raNWcorner   degrees            FLOAT  8 -999 ra of NE corner
+decNWcorner  degrees            FLOAT  8 -999 dec of NE corner
+raSEcorner   degrees            FLOAT  8 -999 ra of NE corner
+decSEcorner  degrees            FLOAT  8 -999 dec of NE corner
+raSWcorner   degrees            FLOAT  8 -999 ra of NE corner
+decSWcorner  degrees            FLOAT  8 -999 dec of NE corner
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackDetectionFlags
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackDetectionFlags	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackDetectionFlags	(revision 38152)
@@ -0,0 +1,3 @@
+Name	dimensionless	VARCHAR(32)	32		Name of flag
+value	dimensionless	BIGINT	8	NA	Flag value
+description	dimensionless	VARCHAR(2000)	2000		Description of the flag
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta	(revision 38152)
@@ -0,0 +1,37 @@
+stackMetaID  dimensionless   BIGINT   8 NA stack identifier
+batchID      dimensionless   BIGINT   8 NA batch identifier
+surveyID     dimensionless   TINYINT  1 NA survey flag identifier
+filterID     dimensionless   TINYINT  1 NA filter number identifier
+stackTypeID  dimensionless   TINYINT  1 0 stack type identifier
+tessID       dimensionless   TINYINT  1       -1      ID mapping to tessellation names (eg, RINGS.V3, MD01.V3, etc)
+projectionID dimensionless   SMALLINT 2       -999    valid values 0 - < 10000
+skyCellID    dimensionless   TINYINT  1       255     valid values 0 - 143 (12x12 grid)
+photoCalID   dimensionless   INT      4 NA photometry code
+magSat       dimensionless   REAL     4 -999 saturation magnitude level
+analysisVer  dimensionless   INT      4 -999 analysis version index x
+expTime      seconds         REAL     4 -999 exposure time
+nP2Images    dimensionless   SMALLINT 2 -999 number of P2 images contributing to this cell 
+completMag   magnitudes      REAL     4 -999 95% completion level in mag
+astroScat    dimensionless   REAL     4 -999 astrometric scatter for chip
+photoScat    dimensionless   REAL     4 -999 photometric scatter for chip
+nAstroRef    dimensionless   INT      4 -999 number of astrometric reference sources
+nPhotomRef   dimensionless   INT      4 -999 number of photometric reference sources
+psfModelID   dimensionless   VARCHAR(MAX) 8000 PSF model identifier
+psfFwhm_mean arcsec          FLOAT 8 -999 mean PSF FWHM in the stack
+psfFwhm_max  arcsec          FLOAT 8 -999 maximum PSF FWHM in the stack 
+photoZero    magnitudes      REAL 4 -999 local derived photometric zero point
+photoColor   magnitudes      REAL 4 -999 local derived photometric color term
+ctype1       alphanumeric    VARCHAR(MAX) 8000 name of astrometric projection in RA
+ctype2       alphanumeric    VARCHAR(MAX) 8000 name of astrometric projection in DEC
+crval1       degrees         FLOAT 8 -999 RA corresponding to reference pixel
+crval2       degrees         FLOAT 8 -999 DEC corresponding to reference pixel
+crpix1       dimensionless   FLOAT 8 -999 reference pixel value for RA
+crpix2       dimensionless   FLOAT 8 -999 reference pixel value for DEC
+cdelt1       deg/pixel       FLOAT 8 -999 scale factor for RA
+cdelt2       deg/pixel       FLOAT 8 -999 scale factor for DEC
+pc001001     dimensionless   FLOAT 8 -999 elements of rotation/Dcale matrix 
+pc001002     dimensionless   FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002001     dimensionless   FLOAT 8 -999 elements of rotation/Dcale matrix
+pc002002     dimensionless   FLOAT 8 -999 elements of rotation/Dcale matrix
+calibModNum  dimensionless   SMALLINT 2 NA calibration modification number
+dataRelease  dimensionless   TINYINT 1 NA Data release
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackMeta.txt	(revision 38152)
@@ -0,0 +1,37 @@
+stackMetaID   | ipptopsps : gpc1 db, matches cmf IMAGEID
+batchID       | ipptopsps : internal
+surveyID      | ipptopsps : internal, from survey name
+filterID      | ipptopsps : internal, lookup from filter (grizy)
+stackTypeID   | ipptopsps : internal, *** hard-wired name ***
+tessID        | smf : TESS_ID (table mapping)
+projectionID  | smf : parse SKYCELL (skycell.NNN or skycell.MMMM.NNN)
+skycellID     | smf : parse SKYCELL (skycell.NNN or skycell.MMMM.NNN)
+photoCalID    | dvo.images : photcode
+magSat        | * NOT SET
+analysisVer   | gpc1.stackRun.software_ver [EAM: changed this name]
+expTime       | cmf header EXPTIME
+nP2Images     | [populateStackToImage] : counts inputs NOTE is this set reasonable?
+completMag    | * NOT SET
+astroScat     | * NOT SET
+photoScat     | * NOT SET
+nAstroRef     | * NOT SET
+nPhotomRef    | * NOT SET
+psfModelID    | cmf header PSFMODEL
+psfFwhm_mean  | cmf header FWHM_MAJ *** probably wrong value
+psfFwhm_max   | cmf header FW_MJ_UW *** name and definition are inconsistent
+photoZero     | cmf header FPA.ZP *** this is not dvo corrected)
+photoColor    | * NOT SET
+ctype1        | cmf header 
+ctype2        | cmf header 
+crval1        | cmf header 
+crval2        | cmf header 
+crpix1        | cmf header 
+crpix2        | cmf header 
+cdelt1        | cmf header 
+cdelt2        | cmf header 
+pc001001      | cmf header 
+pc001002      | cmf header 
+pc002001      | cmf header 
+pc002002      | cmf header 
+calibModNum   | * NOT SET
+dataRelease   | ipptopsps : user input (skychunk.dataRelease)
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackToImage
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackToImage	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackToImage	(revision 38152)
@@ -0,0 +1,2 @@
+stackMetaID 	BIGINT 	8 	NA 	stack identifier
+imageID 	BIGINT 	8 	NA 	hashed exposure-ccdID identifier
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackType
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackType	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/StackType	(revision 38152)
@@ -0,0 +1,3 @@
+stackTypeID		TINYINT	1	-999	stack type identifier
+name		VARCHAR(20)	20		stack type name
+description		VARCHAR(MAX)	8000		stack type description
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Survey
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Survey	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/Survey	(revision 38152)
@@ -0,0 +1,4 @@
+SurveyID TINYINT 1 NA index of survey type
+name VARCHAR(6) 6 survey name
+description VARCHAR(MAX) 8000 
+survey description
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TelescopeConfig
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TelescopeConfig	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TelescopeConfig	(revision 38152)
@@ -0,0 +1,16 @@
+TelescopeConfig
+Description: Telescope configuration
+
+Name      	Unit		        DataType    Size	Default		ValueDescription 
+
+TelescopeID  	dimensionless   	SMALLINT 	2 	   -999         Telescope identifier (i.e. PS1, ISP)
+TeleConfigID    dimensionless           SMALLINT        2          -999         Telescope Configuration ID
+MountModel      string                                  8            NA         Mount Model Name
+MirrorModel     string                                  8            NA         Mirror Model Name
+Observera       string                                  8            NA         Observers Name
+endDate         MeanJulianDays   	    FLOAT       8          -999         ending date of this configuration in MJD
+configDetails   string           VARCHAR(MAX) 8000      0x00         NA         text/table giving the details of the telescope configuration
+
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TessellationType
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TessellationType	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/TessellationType	(revision 38152)
@@ -0,0 +1,3 @@
+tessID 		        TINYINT		1	-999	stack type identifier
+name  		        VARCHAR(20)	20	NULL	stack type name
+description		VARCHAR(MAX)	8000	NULL	stack type description
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsGalaxyModel
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsGalaxyModel	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsGalaxyModel	(revision 38152)
@@ -0,0 +1,3 @@
+galaxyModelID	dimensionless	INT	4	NA	modelID
+description	dimensionless	VARCHAR(128)	128		model description, spectral type etc.
+priors	dimensionless	VARCHAR(128)	128		priors applied to this model, may also split into 7 columns
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsPhotoZRecipe
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsPhotoZRecipe	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsPhotoZRecipe	(revision 38152)
@@ -0,0 +1,2 @@
+photozRecipeID	dimensionless	TINYINT	1	-999	recipe index
+description	dimensionless	VARCHAR(MAX)	8000		string\ describing\ the\ recipe
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsSGSepRecipe
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsSGSepRecipe	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsSGSepRecipe	(revision 38152)
@@ -0,0 +1,2 @@
+sgSepRecipeID	dimensionless	INT	4	NA	Star/Galaxy Seperator Recuipe ID
+description	dimensionless	VARCHAR(128)	128		Description
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStarModel
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStarModel	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStarModel	(revision 38152)
@@ -0,0 +1,2 @@
+starModelID	dimensionless	INT	4	-999	modelID
+description	dimensionless	VARCHAR(128)	128		model description, spectral type etc
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStellarParamsRecipe
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStellarParamsRecipe	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_TABLES/MetaData_Tables/pcsStellarParamsRecipe	(revision 38152)
@@ -0,0 +1,3 @@
+stellarParamsRecipeID	dimensionless	INT	4	NA	Na
+description	dimensionless	VARCHAR(128)	128		Description:wq
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/README
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/README	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/README	(revision 38152)
@@ -0,0 +1,5 @@
+See Notes_on_Schema 03.txt
+for what tables are combined into what views.
+Once there is concensus on tables, then will combine tables to make views. Meanwhile can concatente yourself from Notes.
+
+
Index: /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/Views
===================================================================
--- /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/Views	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippToPsps/pspsschema/SchemaNew20.0/PSPS_VIEWS/Views	(revision 38152)
@@ -0,0 +1,28 @@
+PSPS VIEWS - examples (not complete, please suggest others) 
+
+*note: drop batchID it is not needed
+
+MeanObjectView                 = ObjectThin join MeanObject 
+StackObjectView                = ObjectThin join StackObjectThin join StackObjectAttributes
+StackApFlxObjectView           = ObjectThin join StackApFlx  
+StackApFlxExGalUncObjectView   = ObjectThin join StackApFlxExGalUnc 
+StackApFlxExGalCon6ObjectView  = ObjectThin join StackApFlxExGalCon6 
+StackApFlxExGalCon8ObjectView  = ObjectThin join StackApFlxExGalCon8
+StackModelObjectView           = ObjectThin join StackModelFitExp join StackModelFitDeV join StackModelFitSer join StackPetrosian   
+StackModelFitExpObjectView     = ObjectThin join StackModelFitExp
+StackModelFitDeVObjectView     = ObjectThin join StackModelFitDeV
+StackModelFitSerObjectView     = ObjectThin join StackModelFitSer
+StackModelFitPetObjectView     = ObjectThin join StackPetrosian
+StackObjectPrimaryView         = ObjectThin join StackObjectThin join StackObjectAttributes join StackApFlx where primaryDection is true
+* StackObjectBestView          = ObjectThin join StackObject join StackObjectAttributes join StackApFlx where bestDetection is true
+ForcedMeanObjectView           = ObjectThin join ForcedMeanObject
+DetectionObjectView            = ObjectThin join MeanObject join Detection
+DiffDetObjectView	       = DiffDetObject join DiffDetection
+ForcedDetObjectView            = ObjectThin join ForcedWarpDetection
+
+
+*note1: StackObjectBestView - skip - we don't currently set bestDetection
+*note2: drop batchID it is not needed
+
+
+
Index: /branches/eam_branches/ipp-20150405/ippTools/share/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/share/Makefile.am	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/share/Makefile.am	(revision 38152)
@@ -347,4 +347,5 @@
 	pstamptool_listjob.sql \
 	pstamptool_listfile.sql \
+	pstamptool_listuser.sql \
 	pstamptool_pendingcleanup.sql \
 	pstamptool_pendingdependent.sql \
Index: /branches/eam_branches/ipp-20150405/ippTools/share/pstamptool_listuser.sql
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/share/pstamptool_listuser.sql	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippTools/share/pstamptool_listuser.sql	(revision 38152)
@@ -0,0 +1,10 @@
+SELECT  userName, 
+        domainName, 
+        pstampUser.accessLevel,
+        IFNULL(pstampUserDomain.accessLevel, 0) AS domainAccessLevel,
+        pstampUser.defaultProduct as userProduct,
+        pstampUser.defaultLabel as userLabel,
+        pstampUserDomain.defaultProduct as domainProduct,
+        pstampUserDomain.defaultLabel as domainLabel
+FROM    pstampUser 
+        LEFT JOIN pstampUserDomain USING(domainName)
Index: /branches/eam_branches/ipp-20150405/ippTools/share/remotetool_definebyquery_diff.sql
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/share/remotetool_definebyquery_diff.sql	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/share/remotetool_definebyquery_diff.sql	(revision 38152)
@@ -15,5 +15,5 @@
    JOIN remoteComponent USING(remote_id)
 WHERE
-remoteRun.stage = 'staticsky' AND remoteComponent.state != 'retry'
+remoteRun.stage = 'diff' AND remoteComponent.state != 'retry'
 -- where hook %s
 ) AS R
Index: /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.c
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.c	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.c	(revision 38152)
@@ -60,4 +60,7 @@
 static bool listfileMode(pxConfig *config);
 static bool deletefileMode(pxConfig *config);
+
+static bool listdomainMode(pxConfig *config);
+static bool listuserMode(pxConfig * config);
 
 # define MODECASE(caseName, func) \
@@ -110,4 +113,7 @@
         MODECASE(PSTAMPTOOL_MODE_LISTFILE, listfileMode);
         MODECASE(PSTAMPTOOL_MODE_DELETEFILE, deletefileMode);
+
+        MODECASE(PSTAMPTOOL_MODE_LISTDOMAIN, listdomainMode);
+        MODECASE(PSTAMPTOOL_MODE_LISTUSER, listuserMode);
 
         default:
@@ -1702,3 +1708,117 @@
     return true;
 }
+
+static bool listdomainMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psMetadata *where = psMetadataAlloc();
+    PXOPT_COPY_STR(config->args, where, "-domain", "domainName", "=");
+    PXOPT_COPY_S32(config->args, where, "-access_level", "accessLevel", "=");
+
+    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
+    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
+
+    psString query = psStringCopy("SELECT * from pstampUserDomain");
+
+    if (psListLength(where->list)) {
+        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
+        psStringAppend(&query, " WHERE %s", whereClause);
+        psFree(whereClause);
+    }
+    psFree(where);
+
+    // treat limit == 0 as "no limit"
+    if (limit) {
+        psString limitString = psDBGenerateLimitSQL(limit);
+        psStringAppend(&query, " %s", limitString);
+        psFree(limitString);
+    }
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    psArray *output = p_psDBFetchResult(config->dbh);
+    if (!output) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+    if (!psArrayLength(output)) {
+        psFree(output);
+        return true;
+    }
+
+    // negative simple so the default is true
+    if (!ippdbPrintMetadatas(stdout, output, "pstampUserDomain", !simple)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print array");
+        psFree(output);
+        return false;
+    }
+
+    psFree(output);
+
+    return true;
+}
+static bool listuserMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psMetadata *where = psMetadataAlloc();
+    PXOPT_COPY_STR(config->args, where, "-user", "userName", "=");
+    PXOPT_COPY_STR(config->args, where, "-domain", "domainName", "=");
+    PXOPT_COPY_S32(config->args, where, "-access_level", "pstampUser.accessLevel", "=");
+    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
+    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
+
+    if (!psListLength(where->list)) {
+        psError(PS_ERR_UNKNOWN, true, "search paramters are required");
+        return false;
+    }
+
+    psString query = pxDataGet("pstamptool_listuser.sql");
+
+    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
+    psStringAppend(&query, " WHERE %s", whereClause);
+    psFree(whereClause);
+    psFree(where);
+
+    // treat limit == 0 as "no limit"
+    if (limit) {
+        psString limitString = psDBGenerateLimitSQL(limit);
+        psStringAppend(&query, " %s", limitString);
+        psFree(limitString);
+    }
+
+    if (!p_psDBRunQuery(config->dbh, query)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        psFree(query);
+        return false;
+    }
+    psFree(query);
+
+    psArray *output = p_psDBFetchResult(config->dbh);
+    if (!output) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+    if (!psArrayLength(output)) {
+        psFree(output);
+        return true;
+    }
+
+    // negative simple so the default is true
+    if (!ippdbPrintMetadatas(stdout, output, "pstampUser", !simple)) {
+        psError(PS_ERR_UNKNOWN, false, "failed to print array");
+        psFree(output);
+        return false;
+    }
+
+    psFree(output);
+
+    return true;
+}
 # endif
Index: /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.h
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.h	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/src/pstamptool.h	(revision 38152)
@@ -53,4 +53,17 @@
     PSTAMPTOOL_MODE_LISTFILE,
     PSTAMPTOOL_MODE_DELETEFILE,
+
+    PSTAMPTOOL_MODE_ADDUSER,
+    PSTAMPTOOL_MODE_UPDATEUSER,
+    PSTAMPTOOL_MODE_LISTUSER,
+//    PSTAMPTOOL_MODE_GETUSERINFO,
+
+    PSTAMPTOOL_MODE_ADDDOMAIN,
+    PSTAMPTOOL_MODE_UPDATEDOMAIN,
+    PSTAMPTOOL_MODE_LISTDOMAIN,
+
+    PSTAMPTOOL_MODE_ADDACCESSLEVEL,
+    PSTAMPTOOL_MODE_UPDATEACCESSLEVEL,
+    PSTAMPTOOL_MODE_LISTACCCESSLEVEL,
 } pstamptoolMode;
 
Index: /branches/eam_branches/ipp-20150405/ippTools/src/pstamptoolConfig.c
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/src/pstamptoolConfig.c	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/src/pstamptoolConfig.c	(revision 38152)
@@ -303,4 +303,34 @@
     psMetadataAddS64(deletefileArgs, PS_LIST_TAIL, "-job_id",      0, "select by job ID (required)", 0);
 
+    // -adduserdomain
+    psMetadata *adduserdomainArgs = psMetadataAlloc();
+    psMetadataAddStr(adduserdomainArgs, PS_LIST_TAIL, "-domain",   0, "define domain name (required)", NULL);
+    psMetadataAddS32(adduserdomainArgs, PS_LIST_TAIL, "-access_level", 0, "define default access level for users in this domain (required)", 0);
+    psMetadataAddStr(adduserdomainArgs, PS_LIST_TAIL, "-default_product",      0, "define default data store product for users in this domain", NULL);
+    psMetadataAddStr(adduserdomainArgs, PS_LIST_TAIL, "-default_label",      0, "define default label for requests from users in this domain", NULL);
+
+    // -listdomain
+    psMetadata *listdomainArgs = psMetadataAlloc();
+    psMetadataAddStr(listdomainArgs, PS_LIST_TAIL, "-domain",   0, "define domain name", NULL);
+    psMetadataAddS32(listdomainArgs, PS_LIST_TAIL, "-access_level", 0, "select by  access level", 0);
+    psMetadataAddU64(listdomainArgs, PS_LIST_TAIL, "-limit",       0, "limit result set to N items", 0);
+    psMetadataAddBool(listdomainArgs, PS_LIST_TAIL, "-simple",     0, "use the simple output format", false);
+
+    // -adduser
+    psMetadata *adduserArgs = psMetadataAlloc();
+    psMetadataAddStr(adduserArgs, PS_LIST_TAIL, "-user",   0, "define user name (required)", NULL);
+    psMetadataAddStr(adduserArgs, PS_LIST_TAIL, "-domain",   0, "define user's domain name (required)", NULL);
+    psMetadataAddS32(adduserArgs, PS_LIST_TAIL, "-access_level", 0, "define maximum access level for this user (required)", 0);
+    psMetadataAddStr(adduserArgs, PS_LIST_TAIL, "-default_product",      0, "define default data store product for this user", NULL);
+    psMetadataAddStr(adduserArgs, PS_LIST_TAIL, "-default_label",      0, "define default label for requests from this user", NULL);
+
+    // -listuser
+    psMetadata *listuserArgs = psMetadataAlloc();
+    psMetadataAddStr(listuserArgs, PS_LIST_TAIL, "-user",   0, "select by user name", NULL);
+    psMetadataAddStr(listuserArgs, PS_LIST_TAIL, "-domain",   0, "select by user's domain name", NULL);
+    psMetadataAddS32(listuserArgs, PS_LIST_TAIL, "-access_level", 0, "select by maximum access level", 0);
+    psMetadataAddU64(listuserArgs, PS_LIST_TAIL, "-limit",       0, "limit result set to N items", 0);
+    psMetadataAddBool(listuserArgs, PS_LIST_TAIL, "-simple",     0, "use the simple output format", false);
+
     PXOPT_ADD_MODE("-addreq",          "", PSTAMPTOOL_MODE_ADDREQ,       addreqArgs);
     PXOPT_ADD_MODE("-pendingreq",      "", PSTAMPTOOL_MODE_PENDINGREQ,   pendingreqArgs);
@@ -334,4 +364,7 @@
     PXOPT_ADD_MODE("-listfile",        "", PSTAMPTOOL_MODE_LISTFILE,   listfileArgs);
     PXOPT_ADD_MODE("-deletefile",      "", PSTAMPTOOL_MODE_DELETEFILE,   deletefileArgs);
+
+    PXOPT_ADD_MODE("-listdomain",      "", PSTAMPTOOL_MODE_LISTDOMAIN, listdomainArgs);
+    PXOPT_ADD_MODE("-listuser",        "", PSTAMPTOOL_MODE_LISTUSER, listuserArgs);
 
     if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
Index: /branches/eam_branches/ipp-20150405/ippTools/src/pxspace.c
===================================================================
--- /branches/eam_branches/ipp-20150405/ippTools/src/pxspace.c	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippTools/src/pxspace.c	(revision 38152)
@@ -59,22 +59,22 @@
 bool pxspaceBoxAddWhere(pxConfig *config, psMetadata *where)
 {
-  PXOPT_LOOKUP_F64(ra_min, config->args, "-ra_min", false, false);
-  PXOPT_LOOKUP_F64(ra_max, config->args, "-ra_max", false, false);
-  PXOPT_LOOKUP_F64(dec_min, config->args, "-dec_min", false, false);
-  PXOPT_LOOKUP_F64(dec_max, config->args, "-dec_max", false, false);
+  PXOPT_LOOKUP_F64(ra_min, config->args, "-ra_min", false, NAN);
+  PXOPT_LOOKUP_F64(ra_max, config->args, "-ra_max", false, NAN);
+  PXOPT_LOOKUP_F64(dec_min, config->args, "-dec_min", false, NAN);
+  PXOPT_LOOKUP_F64(dec_max, config->args, "-dec_max", false, NAN);
 
-  if (ra_min) {
+  if (isfinite(ra_min)) {
     ra_min *= PS_RAD_DEG;
     psMetadataAddF32(where,PS_LIST_TAIL,"rawExp.ra",PS_META_DUPLICATE_OK, ">=", ra_min);
   }
-  if (ra_max) {
+  if (isfinite(ra_max)) {
     ra_max *= PS_RAD_DEG;
     psMetadataAddF32(where,PS_LIST_TAIL,"rawExp.ra",PS_META_DUPLICATE_OK, "<=", ra_max);
   }
-  if (dec_min) {
+  if (isfinite(dec_min)) {
     dec_min *= PS_RAD_DEG;
     psMetadataAddF32(where,PS_LIST_TAIL,"rawExp.decl",PS_META_DUPLICATE_OK, ">=", dec_min);
   }
-  if (dec_max) {
+  if (isfinite(dec_max)) {
     dec_max *= PS_RAD_DEG;
     psMetadataAddF32(where,PS_LIST_TAIL,"rawExp.decl",PS_META_DUPLICATE_OK, "<=", dec_max);
Index: /branches/eam_branches/ipp-20150405/ippconfig/gpc1/psastro.config
===================================================================
--- /branches/eam_branches/ipp-20150405/ippconfig/gpc1/psastro.config	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippconfig/gpc1/psastro.config	(revision 38152)
@@ -319,5 +319,5 @@
 
 SAS_REFERENCE METADATA
-    PSASTRO.CATDIR              STR      SAS.REF.V1
+    PSASTRO.CATDIR                 STR  SAS.REF.V1
 END
 
@@ -584,5 +584,5 @@
     DVO.GETSTAR.MIN.MAG.INST	F32   -15.0
 #   PSASTRO.CATDIR                       STR     PS1.REF.20120524
-#    PSASTRO.CATDIR               STR     PS1.REF.20140605
+#   PSASTRO.CATDIR               STR     PS1.REF.20140605
     PSASTRO.CATDIR               STR  PS1.REF.20140713
     ZERO.POINT.USE.MEAN                  BOOL    TRUE
@@ -598,4 +598,5 @@
     PSASTRO.MAX.ERROR      F32      0.2  # in arcsec units, if larger than 0.2" on skycell then a problem..
 
+    TRANSFORM.GALAXY.SHAPE.ERRORS  BOOL T
 END
 
Index: /branches/eam_branches/ipp-20150405/ippconfig/recipes/psphot.config
===================================================================
--- /branches/eam_branches/ipp-20150405/ippconfig/recipes/psphot.config	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippconfig/recipes/psphot.config	(revision 38152)
@@ -296,4 +296,5 @@
 PETROSIAN_R0                        F32    5.0 # reference radius in pixels
 PETROSIAN_FLUX_RATIO                F32    0.1 # we measure out to where flux = R0 * FLUX_RATIO
+REPAIR.PETROSIAN.MAG.ERRORS         BOOL  FALSE # write PETRO_MAG_ERR as dFlux / Flux when writing
 
 # APTREND                           STR   NONE, CONSTANT, SKYBIAS, SKYSAT, XY_LIN, SKY_XY_LIN, SKYSAT_XY_LIN, ALL
@@ -514,4 +515,6 @@
   PEAKS_NMAX_TOTAL                    S32   0 # set this to limit the allowed number of peaks - Yields fault instead of avoid memory explosion
 
+  REPAIR.PETROSIAN.MAG.ERRORS         BOOL  TRUE # write PETRO_MAG_ERR as dFlux / Flux when writing
+
   SAVE.RESID                          BOOL  FALSE
 END
Index: /branches/eam_branches/ipp-20150405/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- /branches/eam_branches/ipp-20150405/ippconfig/recipes/reductionClasses.mdc	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/ippconfig/recipes/reductionClasses.mdc	(revision 38152)
@@ -1301,18 +1301,19 @@
 
 SAS_REFERENCE METADATA
-   CHIP_PPIMAGE    STR CHIP
-   CHIP_PSPHOT STR CHIP
-   WARP_PSWARP STR WARP
-   STACK_PPSTACK   STR STACK
-   STACK_PPSUB STR STACK
-   STACK_PSPHOT    STR STACK
-   DIFF_PPSUB  STR DIFF
-   DIFF_PSPHOT STR DIFF
-   JPEG_BIN1   STR PPIMAGE_J1
-   JPEG_BIN2   STR PPIMAGE_J2
-   FAKEPHOT    STR FAKEPHOT
-   ADDSTAR     STR ADDSTAR
-   PSASTRO     STR SAS_REFERENCE
-   STACKPHOT       STR     STACKPHOT
+   CHIP_PPIMAGE     	 STR CHIP
+   CHIP_PSPHOT 	    	 STR CHIP
+   WARP_PSWARP 	    	 STR WARP
+   STACK_PPSTACK    	 STR STACK
+   STACK_PPSUB      	 STR STACK
+   STACK_PSPHOT     	 STR STACK
+   DIFF_PPSUB  		 STR DIFF
+   DIFF_PSPHOT 		 STR DIFF
+   JPEG_BIN1   		 STR PPIMAGE_J1
+   JPEG_BIN2   		 STR PPIMAGE_J2
+   FAKEPHOT    		 STR FAKEPHOT
+   ADDSTAR     		 STR ADDSTAR
+   PSASTRO     		 STR SAS_REFERENCE
+   STACKPHOT_PSPHOT	 STR STACKPHOT
+   STATICSKY_CALIBRATION STR STATICSKY_CAL
 END
 
Index: /branches/eam_branches/ipp-20150405/ippconfig/recipes/remote_hosts.config
===================================================================
--- /branches/eam_branches/ipp-20150405/ippconfig/recipes/remote_hosts.config	(revision 38152)
+++ /branches/eam_branches/ipp-20150405/ippconfig/recipes/remote_hosts.config	(revision 38152)
@@ -0,0 +1,27 @@
+ACTIVE     STR    LANL
+
+LANL METADATA
+     DMZ_HOST	STR	wtrw
+
+     SEC_HOST MULTI
+       SEC_HOST STR	mu-fe1
+       SEC_HOST STR	mu-fe2
+       SEC_HOST	STR	mu-fe3
+       SEC_HOST	STR	mu-fe4
+     END
+
+     IPP_PATH        STR     /turquoise/usr/projects/cosmo/mswarren/ipp/
+     REMOTE_ROOT     STR     /scratch3/watersc1/
+     REMOTE_HOSTNAME STR     LANL/Mustang
+END
+
+UHCRAY METADATA
+     DMZ_HOST	STR	128.171.123.18
+
+     SEC_HOST MULTI
+     END
+
+     IPP_PATH	     STR     /home/watersc/src/
+     REMOTE_ROOT     STR     /lus/scratch/watersc/
+     REMOTE_HOSTNAME STR     UH/Cray
+END     
Index: /branches/eam_branches/ipp-20150405/psModules/src/objects/pmSourceIO_CMF.c.in
===================================================================
--- /branches/eam_branches/ipp-20150405/psModules/src/objects/pmSourceIO_CMF.c.in	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/psModules/src/objects/pmSourceIO_CMF.c.in	(revision 38152)
@@ -552,4 +552,10 @@
     psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTNAME", PS_META_REPLACE, "xsrc table extension", extname);
 
+    // we can either write out the petrosian mag errors correctly or inverted (by default, psphot writes them out inverted)
+    bool repairMagErrors = psMetadataLookupBool (&status, recipe, "REPAIR.PETROSIAN.MAG.ERRORS");
+    if (repairMagErrors) {
+      psMetadataAddBool (outhead, PS_LIST_TAIL, "REPAIR.PETROSIAN.MAG.ERRORS", PS_META_REPLACE, "", true);
+    }
+
     pmChip *chip = readout->parent->parent;
     pmFPA  *fpa  = chip->parent;
@@ -651,6 +657,16 @@
 		// XXX note that this mag is either calibrated or instrumental depending on existence of zero point 
 		float mag = (extpars->petrosianFlux > 0.0) ? -2.5*log10(extpars->petrosianFlux) + magOffset : NAN; // XXX zero point
-		// XXX NOTE EAM 20140806 : PETRO_MAG_ERR is inverted!! oops!!
+		// NOTE EAM 20140806 : PETRO_MAG_ERR was inverted!! this allows for it to be repaired
 		float magErr = (extpars->petrosianFlux > 0.0) ? extpars->petrosianFlux / extpars->petrosianFluxErr : NAN; // XXX zero point
+		if (repairMagErrors) {
+		  // I need to add the kron error in quadrature becasue pet_error ignores the object flux
+		  float Krf  = source->moments ? source->moments->KronFlux : NAN;
+		  float dKrf = source->moments ? source->moments->KronFluxErr : NAN;
+		  if (isfinite (Krf) && isfinite (dKrf)) {
+		    magErr = sqrt(PS_SQR(1.0 / magErr) + PS_SQR(dKrf / Krf));
+		  } else {
+		    magErr = 1.0 / magErr;
+		  }
+		}
                 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_MAG",        PS_DATA_F32, "Petrosian Magnitude", mag);
                 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_MAG_ERR",    PS_DATA_F32, "Petrosian Magnitude Error", magErr);
@@ -836,4 +852,6 @@
     }
 
+    bool repairMagErrors = psMetadataLookupBool (&status, tableHeader, "REPAIR.PETROSIAN.MAG.ERRORS");
+
     for (long i = 0; i < numSources; i++) {
         psMetadata *row = psFitsReadTableRow(fits, i); // Table row
@@ -867,12 +885,25 @@
         extpars->axes.theta = psMetadataLookupF32(&status, row, "F25_THETA");
 
+	// magErr may have been saved in inverted form
         float mag = psMetadataLookupF32(&status, row, "PETRO_MAG");
         float magErr = psMetadataLookupF32(&status, row, "PETRO_MAG_ERR");
         if (isfinite(mag)) {
-            extpars->petrosianFlux    = pow(10., (magOffset - mag) / 2.5);
-            if (isfinite(magErr)) {
-                extpars->petrosianFluxErr = extpars->petrosianFlux / magErr;
-            }
-        }
+	  extpars->petrosianFlux    = pow(10., (magOffset - mag) / 2.5);
+	  if (isfinite(magErr)) {
+	    if (repairMagErrors) {
+	      // I need to add the kron error in quadrature becasue pet_error ignores the object flux
+	      float Krf  = source->moments ? source->moments->KronFlux : NAN;
+	      float dKrf = source->moments ? source->moments->KronFluxErr : NAN;
+	      if (isfinite (Krf) && isfinite (dKrf)) {
+		magErr = 1.0 / sqrt(PS_SQR(magErr) - PS_SQR(dKrf / Krf));
+	      } else {
+		magErr = 1.0 / magErr;
+	      }
+	      extpars->petrosianFluxErr = extpars->petrosianFlux * magErr;
+	    } else {
+	      extpars->petrosianFluxErr = extpars->petrosianFlux / magErr;
+	    }
+	  }
+	}
 
         extpars->petrosianRadius   = psMetadataLookupF32(&status, row, "PETRO_RADIUS");
Index: /branches/eam_branches/ipp-20150405/pstamp/scripts/pstampparse.pl
===================================================================
--- /branches/eam_branches/ipp-20150405/pstamp/scripts/pstampparse.pl	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/pstamp/scripts/pstampparse.pl	(revision 38152)
@@ -55,15 +55,9 @@
 die "invalid mode '$mode'" unless ($mode eq "list_uri") or ($mode eq "queue_job");
 die "--file is required"   unless defined($request_file_name);
-
-if ($mode ne "list_uri") {
-    die "req_id is required"  if !$req_id;
+die "req_id is required"  unless defined $req_id;
+if ($mode ne 'list_uri') {
     die "outdir is required"  if !$outdir;
-    die "product is required" if !$product;
 } else {
-    # mode eq 'list_uri' (used for parser testing)
-    # these values won't be used for anything but should be defined to avoid errors
-    $req_id  = 0;
-    $outdir  = "nowhere";
-    $product = "dummy";
+    $outdir = "somewhere" if !$outdir
 }
 
@@ -95,4 +89,28 @@
 # do not update the database
 $no_update = 1 if $mode ne "queue_job";
+
+$product = 'NULL' unless $product;
+
+
+# look up some defaults
+my $defaultAccessLevel = metadataLookupS32($ipprc->{_siteConfig}, 'PSTAMP_DEFAULT_ACCESS_LEVEL');
+if (!defined $defaultAccessLevel) {
+    warn("cannot find 'PSTAMP_DEFAULT_ACCESS_LEVEL' in site config");
+    exit ($PS_EXIT_CONFIG_ERROR);
+}
+
+# look up the default data store product.
+my $defaultDSProduct = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_DATA_STORE_PRODUCT');
+if (!defined $defaultDSProduct) {
+    # Don't panic yet that it's not defined.
+    #  exit ($PS_EXIT_CONFIG_ERROR);
+    $defaultDSProduct = ''; # set to empty string to simplify some comparisions below
+    print STDERR "Warning PSTAMP_DATA_STORE_PRODUCT not found in the site config.\n" if  $product eq 'NULL';
+}
+
+my $productIsDefault = 0;
+if ($product and $defaultDSProduct) {
+    $productIsDefault = ($product eq $defaultDSProduct);
+}
 
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
@@ -159,5 +177,5 @@
     my $exitStatus = $error_code >> 8;
     if ($success) {
-        # -listreq succeeded duplicate request name
+        # -listreq succeeded there is already a request in the database with this name
         print STDERR "REQ_NAME $req_name has already been used\n";
         insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST);
@@ -170,7 +188,10 @@
 
 
-# Adjust the label for requests coming in over the web interface
+# Adjust the label for requests coming in over the web upload interface
+# XXX: do this later based on the user information
 
 my $label_changed = 0;
+# We now use the access tabels to set the label.
+if (0) {
 if ($label and $label eq "WEB.UP") {
     my $lcname = lc($req_name);
@@ -199,9 +220,54 @@
     print "Setting label for $req_name to $label\n" if $label_changed;
 }
-
+}
+
+# XXX: update these comments
+# product passed in is either one specific to the submitting pstampDataStore or the default
+# "pstampresults"
+# Here, we need to decide whether to change that based on email 
+# WE can't use label (yet) because the PSI cgi script sets it to PSI
+# Do we ever need to use label? Is it obsolete? Check test procedures.
+
+my $productForUser;
+my $labelForUser = $label;  # for now I pass the current label for use in hacking permissions for V1 requests
+
+my $accessLevel = getUsersAccessLevel($email, \$labelForUser, \$productForUser);
+if ($accessLevel < 0) {
+    print STDERR "Data access is forbidden.\n";
+    insertFakeJobForRow(undef, 0, $PSTAMP_NOT_AUTHORIZED);
+}
+
+# if the request came through the upload channel, change it to the user's specific label
+# if any is known.
+if ($label and $label eq 'WEB.UP') {
+    if ($labelForUser) {
+        $label = $labelForUser;
+        $label_changed = 1;
+    }
+}
+
+# XXX: Think through when and if we change the product.
+# If the product is the system default, set it to the product for the user@domain. That way 
+# if the request came through a data store that target will be used.
+# We really only need to redirect the results with greater access level than the default
+if ($productIsDefault or $product eq 'NULL') {
+    if ($productForUser) {
+        $product = $productForUser;
+    }
+} else {
+    # if we don't have a product use default
+    if ($product eq 'NULL') {
+        $product = $defaultDSProduct;
+    }
+}
+
+if (!$product or $product eq 'NULL') {
+    # this will only happen if the site.config variable is missing.
+    my_die("No product found.\n", $PS_EXIT_CONFIG_ERROR);
+}
 
 {
-    # update the database with the request name. This will be used as the
-    # the fileset name in the output data store
+    # update the request's row with the new parameters.
+    # The requset name will be used to set the output fileset name in the output data store.
     my $command = "$pstamptool -updatereq -req_id $req_id  -set_name $req_name";
     $command .= " -set_username $email" if $email ne 'null';
@@ -223,4 +289,9 @@
 }
 
+if ($accessLevel < 0) {
+    exit 0;
+}
+
+
 #
 # now convert the request table to an array of metadatas
@@ -271,10 +342,4 @@
 my $num_jobs = 0;
 
-my $accessLevel = getUsersAccessLevel($email, $label);
-if ($accessLevel < 0) {
-    print STDERR "Data access forbidden.\n";
-    insertFakeJobForRow(undef, 0, $PSTAMP_NOT_AUTHORIZED);
-    exit 0;
-}
 
 foreach my $row (@$rows) {
@@ -528,4 +593,23 @@
         # avoid error from print below if $id isn't needed
         $row->{ID} = "" if !$row->{ID};
+
+        # if this user does not have unlimited access rights adjust the date cut
+        # to avoid more recent data
+        my $mjd_max;
+        # We do not adjust dates for stacks since they are not well defined enough.
+        # We'll need to filter them by accessLevel during the lookup
+        my $stage = $row->{IMG_TYPE};
+        if ($stage ne 'stack' and adjustDateCuts($row, \$mjd_max)) {
+            # if lower limit was supplied by user we can leave the value alone
+            if ($row->{MJD_MAX}) {
+                if ($row->{MJD_MAX} > $mjd_max) {
+                    print STDERR "Access rights require limiting MJD_MAX to $mjd_max\n";
+                    $row->{MJD_MAX} = $mjd_max;
+                }
+            } else {
+                # no limit supplied we silently adjust it
+                $row->{MJD_MAX} = $mjd_max;
+            }
+        }
     }
     
@@ -1178,36 +1262,71 @@
 }
 
-# Prototype function for setting access level.
-# XXX: Implement something more flexible using the database.
+# get user's access level default label and output product
 sub getUsersAccessLevel {
     my $email = shift;
-    my $label = shift;
-
+    my $r_label = shift;
+    my $r_product = shift;
+
+    # $r_label is a copy of the initial label. We change it to a user specific one
+    # if one is found.
+    my $label = $$r_label;
+
+    # default settings
+    $$r_label   =  undef;
+    $$r_product =  undef;
     my $level = -1;
 
     if (!$email) {
-        # No email provided. Eventually this will be forbidden.
-        # For now in order to temporarily continue to support the version 1 request format
+        # No email provided. 
+        # For now in order to temporarily continue to support the version 1 request format.
         # set the access rights based on the assigned label.
+        # Before deployment this will be forbidden.
         if ($label eq 'IFA' or $label eq 'QUB' or $label =~ 'MOPS') {
-            $level = 0;
+            $level = 2;
         } else {
-            # access rights PS1 data only
-            $level = 1;
+            $level = $defaultAccessLevel;
+        }
+        return $level
+    }
+
+    # we've got an email check the domain
+    my ($user, $domain) = split '@', $email;
+    unless ($user and $domain) {
+        print STDERR "Error $email is not an acceptable email adddress.\n";
+        return -1;
+    } 
+
+    my $cmd = "$pstamptool -listuser -user $user -domain $domain";
+    my $results = runToolAndParse($cmd, $verbose);
+    my $userinfo = $results->[0];
+    if ($userinfo) {
+        $level = $userinfo->{accessLevel};
+        if ($userinfo->{userProduct}) {
+            $$r_product = $userinfo->{userProduct};
+        } elsif ($userinfo->{domainProduct}) {
+            $$r_product = $userinfo->{domainProduct};
+        }
+        if ($userinfo->{userLabel}) {
+            $$r_label = $userinfo->{userLabel};
+        } elsif ($userinfo->{domainLabel}) {
+            $$r_label = $userinfo->{domainLabel};
         }
     } else {
-        # we've got an email check the domain
-        my ($user, $domain) = split '@', $email;
-        if ($domain) {
-            $domain = lc($domain);
-            if ($domain eq 'ifa.hawaii.edu' or $domain eq 'qub.ac.uk') {
-                $level = 0;
-            } else {
-                # XXX check for special users
-                # access rights PS1 data only
-                $level = 1;
-            }
-        } else {
-            print STDERR "Error: $email is not a valid email address\n";
+        my $cmd = "$pstamptool -listdomain -domain $domain";
+        my $results = runToolAndParse($cmd, $verbose);
+        my $domaininfo = $results->[0];
+        if ($domaininfo) {
+            $level = $domaininfo->{accessLevel};
+            if ($domaininfo->{defaultProduct}) {
+                $$r_product = $domaininfo->{defaultProduct};
+            }
+            if ($domaininfo->{defaultLabel}) {
+                $$r_label = $domaininfo->{defaultLabel};
+            }
+    } else {
+            # no specific user or domain information found in the database. Use the defaults
+            $level = $defaultAccessLevel;
+            $$r_label =  undef;
+            $$r_product =  undef;
         }
     }
@@ -1225,5 +1344,5 @@
 
     my $MJD_PS1_BEGIN = 54922;    # 2009-04-01
-    my $MJD_PS1_END   = 56838;    # 2014-06-30      XXX get the actual date
+    my $MJD_PS1_END   = 57082;    # 2015-03-01
 
     if ($row->{accessLevel} == 1) {
Index: /branches/eam_branches/ipp-20150405/tools/checkexp
===================================================================
--- /branches/eam_branches/ipp-20150405/tools/checkexp	(revision 38151)
+++ /branches/eam_branches/ipp-20150405/tools/checkexp	(revision 38152)
@@ -53,5 +53,6 @@
         summitExp.fault AS summit_fault, 
         pzDownloadExp.state AS download_state, count(pzDownloadImfile.class_id) AS download_count,
-        newExp.state AS newExp_state, newExp.exp_id
+        newExp.state AS newExp_state, newExp.exp_id,
+        rawExp.state as rawExp_state
         FROM summitExp LEFT JOIN pzDownloadExp USING(exp_name) 
             LEFT JOIN pzDownloadImfile USING(exp_name) 
@@ -88,4 +89,6 @@
 my $first_exp_id;
 my $first_exp_name;
+my $last_registered_exp_id = "";
+my $last_registered_exp_name = "";
 while (my $se_ref = $se_stmt->fetchrow_hashref()) {
     push @summit_exps, $se_ref;
@@ -98,4 +101,5 @@
     my $imfiles = $se_ref->{imfiles};
     my $dateobs = $se_ref->{dateobs};
+    my $raw_state = $se_ref->{rawExp_state};
     if ($summit_fault) {
         push @summit_faults, $se_ref;
@@ -115,4 +119,8 @@
             $last_new_exp_id = $exp_id;
             $last_new_exp_name = $exp_name;
+        }
+        if ($raw_state and $raw_state eq 'full') {
+            $last_registered_exp_id = $exp_id;
+            $last_registered_exp_name = $exp_name;
         }
     }
@@ -180,4 +188,6 @@
 
 print "first exposure:  $first_exp_name $first_exp_id\n";
+print "last registered: $last_registered_exp_name $last_registered_exp_id\n" 
+            if $last_registered_exp_id ne $last_exp_id;
 print "last copied:     $last_new_exp_name $last_new_exp_id\n"
             if $last_new_exp_id ne $last_exp_id;
