Changeset 8786 for trunk/psLib/src/types
- Timestamp:
- Sep 9, 2006, 10:53:07 PM (20 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
-
psMetadata.c (modified) (28 diffs)
-
psMetadata.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psMetadata.c
r8694 r8786 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.13 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 8-30 00:54:51$14 * @version $Revision: 1.132 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-09-10 08:53:07 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 532 532 // the incoming entry is PS_DATA_METADATA_MULTI 533 533 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 534 541 // force the hash entry to be PS_DATA_METADATA_MULTI 535 542 existingEntry = makeMetaMulti(mdTable,key,existingEntry); … … 559 566 // add to the hash's list of duplicate entries 560 567 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); 562 571 return false; 563 572 } … … 569 578 570 579 // 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); 575 588 576 589 // Generate warning that item has been replaced … … 583 596 } 584 597 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.")); 586 600 return false; 587 601 } … … 590 604 591 605 // 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); 597 615 // Create a multi, if required 598 616 if (flags & PS_META_DUPLICATE_OK) { … … 602 620 603 621 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); 605 624 return false; 606 625 } … … 1403 1422 psPolynomial2D *psPolynomial2DfromMD (psMetadata *folder) 1404 1423 { 1405 1424 PS_ASSERT_PTR_NON_NULL(folder, NULL); 1406 1425 bool status; 1407 1426 char keyword[80]; … … 1410 1429 // XXX add status failures tests 1411 1430 int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X"); 1431 if (!status) 1432 return NULL; 1412 1433 int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y"); 1434 if (!status) 1435 return NULL; 1413 1436 1414 1437 psPolynomial2D *poly = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, nXorder, nYorder); … … 1418 1441 sprintf (keyword, "VAL_X%02d_Y%02d", nx, ny); 1419 1442 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 } 1423 1453 sprintf (keyword, "ERR_X%02d_Y%02d", nx, ny); 1424 1454 poly->coeffErr[nx][ny] = psMetadataLookupF64 (&status, folder, keyword); … … 1434 1464 ...) 1435 1465 { 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; 1436 1474 1437 1475 int Nbyte; … … 1444 1482 va_end (argp); 1445 1483 1446 if ( !Nbyte)1484 if (Nbyte <= 0) 1447 1485 return false; 1448 1486 … … 1459 1497 psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Y", PS_DATA_S32, "number of y orders", poly->nY); 1460 1498 1499 char namespace[80]; 1500 char namespace_err[80]; 1461 1501 // place polynomial entries on folder 1462 1502 for (int nx = 0; nx < poly->nX + 1; nx++) { 1463 1503 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 } 1470 1512 } 1471 1513 } … … 1478 1520 psPolynomial3D *psPolynomial3DfromMD (psMetadata *folder) 1479 1521 { 1522 PS_ASSERT_PTR_NON_NULL(folder, NULL); 1480 1523 1481 1524 bool status; … … 1485 1528 // XXX add status failures tests 1486 1529 int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X"); 1530 if (!status) 1531 return NULL; 1487 1532 int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y"); 1533 if (!status) 1534 return NULL; 1488 1535 int nZorder = psMetadataLookupS32 (&status, folder, "NORDER_Z"); 1536 if (!status) 1537 return NULL; 1489 1538 1490 1539 psPolynomial3D *poly = psPolynomial3DAlloc (PS_POLYNOMIAL_ORD, nXorder, nYorder, nZorder); … … 1495 1544 sprintf (keyword, "VAL_X%02d_Y%02d_Z%02d", nx, ny, nz); 1496 1545 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 } 1500 1556 sprintf (keyword, "ERR_X%02d_Y%02d_Z%02d", nx, ny, nz); 1501 1557 poly->coeffErr[nx][ny][nz] = psMetadataLookupF64 (&status, folder, keyword); … … 1506 1562 } 1507 1563 1508 bool psPolynomial3DtoMD (psMetadata *md, psPolynomial3D *poly, char *format, ...) 1509 { 1564 bool 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; 1510 1577 1511 1578 int Nbyte; … … 1518 1585 va_end (argp); 1519 1586 1520 if ( !Nbyte)1587 if (Nbyte <= 0) 1521 1588 return false; 1522 1589 … … 1528 1595 1529 1596 psMetadata *folder = psMetadataAlloc (); 1530 psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 3D polynomial", folder);1531 psFree (root);1532 1597 1533 1598 // specify the polynomial orders … … 1536 1601 psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Z", PS_DATA_S32, "number of z orders", poly->nZ); 1537 1602 1603 char namespace[80]; 1604 char namespace_err[80]; 1538 1605 // place polynomial entries on folder 1539 1606 for (int nx = 0; nx < poly->nX + 1; nx++) { 1540 1607 for (int ny = 0; ny < poly->nY + 1; ny++) { 1541 1608 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); 1549 1626 return true; 1550 1627 } … … 1553 1630 psPolynomial4D *psPolynomial4DfromMD (psMetadata *folder) 1554 1631 { 1632 PS_ASSERT_PTR_NON_NULL(folder, NULL); 1555 1633 1556 1634 bool status; … … 1560 1638 // XXX add status failures tests 1561 1639 int nXorder = psMetadataLookupS32 (&status, folder, "NORDER_X"); 1640 if (!status) 1641 return NULL; 1562 1642 int nYorder = psMetadataLookupS32 (&status, folder, "NORDER_Y"); 1643 if (!status) 1644 return NULL; 1563 1645 int nZorder = psMetadataLookupS32 (&status, folder, "NORDER_Z"); 1646 if (!status) 1647 return NULL; 1564 1648 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); 1567 1654 1568 1655 for (int nx = 0; nx < poly->nX + 1; nx++) { … … 1572 1659 sprintf (keyword, "VAL_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt); 1573 1660 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 } 1576 1671 1577 1672 sprintf (keyword, "ERR_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt); … … 1584 1679 } 1585 1680 1586 bool psPolynomial4DtoMD (psMetadata *md, psPolynomial4D *poly, char *format, ...) 1587 { 1681 bool 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 1588 1696 1589 1697 int Nbyte; … … 1596 1704 va_end (argp); 1597 1705 1598 if ( !Nbyte)1706 if (Nbyte <= 0) 1599 1707 return false; 1600 1708 … … 1606 1714 1607 1715 psMetadata *folder = psMetadataAlloc (); 1608 psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 4D polynomial", folder);1609 psFree (root);1610 1716 1611 1717 // specify the polynomial orders … … 1613 1719 psMetadataAdd (folder, PS_LIST_TAIL, "NORDER_Y", PS_DATA_S32, "number of y orders", poly->nY); 1614 1720 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]; 1617 1725 // place polynomial entries on folder 1618 1726 for (int nx = 0; nx < poly->nX + 1; nx++) { … … 1620 1728 for (int nz = 0; nz < poly->nZ + 1; nz++) { 1621 1729 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 } 1626 1740 } 1627 1741 } 1628 1742 } 1629 1743 } 1744 psMetadataAdd (md, PS_LIST_TAIL, root, PS_DATA_METADATA, "folder for 4D polynomial", folder); 1745 psFree(root); 1746 psFree(folder); 1630 1747 return true; 1631 1748 } -
trunk/psLib/src/types/psMetadata.h
r8625 r8786 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.8 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 8-26 03:15:15$13 * @version $Revision: 1.85 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-09-10 08:53:07 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1066 1066 bool psMetadataPrint( 1067 1067 FILE *fd, ///< File Descriptor or NULL 1068 const psMetadata *md, ///< Metadata collection to print.1068 const psMetadata *md, ///< Metadata collection to print. 1069 1069 int level ///< the level of metadata items. 1070 1070 ); 1071 1071 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 */ 1082 psPolynomial2D *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 */ 1098 bool 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 */ 1116 psPolynomial3D *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 */ 1132 bool 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 */ 1150 psPolynomial4D *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 */ 1166 bool 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 ); 1081 1172 1082 1173
Note:
See TracChangeset
for help on using the changeset viewer.
