#488 closed defect (fixed)
Prototype code for focal plane stuff
| Reported by: | Paul Price | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | camera | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | gusciora@… |
Description
I will attach prototype code. It does not all meet the requirements in the
document (I made some changes based on my experience), but it comes close, and I
hope it is useful.
Attachments (4)
Change History (24)
by , 21 years ago
| Attachment: | fpa.tar.gz added |
|---|
comment:1 by , 21 years ago
| Component: | Phase2 → FocalPlane |
|---|
comment:2 by , 21 years ago
| Owner: | changed from to |
|---|
comment:4 by , 21 years ago
| Owner: | changed from to |
|---|
comment:5 by , 21 years ago
I'm in the process of updating this code to conform to the SDRS. Please let me
know if you will be working on it actively.
comment:6 by , 21 years ago
| Owner: | changed from to |
|---|
We are planning on folding this code in this week. Let me know when the
updates are finished so that I can proceed. Thanks.
comment:7 by , 21 years ago
| attachments.isobsolete: | 0 → 1 |
|---|
comment:8 by , 21 years ago
| Owner: | changed from to |
|---|
comment:9 by , 21 years ago
Note that the pmFPAConstruct in attachment 65 uses an old method for determining
the source of the BIASSEC and TRIMSEC (a "CELL.BIASSEC.SOURCE" keyword is in the
SDRS, but not implemented here yet) which needs to be updated.
comment:10 by , 21 years ago
pmConfigRead calls psLogSetDestination with a value of 0, which turns off
logging, instead of directing it to stdout, as intended. See bug 508.
comment:11 by , 21 years ago
Found a bug in pmFPAConstruct: each cell needs its own copy of the cell metadata
("concepts"), otherwise it can't add its own name.
Solution is to change getCellData:
Read data for a particular cell from the camera configuration
static psMetadata *getCellData(const psMetadata *camera, The camera configuration
const char *cellName The name of the cell
)
{
bool status = true; Result of MD lookup
psMetadata *cells = psMetadataLookupMD(&status, camera, "CELLS"); The CELLS
if (! status) {
psError(PS_ERR_IO, false, "Unable to determine CELLS of camera.\n");
return NULL;
}
psMetadata *cellData = psMetadataLookupMD(&status, cells, cellName); The
data for the particular cell
if (! status) {
psError(PS_ERR_IO, false, "Unable to find specs for cell %s: ignored\n", cellName);
}
Need to create a new instance, so that each cell can work with its own
psMetadata *copy = psMetadataAlloc();
psMetadataIterator *iter = psMetadataIteratorAlloc(cellData, PS_LIST_HEAD,
NULL); Iterator
psMetadataItem *item = NULL; Item from iteration
while (item = psMetadataGetAndIncrement(iter)) {
if (item->type == PS_META_MULTI item->type == PS_META_META) { psLogMsg(func, PS_LOG_WARN, "PS_META_MULTI and PS_META_META are not
supported in a cell "
"definition --- %s ignored.\n", item->name);
continue;
}
if (! psMetadataAdd(copy, PS_LIST_TAIL, item->name, item->type, item->comment,
item->data.V)) {
psAbort(func, "Should never reach here!\n");
}
}
psFree(iter);
return copy;
}
Then, to remove memory leaks, there should be a psFree(cellData) after every
psCellAlloc.
comment:12 by , 21 years ago
| attachments.isobsolete: | 0 → 1 |
|---|
comment:13 by , 21 years ago
| Cc: | added |
|---|
comment:14 by , 21 years ago
Oh, I also updated pmFPAConstruct to implement the CELL.BIASSEC.SOURCE stuff.
Also added prototypes for the concept lookups.
comment:15 by , 21 years ago
Reworked this to do the concept stuff at ingest, as is in the latest version of
the SDRS.
comment:16 by , 21 years ago
| attachments.isobsolete: | 0 → 1 |
|---|
comment:17 by , 21 years ago
Sorry, I'm playing with the definitions again (pmReadout and the p_pmHDU).
comment:18 by , 21 years ago
| Owner: | changed from to |
|---|
comment:19 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
It's not quite fixed (this was prototype code, not a bug). The code should be
in the current CVS tree.
comment:20 by , 21 years ago
The code has evolved some since the last installment recorded here. Yesterday
(14 Dec 2005) I branched psModule (pap_branch_051214). I will plug in my
current code and tidy up.

fpa.tar.gz