add magMWdust function#19
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new plotting helper to overlay a Milky Way dust layer (from an SFD-derived lookup table) onto existing magproj sky plots, with both point and polygon rendering modes.
Changes:
- Introduces
magMWdust()R function to read/map dust values to opacity and plot viamagproj. - Adds Rd documentation and examples for the new plotting helper.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
R/magMWdust.R |
Implements magMWdust() to map dust values to opacity and render as points or polygons. |
man/magMWdust.Rd |
Documents the new function, its parameters, behavior, and usage examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…e session with show.status = TRUE
|
Can you see the auto copilot comments @AngusWright ? The main (fairly minor) change is to use the package data(dust_data) method for loading data. The best practice way to do this is to have an argument (something like dust_data) where the default is NULL, and in that case inside the function it loads the included dust with data(dust_date), but otherwise it lets you pass in your own user defined dust input (in the correct format of course). This is how ProSpectSED works with loading default libraries (check the top of that function if you want to see an Example). |
|
yes updating the code now |
asgr
left a comment
There was a problem hiding this comment.
Just some questions and a suggested reference to be added.
| # If none provided, read the dust map data, which is a dlon=dlat=1 sampling | ||
| if (is.null(dust.data)) { | ||
| # Define the dlon and dlat values | ||
| dlon <- dlat <- 0.99 |
There was a problem hiding this comment.
What's the reason you set this to 0.99 here?
| } | ||
| \item{dlon}{ | ||
| Step size between element of longitude. Required when specifying dust.data directly, | ||
| and uses \code{dlon=1} when lazy-loading the internal dust map. |
Adds functionality to add a MW dust distribution to magproj() maps, using a lookup table of values drawn from the SFD dust maps. The values can be plotted as points or polygons, and scaled to chosen white/black limits, opacities, magmap() scaling, etc.
Function is ~30 lines, documentation is ~70 lines, and lookup table is ~38k lines.