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

VMD sphere and 3 loop apps #107

Merged
merged 10 commits into from
Jul 19, 2018
Merged

VMD sphere and 3 loop apps #107

merged 10 commits into from
Jul 19, 2018

Conversation

dccowan
Copy link
Member

@dccowan dccowan commented Jul 9, 2018

Here, we are merging the base code for the following apps:

  • FDEM sphere example for VMD source
  • TDEM sphere example for VMD source
  • 3 loop model example

@lheagy
Copy link
Member

lheagy commented Jul 17, 2018

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

Copy link
Member

@lheagy lheagy left a 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!

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.")

Copy link
Member

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)

# 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.")
Copy link
Member

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)

elif scale == "log":
cb = plt.colorbar(
out[0], ax=ax, ticks=np.linspace(val.min(), val.max(), 3),
format="$10^{%.1f}$"
Copy link
Member

Choose a reason for hiding this comment

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

These ticks aren't showing up, but one thing you could do is

cb = plt.colorbar(
    out[0], ax=ax, format="$10^{%.0f}$"
)
ticks = cb.get_ticks()
cb.set_ticks(ticks[[0, -1]])  # grabs the first and last tick that are displayed

and it will show up as

image

Copy link
Member

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?

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.")
Copy link
Member

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(
Copy link
Member

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"
Copy link
Member

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(
Copy link
Member

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'
Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

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

e.g. it will look like (for FDEM)
image

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.")
Copy link
Member

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?

ax.set_xlabel("Distance (m)")
ax.set_ylabel("Depth (m)")
ax.set_title(title)
ax.text(
Copy link
Member

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

@lheagy lheagy merged commit 8ef4b58 into master Jul 19, 2018
@lheagy lheagy deleted the HoustonVMDsphere branch July 19, 2018 20:51
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.

2 participants