Commits

Darrell Schiebel authored and Ville Suoranta committed 9041a875388 Merge
Pull request #733: CAS-14176

Merge in CASA/casa6 from CAS-14176 to master * commit '1437e4150a1541809b15826462d9916a6a289dca': add a longer description [CAS-14176] FITS header values are limited to 68 characters [CAS-14176] ORIGIN header entry varies [CAS-14176] add function to header comment [CAS-14176] move image::fitsheader member function test from stand-alone to large test file [CAS-14176] add test for image::fitsheader member function [CAS-14176] add image tool member function to return a FITS header as a dict [CAS-14176]

casatools/src/code/stdcasa/StdCasa/variant.cc

Modified
1606 1606 else if ( shape_size() != size() ) \
1607 1607 shape_ = std::vector<ssize_t>(1,size()); \
1608 1608 }
1609 1609
1610 1610 PUSHIMPL(bool ,BOOL ,tostring , ,== true ? 1 : 0 ,== true ? 1 : 0, , , , , )
1611 1611 PUSHIMPL(std::complex<double>,COMPLEX ,tostring ,.real() == 0 && v.imag() == 0 ? false : true ,.real() , , , , , , )
1612 1612 PUSHIMPL(long ,INT ,tostring ,== 0 ? false : true , , , , , , , )
1613 1613 PUSHIMPL(unsigned long ,UINT ,tostring ,== 0 ? false : true , , , , , , , )
1614 1614 PUSHIMPL(double ,DOUBLE ,tostring ,== 0 ? false : true , , , , , , , )
1615 1615 PUSHIMPL(const std::string& ,STRING , , , , ,stringtobool ,stringtoint,stringtolong, stringtodouble ,stringtocomplex )
1616 +PUSHIMPL(const char* ,STRING , , , , ,stringtobool ,stringtoint,stringtolong, stringtodouble ,stringtocomplex )
1616 1617
1617 1618 #define PLACEIMPL(TYPEX,TYPETAG,TYPETOSTRING,NUMTWEAK,BOOLTWEAK,BOOLCPX,STRBOOL, STRINT, STRLONG ,STRDBL,STRCPX) \
1618 1619 void variant::place(TYPEX v, unsigned int index, bool conform ) { \
1619 1620 \
1620 1621 if ( conform == true ) { \
1621 1622 TYPE new_type = variant::compatible_type(TYPETAG,typev); \
1622 1623 if (new_type != typev) as(new_type); \
1623 1624 } \
1624 1625 \
1625 1626 switch (typev) { \
1696 1697 break; \
1697 1698 } \
1698 1699 }
1699 1700
1700 1701 PLACEIMPL(bool ,BOOL ,tostring , ,== true ? 1 : 0 ,== true ? 1 : 0, , , , , )
1701 1702 PLACEIMPL(std::complex<double>,COMPLEX ,tostring ,.real() == 0.0 && v.imag() == 0.0 ? false : true ,.real() , , , , , , )
1702 1703 PLACEIMPL(long ,INT ,tostring ,== 0 ? false : true , , , , , , , )
1703 1704 PLACEIMPL(unsigned long ,UINT ,tostring ,== 0 ? false : true , , , , , , , )
1704 1705 PLACEIMPL(double ,DOUBLE ,tostring ,== 0 ? false : true , , , , , , , )
1705 1706 PLACEIMPL(const std::string& ,STRING , , , , ,stringtobool ,stringtoint, stringtolong, stringtodouble ,stringtocomplex )
1706 -
1707 +PLACEIMPL(const char* ,STRING , , , , ,stringtobool ,stringtoint, stringtolong, stringtodouble ,stringtocomplex )
1707 1708
1708 1709 std::string variant::create_message( const std::string s ) const {
1709 1710 std::string type = (typev == BOOL ? "bool" :
1710 1711 typev == INT ? "int" :
1711 1712 typev == UINT ? "uint" :
1712 1713 typev == DOUBLE ? "double" :
1713 1714 typev == STRING ? "string" :
1714 1715 typev == BOOLVEC ? "boolvec" :
1715 1716 typev == INTVEC ? "intvec" :
1716 1717 typev == UINTVEC ? "uintvec" :

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut