Go to the documentation of this file.
28 #ifndef IMAGES_FITSIMAGE_H
29 #define IMAGES_FITSIMAGE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/images/Images/ImageInterface.h>
35 #include <casacore/images/Images/MaskSpecifier.h>
36 #include <casacore/tables/DataMan/TiledFileAccess.h>
37 #include <casacore/lattices/Lattices/TiledShape.h>
38 #include <casacore/fits/FITS/fits.h>
39 #include <casacore/casa/BasicSL/String.h>
40 #include <casacore/casa/Utilities/DataType.h>
42 #ifndef WCSLIB_GETWCSTAB
43 #define WCSLIB_GETWCSTAB
49 template <
class T>
class Array;
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>
334 #endif //# CASACORE_NO_AUTO_TEMPLATES
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...
Interconvert pixel and world coordinates.
A base class for astronomical images.
Specify which elements to extract from an n-dimensional array.
virtual Bool isWritable() const
The FITSImage is not writable.
virtual Bool isPersistent() const
The lattice is persistent.
static String get_fitsname(const String &fullname)
Separate any extension specification and return the pure fitsname.
A Vector of integers, for indexing into Array<T> objects.
virtual void resize(const TiledShape &newShape)
Function which changes the shape of the FITSImage.
virtual uInt maximumCacheSize() const
Maximum size - not necessarily all used.
virtual Bool doGetSlice(Array< Float > &buffer, const Slicer &theSlice)
Do the actual get of the data.
virtual void setMaximumCacheSize(uInt howManyPixels)
Set the maximum (allowed) cache size as indicated.
virtual Bool doGetMaskSlice(Array< Bool > &buffer, const Slicer §ion)
Do the actual get of the mask data.
const TableRecord & miscInfo() const
Often we have miscellaneous information we want to attach to an image.
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask.
Lattice< Bool > * pPixelMask_p
virtual Bool hasPixelMask() const
FITSimage always has a pixel mask so returns True.
Referenced counted pointer for constant data.
uInt whichHDU() const
Return the HDU number.
virtual String imageType() const
Get the image type (returns FITSImage).
CountedPtr< TiledFileAccess > pTiledFile_p
virtual void setCacheSizeInTiles(uInt howManyTiles)
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
static String className()
returns "FITSImage".
An optionally strided region in a Lattice.
virtual ImageInterface< Float > * cloneII() const
Make a copy of the object with new (reference semantics).
virtual void clearCache()
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSiz...
virtual void showCacheStatistics(ostream &os) const
Report on cache success.
virtual Bool ok() const
Check class invariants.
FITSImage(const FITSImage &other)
Copy constructor (reference semantics)
ostream-like interface to creating log messages.
void setMaskZero(Bool filterZero)
Set the masking of values 0.0.
virtual String name(Bool stripPath=False) const
Returns the name of the disk file.
virtual Bool isPaged() const
The lattice is paged to disk.
static uInt get_hdunum(const String &fullname)
Get the extension index for any extension specification given in the full name.
ValueType
FITS I/O Error message types.
A non-templated, abstract base class for array-like objects.
Class to specify which mask to use in an image.
static LatticeBase * openFITSImage(const String &name, const MaskSpecifier &)
Function to open a FITS image (new parser)
virtual Lattice< Bool > & pixelMask()
this file contains all the compiler specific defines
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.
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.
void reopenIfNeeded() const
Reopen the image if needed.
virtual const LatticeRegion * getRegionPtr() const
Get the region used.
DataType internalDataType() const
Return the (internal) data type.
static void registerOpenFunction()
Register the open function.
Class providing native access to FITS images.
Abstract base class for Record classes.
const ImageInfo & imageInfo() const
The ImageInfo object contains some miscellaneous information about the image which unlike that stored...
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
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.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
virtual IPosition shape() const
return the shape of the FITSImage
String: the storage and methods of handling collections of characters.
virtual DataType dataType() const
Return the data type (TpFloat).
bool Bool
Define the standard types used by Casacore.
FITSImage & operator=(const FITSImage &other)
Assignment (reference semantics)
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 void tempClose()
Temporarily close the image.
virtual void reopen()
Reopen a temporarily closed image.
void open()
Open the image (used by setup and reopen).
virtual uInt advisedMaxPixels() const
Returns the maximum recommended number of pixels for a cursor.
void setup()
Setup the object (used by constructors).
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 void doPutSlice(const Array< Float > &sourceBuffer, const IPosition &where, const IPosition &stride)
The FITSImage is not writable, so this throws an exception.
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.
Define the shape and tile shape.
virtual ~FITSImage()
Destructor does nothing.
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.
Miscellaneous information related to an image.