Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cy/issue 0033 #88

Merged
merged 21 commits into from
Feb 3, 2025
Merged

Cy/issue 0033 #88

merged 21 commits into from
Feb 3, 2025

Conversation

chyan26
Copy link
Collaborator

@chyan26 chyan26 commented Jan 31, 2025

This branch has completed LM IMG pipeline skeleton. I noticed that the EDPS could not run with the current updated code in main branch. This branch contains several fixed and update, which may fix the problem. I suggest we merge this branch to main before getting too long.

@chyan26 chyan26 linked an issue Jan 31, 2025 that may be closed by this pull request
12 tasks
@chyan26 chyan26 requested a review from sesquideus January 31, 2025 15:35
@sesquideus
Copy link
Contributor

I could fix the forgotten changes from main but apparently EDPS still does not like it.

Copy link
Contributor

@hugobuddel hugobuddel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supercool @chyan26 !! Great to see everything come together!

I've added some minor comments. Could you please look at them and reply with your thoughts?

I can't judge how all this fits into @sesquideus 's framework, so I'll let Martin do the 'real' review, I'm just an excited bystander

Comment on lines 33 to 37
class MetisLmImgBackgroundImpl(RawImageProcessor):

class InputSet(RawImageProcessor.InputSet):
class RawInput(RawInput):
_tags = re.compile(r"LM_(?P<target>SCI|SKY|STD)_BASIC_REDUCED")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks weird to me, because metis_lm_img_background does not have raw data as input. Maybe this is the way to do things, I don't know. Maybe @sesquideus can chime in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed should not be a RawInput, just a SinglePipelineInput or even better a dedicated class BasicReducedInput(SinglePipelineInput).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agrees, I just picked up a class that works. We can changed to the current fashion.

@@ -19,8 +19,8 @@


# --- Data sources ---
detlin_raw = (data_source()
.with_classification_rule(detlin_class)
detlin_2rg_raw = (data_source()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! But why stop here and not also change lingain_task to lm_lingain_task etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I should add lm to all related task.

metisp/pymetis/src/pymetis/inputs/multiple.py Outdated Show resolved Hide resolved
Comment on lines 35 to 36
class RawInput(RawInput):
_tags = re.compile(r"LM_(?P<target>WCU_OFF|DISTORTION)_RAW")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is how we want to model this input? I was expecting the WCU_OFF frames to be a separate calibration product, similar to how it is done in MetisIfuRsrfImpl. I could perhaps be convinced the other way though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also not too sure about this part. This is based on DRLD. So, I would keep it this way for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WCU_OFF_RAW are listed as calibration input in the DRLD, not as the main input. That's why I'm suggesting to have it as a calibration input in the workflow as well. It doesn't really matter from that perspective whether it is raw data or not. We did it that way in metis_ifu_rsrf too. We can also discuss whether we want to do things differently.

@@ -30,3 +38,56 @@
.with_meta_targets([SCIENCE])
.build())

basic_reduction_sky = (task('metis_lm_img_basic_reduce_sky')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prefix all these tasks with lm, because otherwise they will conflict with the tasks from the other subinstruments.

Comment on lines +88 to +89
img_coadd = (task('metis_lm_img_coadd')
.with_recipe('metis_lm_img_sci_postprocess')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly suggest keeping the task names as close to the recipe names as possible. Other names only add confusion.

.with_recipe('metis_lm_img_background')
.with_main_input(basic_reduction_std)
.with_associated_input(basic_reduction_sky)
.with_meta_targets([SCIENCE])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all these calibration tasks have SCIENCE as meta target? I would expect some other target like CALIB.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, some of those should be CALIB.

@hugobuddel
Copy link
Contributor

I could fix the forgotten changes from main but apparently EDPS still does not like it.

There are still some self.inputs += [ lists in the new recipes; I think those should now be sets, right?

@sesquideus
Copy link
Contributor

There are still some self.inputs += [ lists in the new recipes; I think those should now be sets, right?

Yes, and that should fail TestInputSet::test_has_inputs_and_it_is_a_set. I hope it only occurs with recipes which do not have the corresponding test module yet.

@hugobuddel hugobuddel mentioned this pull request Feb 1, 2025
@chyan26 chyan26 merged commit e8f98d1 into main Feb 3, 2025
2 checks passed
@hugobuddel
Copy link
Contributor

I don't understand @chyan26 . Above you explicitly agree to several comments, but then you merge it without addressing them. What is the plan?

Comment on lines +1 to +2
# Skip __init__.py setting
__init__.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__init__.py should not be in .gitignore, since it should generally not be ignored. Could you please remove this again? I believe this was added only after I reviewed the PR so I couldn't remark on it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REC : skel : metis_lm_img_background
3 participants