29 #ifndef FITS_FITSFIELDCOPIER_H
30 #define FITS_FITSFIELDCOPIER_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++) {
FitsField< fitsType > * fits_p
ScalarFITSFieldCopier(RORecordFieldPtr< recordType > *recptr, FitsField< fitsType > *fitsptr)
~VariableArrayFITSFieldCopier()
unsigned int nelements() const
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
StringFITSFieldCopier & operator=(const StringFITSFieldCopier &other)
StringFITSFieldCopier(RORecordFieldPtr< String > *rptr, FitsField< char > *fptr)
RORecordFieldPtr< Array< recordType > > * rec_p
FitsField< fitsType > * fits_p
FitsField< char > * fits_p
RORecordFieldPtr< recordType > * rec_p
VariableArrayFITSFieldCopier & operator=(const VariableArrayFITSFieldCopier< recordType, fitsType > &other)
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
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.
ScalarFITSFieldCopier & operator=(const ScalarFITSFieldCopier< recordType, fitsType > &other)
FitsField< fitsType > * fits_p
bool Bool
Define the standard types used by Casacore.
virtual void copyToFITS()
Copy the current contents of the input RORecordFieldPtr to the output FitsField.
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)
ArrayFITSFieldCopier(RORecordFieldPtr< Array< recordType > > *recptr, FitsField< fitsType > *fitsptr)
A FITSFieldCopier for copying Array RecordFields to FitsFields.
virtual void copyToFITS()=0
the things which does the work - to be implemented in each derived class
RORecordFieldPtr< Array< recordType > > * rec_p
A FITSFieldCopier for copying scalar non-string RecordFields to FitsFields.
String: the storage and methods of handling collections of characters.
static Bool toTDIM(String &tdim, const IPosition &shape)
Convert an IPosition to a String appropriate for use as the value of a TDIMnnn keyword.
A FITSFieldCopier for copying String RecordFields to FitsFields.
virtual ~FITSFieldCopier()
destructor
ArrayFITSFieldCopier & operator=(const ArrayFITSFieldCopier< recordType, fitsType > &other)
RORecordFieldPtr< String > * rec_p
Virtual base class for copying RORecordFields to FitsFields.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.