IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8786 for trunk/psLib/src/types


Ignore:
Timestamp:
Sep 9, 2006, 10:53:07 PM (20 years ago)
Author:
drobbin
Message:

ted several files. Added error handling and removed unreachable spots from psMetadata.c. Added doxygen for psPolynomial(to/from)MD functions in psMetadata.h. Updated makefiles to restore certain functionality lost recently, (ie, ability to 'make tests' in types/ folder). Updated tests and source in tap_psMetadata_creating- namely psMetadataIteratorAlloc and psMetadataAddItem. Finished testing in tap_psMetadata_polynomials. psMetadata.c now reads 100% coverage (lines executed) by tap tests!

Location:
trunk/psLib/src/types
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r8694 r8786  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.131 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-30 00:54:51 $
     14 *  @version $Revision: 1.132 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-09-10 08:53:07 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    532532        // the incoming entry is PS_DATA_METADATA_MULTI
    533533
     534        //Shouldn't have a second reference to the same MULTI in a single Metadata!
     535        if (item == existingEntry) {
     536            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     537                    "Cannot have 2 references to the same MULTI in a single Metadata!");
     538            return false;
     539        }
     540
    534541        // force the hash entry to be PS_DATA_METADATA_MULTI
    535542        existingEntry = makeMetaMulti(mdTable,key,existingEntry);
     
    559566            // add to the hash's list of duplicate entries
    560567            if (! psListAdd(existingEntry->data.list, PS_LIST_TAIL, (psPtr)item) ) {
    561                 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to metadata collection list."),key);
     568                psError(PS_ERR_UNKNOWN, false,
     569                        _("Failed to add metadata item, %s, to metadata collection list."),
     570                        key);
    562571                return false;
    563572            }
     
    569578
    570579            // treat as if new (added to list below)
    571             if(!psHashAdd(mdTable, key, (psPtr)item)) {
    572                 psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to items table."),key);
    573                 return false;
    574             }
     580            /*  The following is unneeded.  HashAdd can't return false with non-null inputs.
     581                        if(!psHashAdd(mdTable, key, (psPtr)item)) {
     582                            psError(PS_ERR_UNKNOWN,false,
     583                                _("Failed to add metadata item, %s, to items table."),key);
     584                            return false;
     585                        }
     586            */
     587            psHashAdd(mdTable, key, (psPtr)item);
    575588
    576589            // Generate warning that item has been replaced
     
    583596            }
    584597            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    585                     _("Duplicate metadata item name is not allowed.  Use a psMetadataFlags option to allow such action."));
     598                    _("Duplicate metadata item name is not allowed.  "
     599                      "Use a psMetadataFlags option to allow such action."));
    586600            return false;
    587601        }
     
    590604
    591605        // Node doesn't exist - Add new metadata item to metadata collection's hash
    592         if(!psHashAdd(mdTable, key, (psPtr)item)) {
    593             psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to items table."),key);
    594             return false;
    595         }
    596 
     606        /*  The following is unneeded.  HashAdd can't return false with non-null inputs.
     607         
     608                if(!psHashAdd(mdTable, key, (psPtr)item)) {
     609                    psError(PS_ERR_UNKNOWN,false,
     610                            _("Failed to add metadata item, %s, to items table."),key);
     611                    return false;
     612                }
     613        */
     614        psHashAdd(mdTable, key, (psPtr)item);
    597615        // Create a multi, if required
    598616        if (flags & PS_META_DUPLICATE_OK) {
     
    602620
    603621    if(!psListAdd(mdList, location, (psPtr)item)) {
    604         psError(PS_ERR_UNKNOWN,false,_("Failed to add metadata item, %s, to metadata collection list."),key);
     622        psError(PS_ERR_UNKNOWN, false,
     623                _("Failed to add metadata item, %s, to metadata collection list."), key);
    605624        return false;
    606625    }
     
    14031422psPolynomial2D *psPolynomial2DfromMD (psMetadata *folder)
    14041423{
    1405 
     1424    PS_ASSERT_PTR_NON_NULL(folder, NULL);
    14061425    bool status;
    14071426    char keyword[80];
     
    14101429    // XXX add status failures tests
    14111430    int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X");
     1431    if (!status)
     1432        return NULL;
    14121433    int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y");
     1434    if (!status)
     1435        return NULL;
    14131436
    14141437    psPolynomial2D *poly = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, nXorder, nYorder);
     
    14181441            sprintf (keyword, "VAL_X%02d_Y%02d", nx, ny);
    14191442            poly->coeff[nx][ny] = psMetadataLookupF64 (&status, folder, keyword);
    1420             if (!status)
    1421                 poly->mask[nx][ny] = 1;
    1422 
     1443            if (!status) {
     1444                //XXX: Setting the mask of a corrupted polynomial doesn't make sense.
     1445                //The polynomial is garbage if ANY coeff-element is lost!!!
     1446                //                    poly->mask[nx][ny] = 1;
     1447                psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1448                        "psPolynomial2D in metadata has lost a coefficient somewhere!"
     1449                        " >>position= [x,y] = %02d, %02d", nx, ny);
     1450                psFree(poly);
     1451                return NULL;
     1452            }
    14231453            sprintf (keyword, "ERR_X%02d_Y%02d", nx, ny);
    14241454            poly->coeffErr[nx][ny] = psMetadataLookupF64 (&status, folder, keyword);
     
    14341464                         ...)
    14351465{
     1466    PS_ASSERT_PTR_NON_NULL(md, false);
     1467    PS_ASSERT_PTR_NON_NULL(poly, false);
     1468    //XXX:  Current implementation only supports ordinary polynomials.
     1469    if (poly->type != PS_POLYNOMIAL_ORD)
     1470        return false;
     1471    //Make sure polynomial isn't 0, completely empty
     1472    if (poly->nX == 0 && poly->nY == 0 && poly->coeff[0][0] == 0)
     1473        return false;
    14361474
    14371475    int Nbyte;
     
    14441482    va_end (argp);
    14451483
    1446     if (!Nbyte)
     1484    if (Nbyte <= 0)
    14471485        return false;
    14481486
     
    14591497    psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Y", PS_DATA_S32, "number of y orders", poly->nY);
    14601498
     1499    char namespace[80];
     1500    char namespace_err[80];
    14611501    // place polynomial entries on folder
    14621502    for (int nx = 0; nx < poly->nX + 1; nx++) {
    14631503        for (int ny = 0; ny < poly->nY + 1; ny++) {
    1464             if (poly->mask[nx][ny])
    1465                 continue;
    1466             psMetadataAdd (folder, PS_LIST_TAIL, "VAL_X%02d_Y%02d", PS_DATA_F64,
    1467                            "polynomial coefficient", poly->coeff[nx][ny], nx, ny);
    1468             psMetadataAdd (folder, PS_LIST_TAIL, "ERR_X%02d_Y%02d", PS_DATA_F64,
    1469                            "polynomial coefficient error", poly->coeffErr[nx][ny], nx, ny);
     1504            if (poly->mask[nx][ny] == 0) {
     1505                sprintf(namespace, "VAL_X%02d_Y%02d", nx, ny);
     1506                sprintf(namespace_err, "ERR_X%02d_Y%02d", nx, ny);
     1507                psMetadataAdd (folder, PS_LIST_TAIL, namespace, PS_DATA_F64,
     1508                               "polynomial coefficient", poly->coeff[nx][ny]);
     1509                psMetadataAdd (folder, PS_LIST_TAIL, namespace_err, PS_DATA_F64,
     1510                               "polynomial coefficient error", poly->coeffErr[nx][ny]);
     1511            }
    14701512        }
    14711513    }
     
    14781520psPolynomial3D *psPolynomial3DfromMD (psMetadata *folder)
    14791521{
     1522    PS_ASSERT_PTR_NON_NULL(folder, NULL);
    14801523
    14811524    bool status;
     
    14851528    // XXX add status failures tests
    14861529    int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X");
     1530    if (!status)
     1531        return NULL;
    14871532    int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y");
     1533    if (!status)
     1534        return NULL;
    14881535    int nZorder = psMetadataLookupS32 (&status, folder, "NORDER_Z");
     1536    if (!status)
     1537        return NULL;
    14891538
    14901539    psPolynomial3D *poly = psPolynomial3DAlloc (PS_POLYNOMIAL_ORD, nXorder, nYorder, nZorder);
     
    14951544                sprintf (keyword, "VAL_X%02d_Y%02d_Z%02d", nx, ny, nz);
    14961545                poly->coeff[nx][ny][nz] = psMetadataLookupF64 (&status, folder, keyword);
    1497                 if (!status)
    1498                     poly->mask[nx][ny][nz] = 1;
    1499 
     1546                if (!status) {
     1547                    //XXX: Setting the mask of a corrupted polynomial doesn't make sense.
     1548                    //The polynomial is garbage if ANY coeff-element is lost!!!
     1549                    //                    poly->mask[nx][ny][nz] = 1;
     1550                    psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1551                            "psPolynomial3D in metadata has lost a coefficient somewhere!"
     1552                            " >>position= [x,y,z] = %02d, %02d, %02d", nx, ny, nz);
     1553                    psFree(poly);
     1554                    return NULL;
     1555                }
    15001556                sprintf (keyword, "ERR_X%02d_Y%02d_Z%02d", nx, ny, nz);
    15011557                poly->coeffErr[nx][ny][nz] = psMetadataLookupF64 (&status, folder, keyword);
     
    15061562}
    15071563
    1508 bool psPolynomial3DtoMD (psMetadata *md, psPolynomial3D *poly, char *format, ...)
    1509 {
     1564bool psPolynomial3DtoMD (psMetadata *md,
     1565                         psPolynomial3D *poly,
     1566                         char *format,
     1567                         ...)
     1568{
     1569    PS_ASSERT_PTR_NON_NULL(md, false);
     1570    PS_ASSERT_PTR_NON_NULL(poly, false);
     1571    //XXX:  Current implementation only supports ordinary polynomials.
     1572    if (poly->type != PS_POLYNOMIAL_ORD)
     1573        return false;
     1574    //Make sure polynomial isn't 0, completely empty
     1575    if (poly->nX == 0 && poly->nY == 0 && poly->nZ == 0 && poly->coeff[0][0][0] == 0)
     1576        return false;
    15101577
    15111578    int Nbyte;
     
    15181585    va_end (argp);
    15191586
    1520     if (!Nbyte)
     1587    if (Nbyte <= 0)
    15211588        return false;
    15221589
     
    15281595
    15291596    psMetadata *folder = psMetadataAlloc ();
    1530     psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 3D polynomial", folder);
    1531     psFree (root);
    15321597
    15331598    // specify the polynomial orders
     
    15361601    psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Z", PS_DATA_S32, "number of z orders", poly->nZ);
    15371602
     1603    char namespace[80];
     1604    char namespace_err[80];
    15381605    // place polynomial entries on folder
    15391606    for (int nx = 0; nx < poly->nX + 1; nx++) {
    15401607        for (int ny = 0; ny < poly->nY + 1; ny++) {
    15411608            for (int nz = 0; nz < poly->nZ + 1; nz++) {
    1542                 if (poly->mask[nx][ny][nz])
    1543                     continue;
    1544                 psMetadataAdd (folder, PS_LIST_TAIL, "VAL_X%02d_Y%02d_Z%02d", PS_DATA_F64, "polynomial coefficient", poly->coeff[nx][ny][nz], nx, ny, nz);
    1545                 psMetadataAdd (folder, PS_LIST_TAIL, "ERR_X%02d_Y%02d_Z%02d", PS_DATA_F64, "polynomial coeffficient error", poly->coeffErr[nx][ny][nz], nx, ny, nz);
    1546             }
    1547         }
    1548     }
     1609                if (poly->mask[nx][ny][nz] == 0) {
     1610                    sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d", nx, ny, nz);
     1611                    sprintf(namespace_err, "ERR_X%02d_Y%02d_Z%02d", nx, ny, nz);
     1612                    psMetadataAdd (folder, PS_LIST_TAIL, namespace,
     1613                                   PS_DATA_F64, "polynomial coefficient",
     1614                                   poly->coeff[nx][ny][nz], nx, ny, nz);
     1615                    psMetadataAdd (folder, PS_LIST_TAIL, namespace_err,
     1616                                   PS_DATA_F64, "polynomial coeffficient error",
     1617                                   poly->coeffErr[nx][ny][nz], nx, ny, nz);
     1618                }
     1619            }
     1620        }
     1621    }
     1622
     1623    psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 3D polynomial", folder);
     1624    psFree(root);
     1625    psFree(folder);
    15491626    return true;
    15501627}
     
    15531630psPolynomial4D *psPolynomial4DfromMD (psMetadata *folder)
    15541631{
     1632    PS_ASSERT_PTR_NON_NULL(folder, NULL);
    15551633
    15561634    bool status;
     
    15601638    // XXX add status failures tests
    15611639    int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X");
     1640    if (!status)
     1641        return NULL;
    15621642    int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y");
     1643    if (!status)
     1644        return NULL;
    15631645    int nZorder = psMetadataLookupS32 (&status, folder, "NORDER_Z");
     1646    if (!status)
     1647        return NULL;
    15641648    int nTorder = psMetadataLookupS32 (&status, folder, "NORDER_T");
    1565 
    1566     psPolynomial4D *poly = psPolynomial4DAlloc (PS_POLYNOMIAL_ORD, nXorder, nYorder, nZorder, nTorder);
     1649    if (!status)
     1650        return NULL;
     1651
     1652    psPolynomial4D *poly = psPolynomial4DAlloc(PS_POLYNOMIAL_ORD,
     1653                           nXorder, nYorder, nZorder, nTorder);
    15671654
    15681655    for (int nx = 0; nx < poly->nX + 1; nx++) {
     
    15721659                    sprintf (keyword, "VAL_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
    15731660                    poly->coeff[nx][ny][nz][nt] = psMetadataLookupF64 (&status, folder, keyword);
    1574                     if (!status)
    1575                         poly->mask[nx][ny][nz][nt] = 1;
     1661                    if (!status) {
     1662                        //XXX: Setting the mask of a corrupted polynomial doesn't make sense.
     1663                        //The polynomial is garbage if ANY coeff-element is lost!!!
     1664                        //                    poly->mask[nx][ny][nz][nt] = 1;
     1665                        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1666                                "psPolynomial4D in metadata has lost a coefficient somewhere!"
     1667                                " >>position= [x,y,z,t] = %02d, %02d, %02d, %02d", nx,ny,nz,nt);
     1668                        psFree(poly);
     1669                        return NULL;
     1670                    }
    15761671
    15771672                    sprintf (keyword, "ERR_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
     
    15841679}
    15851680
    1586 bool psPolynomial4DtoMD (psMetadata *md, psPolynomial4D *poly, char *format, ...)
    1587 {
     1681bool psPolynomial4DtoMD (psMetadata *md,
     1682                         psPolynomial4D *poly,
     1683                         char *format,
     1684                         ...)
     1685{
     1686    PS_ASSERT_PTR_NON_NULL(md, false);
     1687    PS_ASSERT_PTR_NON_NULL(poly, false);
     1688    //XXX:  Current implementation only supports ordinary polynomials.
     1689    if (poly->type != PS_POLYNOMIAL_ORD)
     1690        return false;
     1691    //Make sure polynomial isn't 0, completely empty
     1692    if (poly->nX == 0 && poly->nY == 0 && poly->nZ == 0 && poly->nT == 0
     1693            && poly->coeff[0][0][0][0] == 0)
     1694        return false;
     1695
    15881696
    15891697    int Nbyte;
     
    15961704    va_end (argp);
    15971705
    1598     if (!Nbyte)
     1706    if (Nbyte <= 0)
    15991707        return false;
    16001708
     
    16061714
    16071715    psMetadata *folder = psMetadataAlloc ();
    1608     psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 4D polynomial", folder);
    1609     psFree (root);
    16101716
    16111717    // specify the polynomial orders
     
    16131719    psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Y", PS_DATA_S32, "number of y orders", poly->nY);
    16141720    psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Z", PS_DATA_S32, "number of z orders", poly->nZ);
    1615     psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_T", PS_DATA_S32, "number of z orders", poly->nT);
    1616 
     1721    psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_T", PS_DATA_S32, "number of t orders", poly->nT);
     1722
     1723    char namespace[80];
     1724    char namespace_err[80];
    16171725    // place polynomial entries on folder
    16181726    for (int nx = 0; nx < poly->nX + 1; nx++) {
     
    16201728            for (int nz = 0; nz < poly->nZ + 1; nz++) {
    16211729                for (int nt = 0; nt < poly->nT + 1; nt++) {
    1622                     if (poly->mask[nx][ny][nz][nt])
    1623                         continue;
    1624                     psMetadataAdd (folder, PS_LIST_TAIL, "VAL_X%02d_Y%02d_Z%02d_T%02d", PS_DATA_F64, "polynomial coefficient", poly->coeff[nx][ny][nz][nt], nx, ny, nz, nt);
    1625                     psMetadataAdd (folder, PS_LIST_TAIL, "ERR_X%02d_Y%02d_Z%02d_T%02d", PS_DATA_F64, "polynomial coeffficient error", poly->coeffErr[nx][ny][nz][nt], nx, ny, nz, nt);
     1730                    if (poly->mask[nx][ny][nz][nt] == 0) {
     1731                        sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
     1732                        sprintf(namespace_err, "ERR_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
     1733                        psMetadataAdd (folder, PS_LIST_TAIL, namespace,
     1734                                       PS_DATA_F64, "polynomial coefficient",
     1735                                       poly->coeff[nx][ny][nz][nt], nx, ny, nz, nt);
     1736                        psMetadataAdd (folder, PS_LIST_TAIL, namespace_err,
     1737                                       PS_DATA_F64, "polynomial coeffficient error",
     1738                                       poly->coeffErr[nx][ny][nz][nt], nx, ny, nz, nt);
     1739                    }
    16261740                }
    16271741            }
    16281742        }
    16291743    }
     1744    psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 4D polynomial", folder);
     1745    psFree(root);
     1746    psFree(folder);
    16301747    return true;
    16311748}
  • trunk/psLib/src/types/psMetadata.h

    r8625 r8786  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2006-08-26 03:15:15 $
     13*  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2006-09-10 08:53:07 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    10661066bool psMetadataPrint(
    10671067    FILE *fd,                          ///< File Descriptor or NULL
    1068     const psMetadata *md,               ///< Metadata collection to print.
     1068    const psMetadata *md,              ///< Metadata collection to print.
    10691069    int level                          ///< the level of metadata items.
    10701070);
    10711071
    1072 
    1073 psPolynomial2D *psPolynomial2DfromMD (psMetadata *folder);
    1074 bool psPolynomial2DtoMD (psMetadata *md, psPolynomial2D *poly, char *format, ...);
    1075 
    1076 psPolynomial3D *psPolynomial3DfromMD (psMetadata *folder);
    1077 bool psPolynomial3DtoMD (psMetadata *md, psPolynomial3D *poly, char *format, ...);
    1078 
    1079 psPolynomial4D *psPolynomial4DfromMD (psMetadata *folder);
    1080 bool psPolynomial4DtoMD (psMetadata *md, psPolynomial4D *poly, char *format, ...);
     1072/** Allocates a new psPolynomial2D structure with information from a psMetadata.
     1073 *
     1074 *  Parses a psMetadata container with psPolynomial2D information.  The first two
     1075 *  elements of the metadata folder specify the order of the x & y variables.  (ie,
     1076 *  NORDER_X, NORDER_Y).  The following elements are the values of the coefficients
     1077 *  and the coefficient errors.  (ie, VAL_X00_Y00, ERR_X00_Y00, etc.).  If the orders
     1078 *  or any coefficients are missing or have incorrect syntax, NULL is returned.
     1079 *
     1080 *  @return psPolynomial2D*:        Newly allocated psPolynomial2D from metadata.
     1081 */
     1082psPolynomial2D *psPolynomial2DfromMD(
     1083    psMetadata *folder                 ///< folder containing the polynomial info.
     1084);
     1085
     1086/** Stores the information from a psPolynomial2D structure in a psMetadata container.
     1087 *
     1088 *  Creates a psMetadata folder with psPolynomial2D information.  The first two
     1089 *  elements of the metadata folder specify the order of the x & y variables.  (ie,
     1090 *  NORDER_X, NORDER_Y).  The following elements are the values of the coefficients
     1091 *  and the coefficient errors.  (ie, VAL_X00_Y00, ERR_X00_Y00, etc.).  The input
     1092 *  polynomial must be of ordinary type and have a valid name format.  False is also
     1093 *  returned if any inputs are NULL.  *If a particular mask element is non-zero, that
     1094 *  polynomial coefficient (and error) are skipped.
     1095 *
     1096 *  @return bool:       True if successful, otherwise false.
     1097 */
     1098bool psPolynomial2DtoMD(
     1099    psMetadata *md,                    ///< Metadata container for polynomial storage.
     1100    psPolynomial2D *poly,              ///< Polynomial information to be stored.
     1101    char *format,                      ///< Name of polynomial folder.
     1102    ...                                ///< Arguments for name formatting.
     1103);
     1104
     1105/** Allocates a new psPolynomial3D structure with information from a psMetadata.
     1106 *
     1107 *  Parses a psMetadata container with psPolynomial3D information.  The first three
     1108 *  elements of the metadata folder specify the order of the x, y, & z variables.  (ie,
     1109 *  NORDER_X, NORDER_Y, NORDER_Z).  The following elements are the values of the
     1110 *  coefficients and the coefficient errors.  (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00,
     1111 *  etc.).  If the orders or any coefficients are missing or have incorrect syntax,
     1112 *  NULL is returned.
     1113 *
     1114 *  @return psPolynomial3D*:        Newly allocated psPolynomial3D from metadata.
     1115 */
     1116psPolynomial3D *psPolynomial3DfromMD(
     1117    psMetadata *folder                 ///< folder containing the polynomial info.
     1118);
     1119
     1120/** Stores the information from a psPolynomial3D structure in a psMetadata container.
     1121 *
     1122 *  Creates a psMetadata folder with psPolynomial3D information.  The first three
     1123 *  elements of the metadata folder specify the order of the x, y, & z variables.  (ie,
     1124 *  NORDER_X, NORDER_Y, NORDER_Z).  The following elements are the values of the
     1125 *  coefficients and the coefficient errors.  (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00,
     1126 *  etc.).  The input polynomial must be of ordinary type and have a valid name format.
     1127 *  False is also returned if any inputs are NULL.  *If a particular mask element is
     1128 *  non-zero, that polynomial coefficient (and error) are skipped.
     1129 *
     1130 *  @return bool:       True if successful, otherwise false.
     1131 */
     1132bool psPolynomial3DtoMD(
     1133    psMetadata *md,                    ///< Metadata container for polynomial storage.
     1134    psPolynomial3D *poly,              ///< Polynomial information to be stored.
     1135    char *format,                      ///< Name of polynomial folder.
     1136    ...                                ///< Arguments for name formatting.
     1137);
     1138
     1139/** Allocates a new psPolynomial4D structure with information from a psMetadata.
     1140 *
     1141 *  Parses a psMetadata container with psPolynomial4D information.  The first four
     1142 *  elements of the metadata folder specify the order of the x, y, z, & t variables.
     1143 *  (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T).  The following elements are the
     1144 *  values of the coefficients and the coefficient errors.  (ie, VAL_X00_Y00_Z00_T00,
     1145 *  ERR_X00_Y00_Z00_T00, etc.).  If the orders or any coefficients are missing or
     1146 *  have incorrect syntax, NULL is returned.
     1147 *
     1148 *  @return psPolynomial4D*:        Newly allocated psPolynomial4D from metadata.
     1149 */
     1150psPolynomial4D *psPolynomial4DfromMD(
     1151    psMetadata *folder                 ///< folder containing the polynomial info.
     1152);
     1153
     1154/** Stores the information from a psPolynomial4D structure in a psMetadata container.
     1155 *
     1156 *  Creates a psMetadata folder with psPolynomial4D information.  The first four
     1157 *  elements of the metadata folder specify the order of the x, y, z, & t variables.
     1158 *  (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T).  The following elements are the values
     1159 *  of the coefficients and the coefficient errors.  (ie, VAL_X00_Y00_Z00_T00,
     1160 *  ERR_X00_Y00_Z00_T00, etc.).  The input polynomial must be of ordinary type and have
     1161 *  a valid name format.  False is also returned if any inputs are NULL.  *If a particular
     1162 *  mask element is non-zero, that polynomial coefficient (and error) are skipped.
     1163 *
     1164 *  @return bool:       True if successful, otherwise false.
     1165 */
     1166bool psPolynomial4DtoMD(
     1167    psMetadata *md,                    ///< Metadata container for polynomial storage.
     1168    psPolynomial4D *poly,              ///< Polynomial information to be stored.
     1169    char *format,                      ///< Name of polynomial folder.
     1170    ...                                ///< Arguments for name formatting.
     1171);
    10811172
    10821173
Note: See TracChangeset for help on using the changeset viewer.