IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2012, 4:56:30 PM (14 years ago)
Author:
watersc1
Message:

Removed excess debug information, and pulled header information so that I don't need to hard code anything anymore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/pswarp/src/pswarpLoop.c

    r34487 r34489  
    605605        }
    606606
     607        // Pull information from the header of the background files so we can use it to set values.
     608        pmHDU *hdu = pmFPAviewThisHDU(view,input->fpa);
     609        psMetadata *header = hdu->header;
     610       
     611        int IMAXIS1 = psMetadataLookupS32(NULL,header,"IMNAXIS1");
     612        int IMAXIS2 = psMetadataLookupS32(NULL,header,"IMNAXIS2");
     613        int NAXIS1 = psMetadataLookupS32(NULL,header,"NAXIS1");
     614        int NAXIS2 = psMetadataLookupS32(NULL,header,"NAXIS2");
     615        char *CCDSUM = psMetadataLookupStr(NULL,header,"CCDSUM");
     616        int CCDSUM1 = atoi(strtok(CCDSUM," "));
     617        int CCDSUM2 = atoi(strtok(NULL," "));
     618       
     619        psMetadataAddF32(config->arguments,PS_LIST_TAIL,"BKG_WARP_XOFFSET", PS_META_REPLACE,
     620                         "xoffset for background model data", (NAXIS1 * CCDSUM1 - IMAXIS1) / (2.0 * CCDSUM1));
     621        psMetadataAddF32(config->arguments,PS_LIST_TAIL,"BKG_WARP_YOFFSET", PS_META_REPLACE,
     622                         "yoffset for background model data", (NAXIS2 * CCDSUM2 - IMAXIS2) / (2.0 * CCDSUM2));
     623        psTrace("pswarp",5,"%d %d %d %d %d %d %g %g %d %d",
     624                psMetadataLookupS32(NULL,header,"IMNAXIS1"),
     625                psMetadataLookupS32(NULL,header,"IMNAXIS2"),
     626                psMetadataLookupS32(NULL,header,"NAXIS1"),
     627                psMetadataLookupS32(NULL,header,"NAXIS2"),
     628                CCDSUM1,CCDSUM2,
     629                psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_XOFFSET"),
     630                psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_YOFFSET"),
     631                psMetadataLookupS32(NULL,config->arguments,"BKG.XGRID"),
     632                psMetadataLookupS32(NULL,config->arguments,"BKG.YGRID"));
     633       
     634       
    607635        // read WCS data from the corresponding header
    608         pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
     636        hdu = pmFPAviewThisHDU (view, astrom->fpa);
    609637
    610638        pmAstromWCS *WCS = pmAstromWCSfromHeader(hdu->header);
    611639
    612         double cd1f = 1.0 * 400;
    613         double cd2f = 1.0 * 400;
     640        double cd1f = (1.0 * CCDSUM1);// * (1.0 * psMetadataLookupS32(NULL,config->arguments,"BKG.XGRID"));
     641        double cd2f = (1.0 * CCDSUM2);// * (1.0 * psMetadataLookupS32(NULL,config->arguments,"BKG.YGRID"));
    614642
    615643        WCS->cdelt1 *= cd1f;
     
    681709               
    682710                psMetadataAddS32(config->arguments,PS_LIST_TAIL, "INTERPOLATION.MODE", PS_META_REPLACE, "", 8);
    683                 fprintf(stderr,"Transforming Readout!\n");
    684711
    685712                psMetadataAddBool(config->arguments,PS_LIST_TAIL, "BACKGROUND_WARPING", PS_META_REPLACE, "", true);
    686713                pswarpTransformReadout(output, readout, config);
    687714                psMetadataAddBool(config->arguments,PS_LIST_TAIL, "BACKGROUND_WARPING", PS_META_REPLACE, "", false);
     715
    688716                if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    689717                    psError(psErrorCodeLast(), false, "Unable to write files.");
     
    701729        }
    702730    }
    703     fprintf(stderr,"End readout transformations!\n");
    704731    if (!output->data_exists) {
    705732        psWarning("No overlap between input and skycell.");
Note: See TracChangeset for help on using the changeset viewer.