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

Direction dependent degrid with region files #115

Open
landmanbester opened this issue Sep 13, 2024 · 2 comments
Open

Direction dependent degrid with region files #115

landmanbester opened this issue Sep 13, 2024 · 2 comments

Comments

@landmanbester
Copy link
Collaborator

I started adding support for degridding different regions to separate columns in the ddpredict branch. The way I set it up is to pass in a single region file possibly containing multiple regions. The number of columns that will end up in the MS is 1 + the number of regions in the file. The part of the model not contained in any regions will be written to model-column and each region will go into f'{model-column}{i}' with i labelling the region number. Overlapping regions are not supported and the degrid application should raise an error if this is detected. I am open to suggestions for modifications/additions to this functionality.

@bngcebetsha note if you are using CORRECTED_DATA you should be able to subtract part of the model by running the init application with --data-column 'CORRECTED_DATA - MODEL_COLUMN_TO_SUBTRACT'. I haven't yet added functionality to subtract multiple columns or do on the fly gain application in this case. You will need to use QuartiCal if you need to do that

@landmanbester
Copy link
Collaborator Author

I think this works as advertised, at least it does on my simulated data. There is something I don't quite understand though viz. when converting the regions to masks I need to do the following

pixel_region = region.to_pixel(wcs)
region_mask = pixel_region.to_mask().to_image((ny, nx))
region_mask = region_mask.T

i.e. I need a transpose. I suspect this has got something to do with the wgridder conventions that are being used here

def wgridder_conventions(l0, m0):

but I'm not going to dig into that at this point. Note that the current implementation is a bit wasteful in that it just degrids the full image after zeroing components outside of the mask. We could improve this by only degridding the region (i.e. a smaller image) but that requires specifying the center of the region and therefore also getting the conventions to line up

@bngcebetsha
Copy link

I started adding support for degridding different regions to separate columns in the ddpredict branch. The way I set it up is to pass in a single region file possibly containing multiple regions. The number of columns that will end up in the MS is 1 + the number of regions in the file. The part of the model not contained in any regions will be written to model-column and each region will go into f'{model-column}{i}' with i labelling the region number. Overlapping regions are not supported and the degrid application should raise an error if this is detected. I am open to suggestions for modifications/additions to this functionality.

@bngcebetsha note if you are using CORRECTED_DATA you should be able to subtract part of the model by running the init application with --data-column 'CORRECTED_DATA - MODEL_COLUMN_TO_SUBTRACT'. I haven't yet added functionality to subtract multiple columns or do on the fly gain application in this case. You will need to use QuartiCal if you need to do that

Thanks for the feature @landmanbester - I will try the branch out and if I run into issues will message you on chat...thanks again.

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

No branches or pull requests

2 participants