LSST Applications g0603fd7c41+022847dfd1,g0aad566f14+f45185db35,g180d380827+40e913b07a,g2079a07aa2+86d27d4dc4,g2305ad1205+696e5f3872,g2bbee38e9b+047b288a59,g337abbeb29+047b288a59,g33d1c0ed96+047b288a59,g3a166c0a6a+047b288a59,g3d1719c13e+f45185db35,g3de15ee5c7+5201731f0d,g487adcacf7+19f9b77d7d,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+248b16177b,g63cd9335cc+585e252eca,g858d7b2824+f45185db35,g88963caddf+0cb8e002cc,g991b906543+f45185db35,g99cad8db69+1747e75aa3,g9b9dfce982+78139cbddb,g9ddcbc5298+9a081db1e4,ga1e77700b3+a912195c07,gae0086650b+585e252eca,gb0e22166c9+60f28cb32d,gb3a676b8dc+b4feba26a1,gb4b16eec92+f82f04eb54,gba4ed39666+c2a2e4ac27,gbb8dafda3b+215b19b0ab,gc120e1dc64+b0284b5341,gc28159a63d+047b288a59,gc3e9b769f7+dcad4ace9a,gcf0d15dbbd+78139cbddb,gdaeeff99f8+f9a426f77a,ge79ae78c31+047b288a59,w.2024.19
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Functions
psfexAdaptors.cc File Reference
#include "boost/format.hpp"
#include "lsst/pex/exceptions.h"
#include "lsst/meas/extensions/psfex/Field.hh"
#include "globals.h"
#include "context.h"
#include "prefs.h"
#include "sample.h"

Go to the source code of this file.

Namespaces

namespace  lsst
 
namespace  lsst::meas
 
namespace  lsst::meas::extensions
 
namespace  lsst::meas::extensions::psfex
 

Functions

setstruct * load_samples (char **filenames, int catindex, int ncat, int ext, int next, contextstruct *context)
 
void lsst::meas::extensions::psfex::makeit (std::vector< std::shared_ptr< Field > > &fields_, std::vector< std::shared_ptr< Set > > const &sets)
 

Function Documentation

◆ load_samples()

setstruct * load_samples ( char ** filenames,
int catindex,
int ncat,
int ext,
int next,
contextstruct * context )

Definition at line 14 of file psfexAdaptors.cc.

16{
17 /*
18 * The C version of this is called two ways:
19 * catindex == 0, ncat == ncat Read all catalogues
20 * catindex == c, ncat == 1 Read only catalogue c
21 */
22 setstruct *completeSet = reinterpret_cast<setstruct *>(filenames[catindex + 0]);
23 /*
24 * Make a new set, which may be a subset of the completeSet
25 */
26 setstruct *set = init_set(context);
27 set->fwhm = completeSet->fwhm;
28 for (int i = 0; i != completeSet->vigdim; ++i) {
29 set->vigsize[i] = completeSet->vigsize[i];
30 }
31 for (int i = 0; i != completeSet->ncontext; ++i) {
32 strcpy(set->contextname[i], completeSet->contextname[i]);
33 set->contextoffset[i] = completeSet->contextoffset[i];
34 set->contextscale[i] = completeSet->contextscale[i];
35 }
36 /*
37 * Count how many samples we'll be including
38 */
39 int nsample_keep = 0;
40 for (int i = 0; i != ncat; ++i) {
41 setstruct *s = reinterpret_cast<setstruct *>(filenames[catindex + i]);
42 for (int j = 0; j != completeSet->nsample; ++j) {
43 samplestruct const *samp = s->sample[j];
44 if (ext == ALL_EXTENSIONS || ext == samp->extindex) {
45 ++nsample_keep;
46 }
47 }
48 }
49
50 set->samples_owner = 0;
51 malloc_samples(set, nsample_keep);
52 for (int i = 0; i != ncat; ++i) {
53 setstruct *s = reinterpret_cast<setstruct *>(filenames[catindex + i]);
54 for (int j = 0; j != completeSet->nsample; ++j) {
55 samplestruct *samp = s->sample[j];
56 if (ext == ALL_EXTENSIONS || ext == samp->extindex) {
57 set->sample[set->nsample++] = samp;
58 }
59 }
60 }
61
62 return set;
63}
daf::base::PropertySet * set
Definition fits.cc:931
T strcpy(T... args)