IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35855 for tags/ipp-20130712


Ignore:
Timestamp:
Jul 25, 2013, 3:21:58 PM (13 years ago)
Author:
watersc1
Message:

port from trunk of improved LAP logic and ppSkycell/coverage map code

Location:
tags/ipp-20130712
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20130712/ippScripts/scripts/lap_science.pl

    r35810 r35855  
    309309    my $magicDS_update_cmd  = "magicdstool -setfiletoupdate -magic_ds_id $chip_magicDS_id -set_label $label";
    310310    $magicDS_update_cmd    .= " -dbname $dbname " if defined $dbname;
     311    my $warptool_preupdate_cmd = "warptool -revertwarped -warp_id $warp_id -fault 26";
     312    $warptool_preupdate_cmd .= " -dbname $dbname " if defined $dbname;
    311313    my $warptool_update_cmd = "warptool -setskyfiletoupdate -warp_id $warp_id -set_label $label";
    312314    $warptool_update_cmd   .= " -dbname $dbname " if defined $dbname;
     
    314316    # only need to update the data if the warps are not full
    315317    if ($warp->{state} ne 'full') {
    316         if ($chip->{state} eq 'cleaned') {
     318        if (($chip->{state} eq 'cleaned')||  # Exposure is cleaned
     319            (($chip->{state} eq 'update')&&($chip->{label} ne $label))) {  # Exposure is owned by an interloper.
    317320            ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    318321                run(command => $chiptool_update_cmd, verbose => $verbose);
     
    341344        }
    342345
     346
     347        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     348            run(command => $warptool_preupdate_cmd, verbose => $verbose);
     349        unless ($success) {
     350            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     351            &my_die("Unable to perform warptool --revertwarped: $error_code", $exposure->{exp_id}, $data_group);
     352        }
     353
    343354        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    344355            run(command => $warptool_update_cmd, verbose => $verbose);
     
    364375    if (S64_IS_NOT_NULL($exposure->{chip_id})) {
    365376        if (($exposure->{chip_state} eq 'cleaned')||
     377            ($exposure->{chip_state} eq 'update')||
    366378            ($exposure->{chip_state} eq 'goto_cleaned')||
    367379            ($exposure->{chip_state} eq 'error_cleaned')) {
     
    14071419        'difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -diff_id @DIFF_ID@',
    14081420        'magictool -dbname @DBNAME@ -updaterun -set_state full -set_label @LABEL@.old -magic_id @MAGIC_ID@',
    1409         'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage chip -stage_id @CHIP_ID@',
    1410         'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage warp -stage_id @WARP_ID@',
    1411         'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage diff -stage_id @DIFF_ID@');
     1421#       'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage chip -stage_id @CHIP_ID@',
     1422#       'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage warp -stage_id @WARP_ID@',
     1423#       'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage diff -stage_id @DIFF_ID@');
    14121424   
    14131425    foreach my $exposure (@$exposures) {
  • tags/ipp-20130712/ippScripts/scripts/skycell_jpeg.pl

    r34800 r35855  
    1717my ($help,$masks);
    1818my ($tempFile,$tempName,$maskFile,$maskName);
     19$verbose = 0;
    1920my $ppSkycell = can_run('ppSkycell') or (warn "Can't find ppSkycell" and $missing_tools = 1);
    2021my $warptool  = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
     
    3839pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV;
    3940pod2usage(
    40     -msg => "Required options: --stage --stage_id --path_base\nHelpful options: --camera --dbname",
     41    -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname",
    4142    -exitval => 3,
    4243    ) unless
     
    100101            }           
    101102        }
    102         print "$skycell_id $projection_cell\n";
     103#       print "$skycell_id $projection_cell\n";
    103104        my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id);
    104         print "$file $state $quality\n";
     105#       print "$file $state $quality\n";
    105106        my $f_fh = $tangents{$projection_cell}{FILE};
    106107        print $f_fh "$file\n";
    107108        if ($masks) {
    108109            my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
    109             print "$mask\n";
     110#           print "$mask\n";
    110111            my $m_fh = $tangents{$projection_cell}{MFILE};
    111112            print $m_fh "$mask\n";
     
    118119        }
    119120        $command .= " ${outroot}.${projection_cell} ";
    120         print "$command\n";
     121#       print "$command\n";
    121122        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    122123        unless ($success) {
     
    197198            }           
    198199        }
    199         print "$skycell_id $projection_cell\n";
     200#       print "$skycell_id $projection_cell\n";
    200201        my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id);
    201         print "$file $state $quality\n";
     202#       print "$file $state $quality\n";
    202203        my $f_fh = $tangents{$projection_cell}{FILE};
    203204        print $f_fh "$file\n";
    204205        if ($masks) {
    205206            my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id);
    206             print "$mask\n";
     207#           print "$mask\n";
    207208            my $m_fh = $tangents{$projection_cell}{MFILE};
    208209            print $m_fh "$mask\n";
     
    215216        }
    216217        $command .= " ${outroot}.${projection_cell} ";
    217         print "$command\n";
     218#       print "$command\n";
    218219        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    219220        unless ($success) {
     
    297298                $tangents{$projection_cell}{$key}{FILE} = $tempFile;
    298299                $tangents{$projection_cell}{$key}{NAME} = $tempName;
     300                $tangents{$projection_cell}{$key}{N}    = 0;
    299301            }
    300302        }
    301303        foreach my $key (keys %products) {
    302             print "$skycell_id $projection_cell\n";     
     304#           print "$skycell_id $projection_cell\n";     
    303305            my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id);
    304             print "$file $state $quality\n";
     306#           print "$file $state $quality\n";
    305307            my $f_fh = $tangents{$projection_cell}{$key}{FILE};
    306             print $f_fh "$file\n";
     308            if ($ipprc->file_exists($file)) {
     309                print $f_fh "$file\n";
     310                $tangents{$projection_cell}{$key}{N} ++;
     311            }
    307312        }
    308313    }
     
    322327                $command .= " -Di BIN1 1 -Di BIN2 1 ";
    323328            }
    324             elsif ($key eq 'image') {
    325                 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
    326             }
    327             elsif ($key eq 'mask') {
    328                 next; # This should be made with the images.
    329             }
    330             print "$command\n";
    331             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    332             unless ($success) {
    333                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    334                 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     329#           elsif ($key eq 'image') {
     330#               $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
     331#           }
     332#           elsif ($key eq 'mask') {
     333#               next; # This should be made with the images.
     334#           }
     335            else {
     336                # Append the image list to other objects, in case the WCS information is unpopulated
     337                $command .= " -wcsref $tangents{$projection_cell}{image}{NAME} ";
     338            }
     339            if ($tangents{$projection_cell}{$key}{N} > 0) {
     340                print "$command\n";
     341                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     342                unless ($success) {
     343                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     344#                   print "Was unable to perform ppSkycell $stage_id $error_code $key\n";
     345                    &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     346                }
    335347            }
    336348        }
  • tags/ipp-20130712/ppSkycell/src

  • tags/ipp-20130712/ppSkycell/src/ppSkycell.h

    r28375 r35855  
    1111    psString imagesName;                // Filename with images
    1212    psString masksName;                 // Filename with masks
     13    psString wcsrefName;                // Filename with WCS references
    1314    psString outRoot;                   // Output root name
    1415    int numInputs;                      // Number of inputs
  • tags/ipp-20130712/ppSkycell/src/ppSkycellArguments.c

    r23996 r35855  
    5151    psMetadataAddStr(arguments, PS_LIST_TAIL, "-images", 0, "Filename with input images", NULL);
    5252    psMetadataAddStr(arguments, PS_LIST_TAIL, "-masks", 0, "Filename with input masks", NULL);
     53    psMetadataAddStr(arguments, PS_LIST_TAIL, "-wcsref", 0, "Filename with WCS references", NULL);
    5354    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 2) {
    5455        usage(argv[0], arguments, data);
     
    5758    data->imagesName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-images"));
    5859    data->masksName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-masks"));
     60    data->wcsrefName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-wcsref"));
     61   
    5962    data->outRoot = psStringCopy(argv[1]);
    6063
  • tags/ipp-20130712/ppSkycell/src/ppSkycellCamera.c

    r34800 r35855  
    7373    }
    7474
     75    psArray *wcsref = NULL;             // Names of WCS reference images
     76    if (data->wcsrefName) {
     77      wcsref = fileList(data->wcsrefName);
     78      if (!wcsref) {
     79        psError(psErrorCodeLast(), false, "No WCSrefs provided.");
     80        psFree(images);
     81        psFree(masks);
     82        return(false);
     83      }
     84      if (wcsref->n != data->numInputs) {
     85        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Number of images (%ld) and wcsrefs (%ld) do not match",
     86                images->n, wcsref->n);
     87        psFree(images);
     88        psFree(masks);
     89        psFree(wcsref);
     90        return(false);
     91      }
     92    }
     93   
    7594    psMetadataAddStr(data->config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Output root", data->outRoot);
    7695
     
    93112            }
    94113        }
     114
     115        if (data->wcsrefName) {
     116          fileArguments("WCSREF", wcsref->data[i], "Name of the WCS reference", data->config);
     117          pmFPAfile *wcsref = pmFPAfileDefineFromArgs(&status, data->config, "PPSKYCELL.WCSREF", "WCSREF");
     118          if (!status || !wcsref) {
     119            psError(PS_ERR_IO, false, "Failed to build file from PPSKYCELL.WCSREF");
     120            return(false);
     121          }
     122/*        if (!pmFPAfileBindFromArgs(&status, image, data->config, "PPSKYCELL.WCSREF", "WCSREF") || !status) { */
     123/*          psError(PS_ERR_IO, false, "Failed to build file from PPSKYCELL.WCSREF"); */
     124/*          return false; */
     125/*        } */
     126        }
     127       
    95128    }
    96129
  • tags/ipp-20130712/ppSkycell/src/ppSkycellData.c

    r24073 r35855  
    1515    psFree(data->imagesName);
    1616    psFree(data->masksName);
     17    psFree(data->wcsrefName);
    1718    psFree(data->outRoot);
    1819    psFree(data->config);
     
    2829    data->imagesName = NULL;
    2930    data->masksName = NULL;
     31    data->wcsrefName = NULL;
    3032    data->outRoot = NULL;
    3133    data->numInputs = 0;
  • tags/ipp-20130712/ppSkycell/src/ppSkycellLoop.c

    r34800 r35855  
    1010
    1111#define BUFFER 16                       // Size of buffer for projections
     12
     13#if (0)
     14// This is all junk that is basically useless, because it calculates things we already know.
    1215
    1316static void regionMinMax(psRegion *base,// Base region; modified
     
    2225}
    2326
     27
    2428static psRegion *skycellRegion(pmAstromWCS *wcs, // World Coordinate System
    2529                               int numCols, int numRows // Size of image
     
    3438    fromCoords->y = (Y); \
    3539    psPlaneTransformApply(toCoords, wcs->trans, fromCoords); \
     40    printf("%f %f %f %f\n",toCoords->x,toCoords->y,fromCoords->x,fromCoords->y); \
    3641    toCoords->x /= wcs->cdelt1; \
    3742    toCoords->y /= wcs->cdelt2; \
    38     toCoords->x += wcs->crpix1; \
    39     toCoords->y += wcs->crpix2; \
     43    toCoords->x -= wcs->crpix1;         \
     44    toCoords->y += wcs->crpix2;         \
    4045    region->x0 = PS_MAX(region->x0, toCoords->x); \
    4146    region->x1 = PS_MIN(region->x1, toCoords->x); \
    4247    region->y0 = PS_MIN(region->y0, toCoords->y); \
    4348    region->y1 = PS_MAX(region->y1, toCoords->y);
    44 
     49    //
    4550    REGION_RANGE(0, 0);                 // Lower left
    4651    psTrace("ppSkycell", 9, "Start: %.0f %.0f", toCoords->x, toCoords->y);
     
    4954    REGION_RANGE(numCols, numRows);     // Upper right
    5055    psTrace("ppSkycell", 9, "Stop: %.0f %.0f\n", toCoords->x, toCoords->y);
    51 
     56    psTrace("ppSkycell", 7, "%g %g %g %g\n",wcs->cdelt1,wcs->cdelt2,wcs->crpix1,wcs->crpix2);
    5257    return region;
    5358}
     59#endif
    5460
    5561// Activate/deactivate a single element for a list
     
    150156        pmAstromWCS *wcs = pmAstromWCSfromHeader(hdu->header); // World Coordinate System
    151157        if (!wcs) {
     158          if (data->wcsrefName) {
     159            pmFPAfile *wcsref = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.WCSREF", i);
     160            wcs = pmAstromWCSfromHeader(wcsref->fpa->hdu->header);
     161          }
     162          if (!wcs) {     
    152163            psError(psErrorCodeLast(), false, "Unable to read WCS for image %d", i);
    153164            return false;
    154         }
    155 
    156         psRegion *region = imageRegions->data[i] = skycellRegion(wcs, numCols, numRows); // Region of image
     165          }
     166        }
     167
     168        psRegion *region = psRegionAlloc(-1.0 * wcs->crpix1,numCols - wcs->crpix1,
     169                                         -1.0 * wcs->crpix2,numRows - wcs->crpix2);
     170        imageRegions->data[i] = region;
    157171        psTrace("ppSkycell", 5, "Image region %d is: [%.0f:%.0f,%.0f:%.0f]\n",
    158172                i, region->x0, region->x1, region->y0, region->y1);
     
    162176            if (wcs->crval1 == crval1->data.F64[j] && wcs->crval2 == crval2->data.F64[j] &&
    163177                wcs->cdelt1 == cdelt1->data.F64[j] && wcs->cdelt2 == cdelt1->data.F64[j]) {
    164                 regionMinMax(projRegions->data[j], region);
     178              //                regionMinMax(projRegions->data[j], region);
     179              psRegion *proj = projRegions->data[j];
     180              proj->x0 = PS_MIN(region->x0,proj->x0);
     181              proj->x1 = PS_MAX(region->x1,proj->x1);
     182              proj->y0 = PS_MIN(region->y0,proj->y0);
     183              proj->y1 = PS_MAX(region->y1,proj->y1);
    165184                target->data.S32[i] = j;
    166185                found = true;
     
    188207    for (int i = 0; i < numProj; i++) {
    189208        psRegion *projRegion = projRegions->data[i]; // Region for skycell projection
     209        //      projRegion->x0 += 5760;
     210        //projRegion->x1 += 5760;
     211        //      projRegion->x0 +=
     212        //      projRegion->x1 +=
    190213        psTrace("ppSkycell", 2, "Projection %d: [%.0f:%.0f,%.0f:%.0f]\n",
    191214                i, projRegion->x0, projRegion->x1, projRegion->y0, projRegion->y1);
    192         int xSize = -projRegion->x1 + projRegion->x0 + 1; // Size of unbinned image
     215        int xSize = projRegion->x1 - projRegion->x0 + 1; // Size of unbinned image
    193216        int ySize = projRegion->y1 - projRegion->y0 + 1; // Size of unbinned image
    194217        // Size of binned image 1
     
    209232            psImageInit(mask2, 0xFF);
    210233        }
     234        // HDU containing the WCS we plan on using
    211235        pmHDU *projhdu = NULL;
     236
     237        // Do we need to modify the WCS?  This flips to zero after we've done it once.
    212238        int modify_wcs1 = 1;
    213239        int modify_wcs2 = 1;
     240
     241        // Because we may have holes, we need to ensure that we set the CRPIX in the binned image correction.
     242        // Find the minimum/maximum, so we know where the zero is.
     243        float maxCRPIX1   = -99e99;
     244        float maxCRPIX2   = -99e99;
    214245        // Loop over inputs to this projection.
    215246        for (int j = 0; j < data->numInputs; j++) {
     
    229260            }
    230261
     262            // Read the HDU/WCS information from the first entry, and use that as the reference.
    231263            pmFPAfile *file = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.IMAGE", j);
     264            pmAstromWCS *wcs = pmAstromWCSfromHeader(file->fpa->hdu->header); // World Coordinate System
     265            if (!wcs) {
     266              if (data->wcsrefName) {
     267                pmFPAfile *wcsref = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.WCSREF", j);
     268                wcs = pmAstromWCSfromHeader(wcsref->fpa->hdu->header);
     269                if (!projhdu) {
     270                  projhdu = wcsref->fpa->hdu;
     271                }
     272              }
     273              if (!wcs) {         
     274                psError(psErrorCodeLast(), false, "Unable to read WCS for image %d", j);
     275                return false;
     276              }
     277            }
    232278            if (!projhdu) {
    233279              projhdu = file->fpa->hdu;
    234               //              psMetadataCopy(projhdu->header,file->fpa->hdu->header);
    235             }
    236 #if 0
    237             else {
    238               if ((psMetadataLookupF32(NULL,file->fpa->hdu->header,"CRPIX1") >=
    239                    psMetadataLookupF32(NULL,projhdu->header,"CRPIX1"))&&
    240                   (psMetadataLookupF32(NULL,file->fpa->hdu->header,"CRPIX2") >=
    241                    psMetadataLookupF32(NULL,projhdu->header,"CRPIX1"))) {
    242                 projhdu = file->fpa->hdu;
    243                 psMetadataCopy(projhdu->header,file->fpa->hdu->header);
    244               }
    245             }
    246 #endif   
    247            
     280            }
     281
     282            // However, we need to check to see if we've found the maximum CRPIX
     283            if (wcs->crpix1 > maxCRPIX1) {
     284              maxCRPIX1 = wcs->crpix1;
     285            }
     286            if (wcs->crpix2 < maxCRPIX2) {
     287              maxCRPIX2 = wcs->crpix2;
     288            }
     289
     290            // Actuall do the binning.
    248291            pmReadout *inRO = pmFPAviewThisReadout(view, file->fpa); // Readout with input
    249292            psFree(view);
    250293
    251             //      data->maskVal = 0xffff;
    252294            pmReadout *bin1RO = pmReadoutAlloc(NULL), *bin2RO = pmReadoutAlloc(NULL); // Binned readouts
    253295            if (!pmReadoutRebin(bin1RO, inRO, data->maskVal, data->bin1, data->bin1)) {
     
    262304            }
    263305
     306#if (0)
    264307            psRegion *imageRegion = imageRegions->data[j]; // Region for image
    265             // Offsets for image on skycell
    266             int xOffset1 = (-imageRegion->x0 + projRegion->x0) / (float)data->bin1;
    267             int yOffset1 = (-imageRegion->y1 + projRegion->y1) / (float)data->bin1;
     308            fprintf(stderr,"%d IM %f %f %f %f PR %f %f %f %f\n",
     309                    j,
     310                    imageRegion->x0,imageRegion->x1,
     311                    imageRegion->y0,imageRegion->y1,
     312                    projRegion->x0,projRegion->x1,
     313                    projRegion->y0,projRegion->y1);
     314#endif
     315            // Offsets for image on this projection cell are just differences in CRPIX positions.
     316            int xOffset1 = (-1 * wcs->crpix1 - projRegion->x0) / (float)(data->bin1);
     317            int yOffset1 = (-1 * wcs->crpix2 - projRegion->y0) / (float)(data->bin1);
     318           
    268319            int xOffset2 = xOffset1 / (float)data->bin2, yOffset2 = yOffset1 / (float)data->bin2;
     320            psTrace("ppSkycell",5,"Offsets: %d %d : %d %d",
     321                    xOffset1,yOffset1,xOffset2,yOffset2);
     322
     323            // Overlay the data onto the appropriate pixels in the final outputs
    269324            // XXX Completely neglecting rotations
    270325            // The skycells are divided up neatly with them all having the same orientation
     
    276331            }
    277332
     333            // Cleanup on input loop.
    278334            psFree(bin1RO);
    279335            psFree(bin2RO);
     
    345401            WCS->cdelt1 *= cd1f;
    346402            WCS->cdelt2 *= cd2f;
    347             WCS->crpix1 = WCS->crpix1 / cd1f;
    348             WCS->crpix2 = WCS->crpix2 / cd2f;
     403            // Fudge the CRPIX incase we have missing corners
     404            if (maxCRPIX1 > WCS->crpix1) {
     405              WCS->crpix1 = maxCRPIX1 / cd1f;
     406            }
     407            else {
     408              WCS->crpix1 = WCS->crpix1 / cd1f;
     409            }
     410            if (maxCRPIX2 > WCS->crpix2) {
     411              WCS->crpix2 = maxCRPIX2 / cd2f;
     412            }
     413            else {
     414              WCS->crpix2 = WCS->crpix2 / cd2f;
     415            }
    349416#if WCS_DEBUG
    350417            fprintf(stderr,">>> %d %d (%g %g) (%g %g) (%g %g) %d %d %d %d\n",data->bin1,data->bin2,
     
    376443            }
    377444            pmAstromWCStoHeader (fits1->fpa->hdu->header,WCS);
     445#if WCS_DEBUG
    378446            WCS = pmAstromWCSfromHeader(fits1->fpa->hdu->header);
    379 #if WCS_DEBUG
    380447            fprintf(stderr,">>> %d %d (%g %g) (%g %g) (%g %g)\n",data->bin1,data->bin2,
    381448                    cd1f,cd2f,WCS->cdelt1,WCS->cdelt2,
     
    448515            WCS->crpix2 = WCS->crpix2 / cd2f;
    449516           
    450             for (int q = 0; q < WCS->trans->x->nX; q++) {
    451               for (int r = 0; r < WCS->trans->x->nY; r++) {
     517            for (int q = 0; q <= WCS->trans->x->nX; q++) {
     518              for (int r = 0; r <= WCS->trans->x->nY; r++) {
    452519                WCS->trans->x->coeff[q][r] *= pow(cd1f,q) * pow(cd2f,r);
    453520              }
    454521            }
    455             for (int q = 0; q < WCS->trans->y->nX; q++) {
    456               for (int r = 0; r < WCS->trans->y->nY; r++) {
     522            for (int q = 0; q <= WCS->trans->y->nX; q++) {
     523              for (int r = 0; r <= WCS->trans->y->nY; r++) {
    457524                WCS->trans->y->coeff[q][r] *= pow(cd1f,q) * pow(cd2f,r);
    458525              }
Note: See TracChangeset for help on using the changeset viewer.