Skip to content

Plot relative/normalized to a band other than V - #71

Open
karllark wants to merge 4 commits into
masterfrom
add_plot_rel_band
Open

Plot relative/normalized to a band other than V#71
karllark wants to merge 4 commits into
masterfrom
add_plot_rel_band

Conversation

@karllark

Copy link
Copy Markdown
Owner

Add in option to change the relative band in plot.

@karllark karllark added the enhancement New feature or request label Dec 21, 2020
@karllark

Copy link
Copy Markdown
Owner Author

@mdecleir - code I used to make plots with different normalizations for our slack discussion. Figured I should generate the PR. Have a look when you get a chance.

@mdecleir mdecleir left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had a quick look at the code, and I think the calculations are not correct given the units of the extinction curve. I would need to run the code with different examples (alax=True, alax=False, different bands) to double check the outcome in the different cases.


plot_rel_band : str [default=None]
plot relative to this band
if None then use the existing relative band (often V)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should add that this is only if alax=True (if alax=False, this keyword will be ignored).

(bindx,) = np.where(self.names["BAND"] == self.type_rel_band)
ax = self.exts["BAND"][bindx[0]] + av
else:
raise ValueError("type_rel_band not band extinctions")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not in band extinctions?

if self.type_rel_band != "V":
if self.type_rel_band in self.names["BAND"]:
(bindx,) = np.where(self.names["BAND"] == self.type_rel_band)
ax = self.exts["BAND"][bindx[0]] + av

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this is calculation correct. self.exts is already in "alav" units at this point (see line 1000)...

ax = av

# get the conversion to another relative band
if plot_rel_band is not None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this should only happen if alax=True?

if plot_rel_band is not None:
if plot_rel_band in self.names["BAND"]:
(bindx,) = np.where(self.names["BAND"] == plot_rel_band)
eval = self.exts["BAND"][bindx[0]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same remark as before, we have to be careful with the units of self.exts here...

@karllark

Copy link
Copy Markdown
Owner Author

Will try and work on this PR soon. Either to close it or update it to remove conflicts and address the PR review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants