#addtool  -pretend -definebyquery -label LAP.ThreePi.20120706 -set_dvodb LAP.20120706 -set_minidvodb_group LAP.slice06.part2.cam -set_minidvodb -set_label LAP.slice06.part2.cam -stage cam -uncensored -ra_min 90 -ra_max 120 -decl_min -35 -decl_max 20 -dbname gpc1 -simple | wc

#addtool  -pretend -definebyquery -label LAP.ThreePi.20120706 -set_dvodb LAP.20120706 -set_minidvodb_group LAP.slice06.cam -set_minidvodb -set_label LAP.slice06.cam -stage cam -uncensored -ra_min 90 -ra_max 120 -decl_min 20 -decl_max 75 -dbname gpc1 -simple | wc


$label3 = "LAP.PV3.20140730.final";

$label3= "LAP.PV3.20140730.ff01";
;
#heather done bad things to segments and slices...
@labels = ($label3);

@segments = (0,1,2,3,4,5,6,7,8);
#@segments=(0,1);
@segments1 = ( -35, -22,-10,2,14,26,38,50,62);
@segments2 = ( -22,-10,2,14,26,38,50,62,75);


@slices = ("00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23");
#@slices = ("21","22","23");

foreach $label (@labels) {

foreach $slice (@slices) {
   
#$slice = $slices[0];
#$slice = $slices[1];
    foreach $num (@segments) {

	$dvodb = "LAP.PV3.20140730";
	$minidvodb_group = "LAP.PV3.slice$slice.$segments[$num].ffg";
	$dvodb_label = "$minidvodb_group";
	$ra_min = $slice*15.0;
	$ra_max = ($slice+1)*15.0;
	$dec_min = $segments1[$num];
	$dec_max = $segments2[$num];
#	print "$dvodb $minidvodb_group $ra_min $ra_max $dec_min $dec_max\n";

	
	$com =  "addtool -definebyquery  -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $dvodb_label -stage fullforce_summary -uncensored -set_minra $ra_min -set_maxra $ra_max -set_mindec  $dec_min -set_maxdec $dec_max -dbname gpc1";
	print "$com\n";
	`$com`;
    }

}
$com2 = "addtool -definebyquery  -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV3.pole.ffg -set_minidvodb -set_label LAP.PV3.pole.ffg -stage fullforce_summary -uncensored -set_minra 0 -set_maxra 360 -set_mindec 75 -set_maxdec 90 -dbname gpc1";
print "$com2\n";
`$com2`;
}
