29 #ifndef FITS_FITSFIELDCOPIER_H
30 #define FITS_FITSFIELDCOPIER_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/fits/FITS/hdu.h>
34 #include <casacore/casa/Containers/RecordField.h>
35 #include <casacore/casa/Arrays/Array.h>
36 #include <casacore/casa/BasicSL/String.h>
37 #include <casacore/fits/FITS/FITSKeywordUtil.h>
191 Int minlength = fitslength < reclength ? fitslength : reclength;
192 const char *chars = (**rec_p).chars();
194 for (i=0; i<minlength; i++) {
195 (*fits_p)(i) = chars[i];
197 if (i < fitslength) {
258 uInt narray = (**rec_p).nelements();
259 uInt nmin = narray < nfits ? narray : nfits;
261 const recordType *rptr = (**rec_p).getStorage(deleteIt);
262 for (
uInt i=0; i<nmin; i++) {
263 (*fits_p)(i) = rptr[i];
266 for (
uInt i=nmin;i<nfits;i++) {
267 (*fits_p)(i) = recordType(0);
269 (**rec_p).freeStorage(rptr, deleteIt);
294 uInt narray = (**rec_p).nelements();
295 uInt nmin = narray < nfits ? narray : nfits;
297 const recordType *rptr = (**rec_p).getStorage(deleteIt);
298 for (
uInt i=0; i<nmin; i++) {
299 (*fits_p)(i) = rptr[i];
301 for (
uInt i=nmin;i<nfits;i++) {
302 (*fits_p)(i) = recordType(0);
304 (**rec_p).freeStorage(rptr, deleteIt);
311 Int minlength = fitslength < reclength ? fitslength : reclength;
312 const char *chars = thisTDIR.
chars();
314 for (i=0; i<minlength; i++) {
315 (*tdir_p)(i) = chars[i];
317 for (
Int i=minlength; i<fitslength; i++) {
A FITSFieldCopier for copying Array RecordFields to FitsFields.
ArrayFITSFieldCopier & operator=(const ArrayFITSFieldCopier< recordType, fitsType > &other)
ArrayFITSFieldCopier(const ArrayFITSFieldCopier< recordType, fitsType > &other)
Undefined and inaccessible.
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
ArrayFITSFieldCopier(RORecordFieldPtr< Array< recordType > > *recptr, FitsField< fitsType > *fitsptr)
FitsField< fitsType > * fits_p
RORecordFieldPtr< Array< recordType > > * rec_p
virtual ~FITSFieldCopier()
destructor
virtual void copyToFITS()=0
the things which does the work - to be implemented in each derived class
static Bool toTDIM(String &tdim, const IPosition &shape)
Convert an IPosition to a String appropriate for use as the value of a TDIMnnn keyword.
unsigned int nelements() const
A FITSFieldCopier for copying scalar non-string RecordFields to FitsFields.
FitsField< fitsType > * fits_p
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
ScalarFITSFieldCopier(const ScalarFITSFieldCopier< recordType, fitsType > &other)
ScalarFITSFieldCopier & operator=(const ScalarFITSFieldCopier< recordType, fitsType > &other)
RORecordFieldPtr< recordType > * rec_p
ScalarFITSFieldCopier(RORecordFieldPtr< recordType > *recptr, FitsField< fitsType > *fitsptr)
A FITSFieldCopier for copying String RecordFields to FitsFields.
FitsField< char > * fits_p
StringFITSFieldCopier(const StringFITSFieldCopier &other)
Undefined and inaccessible.
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
StringFITSFieldCopier & operator=(const StringFITSFieldCopier &other)
RORecordFieldPtr< String > * rec_p
StringFITSFieldCopier(RORecordFieldPtr< String > *rptr, FitsField< char > *fptr)
String: the storage and methods of handling collections of characters.
const Char * chars() const
** Casacore synonym
FitsField< char > * tdir_p
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
VariableArrayFITSFieldCopier(RORecordFieldPtr< Array< recordType > > *recptr, FitsField< fitsType > *fitsptr, FitsField< char > *tdirptr)
FitsField< fitsType > * fits_p
~VariableArrayFITSFieldCopier()
VariableArrayFITSFieldCopier(const VariableArrayFITSFieldCopier< recordType, fitsType > &other)
Undefined and inaccessible.
VariableArrayFITSFieldCopier & operator=(const VariableArrayFITSFieldCopier< recordType, fitsType > &other)
RORecordFieldPtr< Array< recordType > > * rec_p
this file contains all the compiler specific defines
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
bool Bool
Define the standard types used by Casacore.