Skip to content

Conversation

@JenniferKarr
Copy link
Collaborator

Basic implementation of the third workflow/recipes for ADI. A bit rough, but it produces the correct output.

Copy link
Contributor

@sesquideus sesquideus left a comment

Choose a reason for hiding this comment

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

From my side it looks fine -- I have a few minor reservations but that can be improved later.




class SciCentred(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this does not seem to be crgph-specific.



class LmAppSciCentred(BandLmMixin, CgrphAppMixin, SciCentred):
_name_template = r"{band}_APP_SCI_CENTRED"
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is indeed something that can be parameterized by cgrph, the name template should most likely read r'{band}_{cgrph}_SCI_CENTRED

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't yet fully understand how the abstraction works, so I might misunderstand.

The CgrphAppMixin implies that the class is partially specialized and thus that cgrph part of the template name is correctly substituted with (by?) APP.

But then I would expect the same with the band: the BandLmMixin is used, and the class is called LmAppSciCentred, so I think the template name should be LM_APP_SCI_CENTRED.

from pymetis.classes.mixins.cgrph import CgrphSpecificMixin


class IfuOffAxisPsfRaw(ImageDataItem, abstract=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

Fully specialized data items should not be abstract (in fact that could be the definition and in that case we can dispense with abstract altogether).

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.

Good, almost the full workflow complete!

It seems that there are several small mistakes that need to be rectified. I probably have missed some too, so please check. There are also several duplicate classes, that I think is an accident.

I suggest to either create these classes automatically, or at least use a script to verify that they are correct.

Also, please reuse the names we already have. It is confusing to see the name of a task, and then have to guess which recipe it corresponds to. Reinventing names adds friction for no reason that I can discern.

Can you also please address the open comments on #167? You essentially resubmitted that PR for review, and apparently I now reviewed partially the same code twice.

Nevertheless, thanks for taking on this tedious task!

pass


class LmRavcCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is exactly the same as the next class; did you mean

Suggested change
class LmRavcCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab):
class LmAppCentroidTab(BandLmMixin, CgrphAppMixin, CentroidTab):

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hciApp.py was redundant; I temporarily forgot I had defined all the imaging data classes with the first HCI workflow. I have removed it.



class LmAppSciCentred(BandLmMixin, CgrphAppMixin, SciCentred):
_name_template = r"{band}_APP_SCI_CENTRED"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't yet fully understand how the abstraction works, so I might misunderstand.

The CgrphAppMixin implies that the class is partially specialized and thus that cgrph part of the template name is correctly substituted with (by?) APP.

But then I would expect the same with the band: the BandLmMixin is used, and the class is called LmAppSciCentred, so I think the template name should be LM_APP_SCI_CENTRED.

class IfuOffAxisPsfRaw(ImageDataItem, abstract=True):

_name_template = r'IFU_OFF_AXIS_PSF_RAW'
_title_template = r"IFU RAVC sci calibration"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is IfuOffAxisPsfRaw only applicable to RAVC? Could be

Comment on lines +228 to +235
class IfuRavcSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass

class IfuCvcSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass

class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

These Mixin's are all for App, that doesn't seem right. Maybe

Suggested change
class IfuRavcSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass
class IfuCvcSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass
class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass
class IfuRavcSciThroughput(CgrphRavcMixin, IfuSciThroughput):
pass
class IfuCvcSciThroughput(CgrphCvcMixin, IfuSciThroughput):
pass
class IfuAppSciThroughput(CgrphAppMixin, IfuSciThroughput):
pass

Comment on lines +248 to +258
class IfuRavcSciCentred(CgrphAppMixin, IfuSciCentred):
pass

class IfuRavcCentroidTab(CgrphAppMixin, IfuCentroidTab):
pass

class IfuCvcSciCentred(CgrphAppMixin, IfuSciCentred):
pass

class IfuCvcCentroidTab(CgrphAppMixin, IfuCentroidTab):
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class IfuRavcSciCentred(CgrphAppMixin, IfuSciCentred):
pass
class IfuRavcCentroidTab(CgrphAppMixin, IfuCentroidTab):
pass
class IfuCvcSciCentred(CgrphAppMixin, IfuSciCentred):
pass
class IfuCvcCentroidTab(CgrphAppMixin, IfuCentroidTab):
pass
class IfuRavcSciCentred(CgrphRavcMixin, IfuSciCentred):
pass
class IfuRavcCentroidTab(CgrphRavcMixin, IfuCentroidTab):
pass
class IfuCvcSciCentred(CgrphCvcMixin, IfuSciCentred):
pass
class IfuCvcCentroidTab(CgrphCvcMixin, IfuCentroidTab):
pass

return {product_lmSciCalibrated, product_lmSciCentred, product_lmSciCentred, product_lmCentroidTable, product_lmSciHifilt, product_lmSciDerotatedPsfsub, product_lmSciDerotated, product_lmSciContrastRadprof, product_lmSciContrastAdi, product_lmSciThroughput, product_lmSciCoverage, product_lmSciSnr, product_lmSciPsfMedian}


class MetisLmAppSciCalibrated(MetisRecipe):
Copy link
Contributor

Choose a reason for hiding this comment

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

Idem, here I would expect the name MetisLmAdiApp

Comment on lines 7 to 8
ifu_ravc_post_task = (task('ifu_ravc_post')
.with_recipe('metis_ifu_adi_cgrph')
Copy link
Contributor

Choose a reason for hiding this comment

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

Place name the tasks like the recipes as much as feasible, otherwise everyone has to learn too many different names. The recipe, the recipe class, the edps task can all have names that are simply different forms of the same thing.

Suggested change
ifu_ravc_post_task = (task('ifu_ravc_post')
.with_recipe('metis_ifu_adi_cgrph')
ifu_adi_ravc_task = (task('ifu_adi_ravc_task')
.with_recipe('metis_ifu_adi_cgrph')

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 renamed the tasks, and pushed the changes.

Comment on lines 88 to 91
class CentroidTab(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True):

_name_template = r'{band}_RAVC_CENTROID_TAB'
_title_template = r"{band} RAVC centroid tab"
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't say that I fully understand the abstraction layer, but I would not expect RAVC here, because I wouldn't know where the CVC equivalent would go. Or does that not exist?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is cgrph-specific, it should naturally say r'{band}_{cgrph}_CENTROID_TAB'. If it is not, CgrphSpecificMixin should go away.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is the thought I had too, either CgrphSpecificMixin and {cgrph} in the name, or neither.

The nomenclature is quite confusing though. I interpreted the term "cgrph-specific" as meaning "for a specific coronograph", e.g. "for the RAVC coronograph".

Copy link
Contributor

Choose a reason for hiding this comment

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

I just finished a better structure, in which this is no longer needed at all. Setting CgrphRavcMixin in the derived class will be enough.

Comment on lines 44 to 47
class AdiCalibrated(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True):

_name_template = r'{band}_RAVC_SCI_CALIBRATED'
_title_template = r"{band} RAVC sci calibration"
Copy link
Contributor

Choose a reason for hiding this comment

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

This class mentions RAVC, in fact, most of the classes in this file do. But this file is in the appHci.py file. I would expect APP classes in a file with that name. Maybe I don't understand things properly, at least it is confusing.

'DET1.DATA': Image,
}

class SciDerotated(BandSpecificMixin, CgrphSpecificMixin, ImageDataItem, abstract=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

Most of these classes are now defined both in hci.py and in appHci.py. We could do that, but I think it would be better if we give the classes unique names.

Also, it seems the classes have the same _name_template, and I don't think that is allowed, because aren't those the unique identifiers of the class?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or in case you actually need to use the same class in different places, you can just import them. (If that leads to circular imports, then you can refactor them by putting all the shared classes in a separate file.)

deleted superfluous file
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.

4 participants