-
Notifications
You must be signed in to change notification settings - Fork 7
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
VMD sphere and 3 loop apps #107
Conversation
Related to the additions requested in geoscixyz/em-apps#37, geoscixyz/em-apps#39, geoscixyz/em-apps#40 and is necessary for pr: geoscixyz/em-apps#50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dccowan: thanks for all of your work on this! I left a few minor comments. The main items are:
- lets try including the frequency / time info in the title of the figure (it is really hard to read on the plot)
- I provided an example to get the colorbars working for the log scales: would you mind implementing this?
- then there are a few other minor comments throughout.
Please let me know if you have any questions!
em_examples/HarmonicVMDCylWidget.py
Outdated
else: | ||
# ax.imshow(self.im) | ||
ax.set_xticks([]) | ||
ax.set_yticks([]) | ||
return "Vector plot only supports real and imaginary type!" | ||
print("Think about the problem geometry. There is NO By in this case.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is also worth adding a return
statement right after this (no need to draw the figure, printing is enough)
em_examples/HarmonicVMDCylWidget.py
Outdated
# ax.imshow(self.im) | ||
ax.set_xticks([]) | ||
ax.set_yticks([]) | ||
print("Think about the problem geometry. There is NO Ex or Ez in this case.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment: it is also worth adding a return
statement right after this (no need to draw the figure, printing is enough)
em_examples/HarmonicVMDCylWidget.py
Outdated
elif scale == "log": | ||
cb = plt.colorbar( | ||
out[0], ax=ax, ticks=np.linspace(val.min(), val.max(), 3), | ||
format="$10^{%.1f}$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgkang: you might also have some advice on how to set a good colorbar for log scales?
em_examples/HarmonicVMDCylWidget.py
Outdated
if (Field == "B") & (Component == "y"): | ||
print("Think about the problem geometry. There is NO By in this case.") | ||
elif (Field == "E") & (Component == "x") | (Field == "E") & (Component == "z"): | ||
print("Think about the problem geometry. There is NO Ex or Ez in this case. Only Ey.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add a return statement after each of these
model2D, mapping2D = self.getCoreModel('Layer') | ||
|
||
out = self.mesh2D.plotImage(np.log10(mapping2D * model2D), ax=ax) | ||
cb = plt.colorbar( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above for the colorbar and getting it to show up for a log scale
# ax.imshow(self.im) | ||
ax.set_xticks([]) | ||
ax.set_yticks([]) | ||
return "Dude, think twice ... only Jy for VMD" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
format="%.1e" | ||
) | ||
elif scale == "log": | ||
cb = plt.colorbar( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about colorbar as above
ax.set_title(title) | ||
ax.text( | ||
-150, 150, ("Time: %.3f ms") % (self.prb.times[itime]*1e3), | ||
fontsize=16, fontweight='bold', color='r' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really hard to see. What about just including it in the title?
title = title + "\nTime: %.3f ms" % (self.prb.times[itime]*1e3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def InteractiveData_Layer(self, fieldvalue="B", compvalue="z"): | ||
def foo(Field, Component, Scale): | ||
if (Field == "B") & (Component == "y"): | ||
print("Think about the problem geometry. There is NO By in this case.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you mind adding return statements here?
em_examples/HarmonicVMDCylWidget.py
Outdated
ax.set_xlabel("Distance (m)") | ||
ax.set_ylabel("Depth (m)") | ||
ax.set_title(title) | ||
ax.text( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we instead add this to the title
ax.set_title(title + "\nFrequency: %.2e Hz" % (Frequency))
It will be much easier to read
Here, we are merging the base code for the following apps: