Replies: 6 comments 2 replies
-
|
This is amazing @ayllon! As far as I am concerned I have a slight preference for the last proposal. Right now are there other sequences one can reasonably think of for the source extraction pipeline? |
Beta Was this translation helpful? Give feedback.
-
|
Would something like this make sense? with sx.Context(config):
pipeline = sx.Pipeline([
sx.Segmentation(),
sx.Partition(),
CustomFilter(snr=10),
sx.Grouping(),
sx.Deblending(),
sx.Measurement(),
sx.FitsOutput()
])
pipeline()then, we can leave the So we can keep the API for the custom components as: class MyFilter:
def __call__(self, obj):
if something_with(source):
self.__next(source)I think it makes more sense to have custom stages as functors. We can also have pipeline = sx.DefaultPipeline(config) |
Beta Was this translation helpful? Give feedback.
-
|
This is very interesting for me, since I would like to control SourceXtractor++ executions throught Python, possibly analogous to sep. Do you have a complete working example of the steps above? Something that I can run myself or reproduce? |
Beta Was this translation helpful? Give feedback.
-
|
Ah, sorry, that must be |
Beta Was this translation helpful? Give feedback.
-
|
Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
The last exercise of the test data set mentioned in the README and described here shows what is implemented in the branch mentioned by @marcschefer . This is the directions the development will likely go. Until then there is no recommended way executing SE++ from python, and as a matter of fact in the Euclid satellite project we use a wrapper with the module "subprocess" at its core. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have almost the full pipeline callable from Python, except for the
Prefetcher. Measurement can be done multithreaded, and the output is a numpy array (although it could be directly a FITS file)We need to agree on what the API would look like, though.
Abstraction leaks
Users may want to keep hold of the sources even after sourcextractor is done. i.e. for pickling, or to do something with them after the full pipeline is done (plotting?)
This is risky business, as some properties will be pointing to internal details (as a pointer to the detection frame).
I think the best option (partially implemented) is to add a
detach()method that gives a source that exists outside of the pipeline, with whatever properties had been already computed. No on-demand properties removes the trickiness of dealing with internal properties.However, we need to make sure we have no lazy property evaluation (i.e. stamp must hold a "materialized" stamp, and not be lazily evaluated via the measurement/detection frame when requested)
Building the pipeline
Right now it is an almost 1-1 translation
Kind of verbose. An option would be to do it at construction time
Or a-la keras
Maybe we can get rid of the context everywhere with something like
Maybe if the context initialization is done in two steps
Any other ideas about what the API could look like?
Beta Was this translation helpful? Give feedback.
All reactions