- Timestamp:
- 10/28/08 21:09:24 (16 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFITSImageWriter.cpp
r1443 r1444 30 30 //#--------------------------------------------------------------------------- 31 31 32 #include <fitsio.h> 32 33 #include <images/Images/TempImage.h> 33 34 … … 217 218 218 219 void STFITSImageWriter::classHackHeader(const String& filename) { 219 cout << "Not yet implemented" << endl; 220 int status = 0; 221 fitsfile *fptr; 222 cout << "filename" << endl; 223 if( fits_open_file(&fptr, filename.c_str(), READWRITE, &status) ) 224 throw AipsError("FCoudn't open fits file for CLASS modification"); 225 226 if ( fits_update_key(fptr, TSTRING, "CTYPE1", (char *)"FREQ", 227 NULL, &status) ) 228 throw AipsError("Couldn't modify CTYPE1."); 229 float restf,refval,newfreq; 230 fits_read_key(fptr, TFLOAT, "CRVAL1", 231 &refval, NULL, &status); 232 fits_read_key(fptr, TFLOAT, "RESTFREQ", 233 &restf, NULL, &status); 234 newfreq = refval - restf; 235 if ( fits_update_key(fptr, TFLOAT, "CRVAL1", &newfreq, NULL, &status) ) 236 throw AipsError("Couldn't modify CRVAL1"); 237 fits_close_file(fptr, &status); 238 220 239 } -
trunk/src/STFITSImageWriter.h
r1443 r1444 61 61 casa::Double lon, 62 62 casa::Double lat); 63 // Apply hacks to fits file so it can be read by class 64 // modifications are 65 // CTYPE1 : FREQ-XYZ -> FREQ 66 // CRVAL1 : -> CRVAL1-RESTFREQ 63 67 void classHackHeader(const casa::String& filename); 64 68
Note:
See TracChangeset
for help on using the changeset viewer.