28 #ifndef IMAGES_FITSIMAGE_H
29 #define IMAGES_FITSIMAGE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/images/Images/ImageInterface.h>
36 #include <casacore/images/Images/MaskSpecifier.h>
37 #include <casacore/tables/DataMan/TiledFileAccess.h>
38 #include <casacore/lattices/Lattices/TiledShape.h>
39 #include <casacore/fits/FITS/fits.h>
40 #include <casacore/casa/BasicSL/String.h>
41 #include <casacore/casa/Utilities/DataType.h>
43 #ifndef WCSLIB_GETWCSTAB
44 #define WCSLIB_GETWCSTAB
50 template <
class T>
class Lattice;
55 class CoordinateSystem;
310 template <
typename T>
318 template <
typename T>
332 #ifndef CASACORE_NO_AUTO_TEMPLATES
333 #include <casacore/images/Images/FITS2Image.tcc>
Referenced counted pointer for constant data.
virtual ImageInterface< Float > * cloneII() const
Make a copy of the object with new (reference semantics).
virtual void setMaximumCacheSize(uInt howManyPixels)
Set the maximum (allowed) cache size as indicated.
virtual String imageType() const
Get the image type (returns FITSImage).
DataType internalDataType() const
Return the (internal) data type.
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask.
void crackHeader(CoordinateSystem &cSys, IPosition &shape, ImageInfo &imageInfo, Unit &brightnessUnit, RecordInterface &miscInfo, Float &scale, Float &offset, uChar &magicUChar, Short &magicShort, Int &magicLong, Bool &hasBlanks, LogIO &os, FitsInput &infile, uInt whichRep)
Crack a primary header.
Lattice< Bool > * pPixelMask_p
virtual IPosition shape() const
return the shape of the FITSImage
virtual const LatticeRegion * getRegionPtr() const
Get the region used.
virtual Bool doGetSlice(Array< Float > &buffer, const Slicer &theSlice)
Do the actual get of the data.
FITSImage(const FITSImage &other)
Copy constructor (reference semantics)
CountedPtr< TiledFileAccess > pTiledFile_p
virtual ~FITSImage()
Destructor does nothing.
FITSImage & operator=(const FITSImage &other)
Assignment (reference semantics)
virtual Lattice< Bool > & pixelMask()
virtual void clearCache()
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSiz...
virtual void resize(const TiledShape &newShape)
Function which changes the shape of the FITSImage.
virtual void setCacheSizeFromPath(const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath)
Set the cache size as to "fit" the indicated path.
void reopenIfNeeded() const
Reopen the image if needed.
virtual void doPutSlice(const Array< Float > &sourceBuffer, const IPosition &where, const IPosition &stride)
The FITSImage is not writable, so this throws an exception.
virtual Bool isWritable() const
The FITSImage is not writable.
void open()
Open the image (used by setup and reopen).
static LatticeBase * openFITSImage(const String &name, const MaskSpecifier &)
Function to open a FITS image (new parser)
uInt whichHDU() const
Return the HDU number.
static String className()
returns "FITSImage".
FITSImage(const String &name, uInt whichRep=0, uInt whichHDU=0)
Construct a FITSImage from the disk FITS file name and extension and apply mask.
virtual uInt advisedMaxPixels() const
Returns the maximum recommended number of pixels for a cursor.
void setMaskZero(Bool filterZero)
Set the masking of values 0.0.
virtual Bool doGetMaskSlice(Array< Bool > &buffer, const Slicer §ion)
Do the actual get of the mask data.
static String get_fitsname(const String &fullname)
Separate any extension specification and return the pure fitsname.
void getImageAttributes(CoordinateSystem &cSys, IPosition &shape, ImageInfo &info, Unit &brightnessUnit, RecordInterface &miscInfo, Int &recsize, Int &recno, FITS::ValueType &dataType, Float &scale, Float &offset, uChar &uCharMagic, Short &shortMagic, Int &longMagic, Bool &hasBlanks, const String &name, uInt whichRep, uInt whichHDU)
Fish things out of the FITS file.
void setup()
Setup the object (used by constructors).
virtual Bool ok() const
Check class invariants.
virtual void reopen()
Reopen a temporarily closed image.
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Help the user pick a cursor for most efficient access if they only want pixel values and don't care a...
virtual String name(Bool stripPath=False) const
Returns the name of the disk file.
virtual Bool isMasked() const
Has the object really a mask? The FITSImage always has a pixel mask and never has a region mask so th...
virtual Bool isPaged() const
The lattice is paged to disk.
virtual Bool hasPixelMask() const
FITSimage always has a pixel mask so returns True.
virtual uInt maximumCacheSize() const
Maximum size - not necessarily all used.
virtual DataType dataType() const
Return the data type (TpFloat).
virtual void tempClose()
Temporarily close the image.
void crackExtHeader(CoordinateSystem &cSys, IPosition &shape, ImageInfo &imageInfo, Unit &brightnessUnit, RecordInterface &miscInfo, Float &scale, Float &offset, uChar &uCharMagic, Short &magicShort, Int &magicLong, Bool &hasBlanks, LogIO &os, FitsInput &infile, uInt whichRep)
Crack an image extension header.
FITSImage(const String &name, const MaskSpecifier &mask, uInt whichRep=0, uInt whichHDU=0)
Construct a FITSImage from the disk FITS file name and extension and apply mask or not.
static uInt get_hdunum(const String &fullname)
Get the extension index for any extension specification given in the full name.
virtual void setCacheSizeInTiles(uInt howManyTiles)
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
virtual Bool isPersistent() const
The lattice is persistent.
static void registerOpenFunction()
Register the open function.
virtual void showCacheStatistics(ostream &os) const
Report on cache success.
ValueType
FITS I/O Error message types.
const TableRecord & miscInfo() const
Often we have miscellaneous information we want to attach to an image.
const ImageInfo & imageInfo() const
The ImageInfo object contains some miscellaneous information about the image which unlike that stored...
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.