Changeset 41440 for trunk/pstamp/scripts/dqueryparse.pl
- Timestamp:
- Nov 25, 2020, 5:26:50 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/dqueryparse.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/dqueryparse.pl
r40747 r41440 76 76 77 77 # Project name is hardcoded to gpc1 for the moment. 78 # -- set gpc1 by default and read in PROJECT column to update for actual query 78 79 $project = resolve_project($ipprc,"gpc1",$dbname,$dbserver); 79 80 my $imagedb = $project->{dbname}; … … 189 190 my $filter; 190 191 my $mjd; 192 my $tess_id; 193 my $component_id; 191 194 # Confirm that we only have one stage/filter/mjd 192 195 if ($fpa_id ne 'Not_Set') { # We only need to check things that aren't the known odd case. … … 195 198 $temp_hash{FILTER}{$query{$fpa_id}{FILTER}[$i]} = 1; 196 199 $temp_hash{'MJD-OBS'}{$query{$fpa_id}{'MJD-OBS'}[$i]} = 1; 200 $temp_hash{PROJECT}{$query{$fpa_id}{PROJECT}[$i]} = 1; 201 $temp_hash{COMPONENT_ID}{$query{$fpa_id}{COMPONENT_ID}[$i]} = 1; 202 $temp_hash{TESS_ID}{$query{$fpa_id}{TESS_ID}[$i]} = 1; 197 203 } 198 204 if (scalar(keys(%{ $temp_hash{STAGE} })) == 1) { … … 214 220 exit_with_failure(21,"Too many MJD-OBS specified"); 215 221 } 222 # add non-error cases/options as well 223 if (scalar(keys(%{ $temp_hash{PROJECT} })) == 1) { 224 if ( (keys(%{ $temp_hash{PROJECT} }))[0] ne 'Not_Set') { 225 $imagedb = (keys(%{ $temp_hash{PROJECT} }))[0]; 226 $project = resolve_project($ipprc,$imagedb,$dbname,$dbserver); 227 $imagedb = $project->{dbname}; 228 if (!$imagedb) { 229 my_die("failed to find imagedb for project: $project", $PS_EXIT_CONFIG_ERROR); 230 } 231 } 232 } 233 if (scalar(keys(%{ $temp_hash{TESS_ID} })) == 1) { 234 if ( (keys(%{ $temp_hash{TESS_ID} }))[0] ne 'Not_Set') { 235 $tess_id = (keys(%{ $temp_hash{TESS_ID} }))[0]; 236 } 237 else { 238 $tess_id = undef; 239 } 240 } 241 if (scalar(keys(%{ $temp_hash{COMPONENT_ID} })) == 1) { 242 if ( (keys(%{ $temp_hash{COMPONENT_ID} }))[0] ne 'Not_Set') { 243 $component_id = (keys(%{ $temp_hash{COMPONENT_ID} }))[0]; 244 } 245 else { 246 $component_id = undef; 247 } 248 } 216 249 } 217 250 … … 255 288 256 289 # Determine the query style for this fpa_id 290 # fix remove g for gpc2 257 291 if ($fpa_id =~ /o.*g.*o/) { 258 292 $query_style = 'byexp'; … … 287 321 $req_filter = $filter . '%'; 288 322 } 289 323 # set defqults if not_set 324 # if ($imagedb eq 'Not_Set') { 325 # $imagedb = 'gpc1'; 326 # } 327 # if ($component_id eq 'Not_Set') { 328 # $component_id = undef; 329 # } 330 # if ($tess_id eq 'Not_Set') { 331 # $tess_id = undef; 332 # } 333 290 334 # Call the PStamp code to find the images that contain the target on the given MJD in the specified filter. 291 335 my $pstamp_images_ref = locate_images($ipprc,$imagedb, 292 336 \@rowList, 293 337 $query_style,$stage, 294 $fpa_id, undef,undef,338 $fpa_id,$tess_id,$component_id, 295 339 $option_mask,$need_magic, 296 340 $mjd_min,$mjd_max,$req_filter,undef,$verbose); 297 341 298 342 foreach my $this_image_ref (@{ $pstamp_images_ref }) { 299 300 343 # loop over the rows that this component matched 301 344 foreach my $valid_index (@{ $this_image_ref->{row_index} }) { … … 308 351 $query{$fpa_id}{NEED_MAGIC}[$valid_index] = $need_magic; 309 352 $query{$fpa_id}{BAD_COMPONENT}[$valid_index] = 0; 310 311 353 if (exists($this_image_ref->{astrom})) { 312 354 $query{$fpa_id}{CATALOG}[$valid_index] = $this_image_ref->{astrom};
Note:
See TracChangeset
for help on using the changeset viewer.
