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

Terminator plots #26

Merged
merged 5 commits into from
Sep 2, 2024
Merged

Terminator plots #26

merged 5 commits into from
Sep 2, 2024

Conversation

ta440
Copy link
Collaborator

@ta440 ta440 commented Aug 30, 2024

Add or update a Gusto case study

Here is a checklist of things that should be done to add a new case study to
the repository:

  • The case study has been prepared from the case studies template in templates/template_case_study.py. This ensures that the case study:
    • begins with documentation of the case
    • includes a dictionary of default argument values
    • is run through a function
    • follows the standard order of sections:
      1. test case parameters
      2. set up of model objects
      3. initial conditions
      4. run
    • includes a __main__ routine with arg-parsing of command line arguments
  • The case study has a quick-to-run test form in the relevant test_*.py file, so that it will be run as part of CI
  • A plotting script has been added to the relevant plotting directory, with a name that matches the case study script
  • Neat figures have been added to the relevant figures directory, with names that match the case study script

Add or update a plotting script

Here is a checklist of things that should be done to add a new plotting script to the repository:

  • The plotting script has been prepared from the template in templates/template_plotting_script.py or another acceptable plotting script
  • The plot follows the Good Plot Guide in tomplot/good_plot_guide.md
  • Relevant initial and final fields are plotted
  • The figures produced have been added to the repository

Copy link
Collaborator

@tommbendall tommbendall left a comment

Choose a reason for hiding this comment

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

Some suggested tweaks ... the plot looks great though!

colour_scheme = X2_colour_scheme
field_label = X2_field_label
cmap, lines = tomplot_cmap(contours, colour_scheme, remove_contour=None)
cbar_labelpad = -10
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might want to make these cbar_labelpad values even more negative, so that the label for the colour bar tucks into the colour bar more tightly

@@ -124,7 +125,7 @@ def terminator_toy(
xyz = SpatialCoordinate(mesh)
lamda, theta, _ = lonlatr_from_xyz(xyz[0], xyz[1], xyz[2])
k1 = max_value(
0, k1_max*cos(great_arc_angle(lamda, lamda_cr, theta, theta_cr))
0, k1_max*cos(great_arc_angle(lamda, theta, lamda_cr, theta_cr))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops, thanks for spotting this!


g1 = exp(-5*((X-X1)**2 + (Y-Y1)**2 + (Z-Z1)**2))
g2 = exp(-5*((X-X2)**2 + (Y-Y2)**2 + (Z-Z2)**2))
b0 = 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be a parameter at the top?

)

terminator_toy_defaults = {
'ncells_per_edge': 8, # num points per icosahedron edge (ref level 3)
'dt': 900.0, # 15 minutes
'ncells_per_edge': 16, # num points per icosahedron edge (ref level 4)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'ncells_per_edge': 16, # num points per icosahedron edge (ref level 4)
'ncells_per_edge': 16, # num points per icosahedron edge (ref level 4)

@tommbendall tommbendall added bug Pull requests or issues to relating to something not working plotting script Pull requests or issues for adding a plotting script figure Pull requests or issues relating to a figure case study Pull requests or issues relating to adding or amending a case study labels Sep 2, 2024
Copy link
Collaborator

@tommbendall tommbendall left a comment

Choose a reason for hiding this comment

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

Looks really nice to me

@tommbendall tommbendall merged commit 6b5f56c into main Sep 2, 2024
3 checks passed
@tommbendall
Copy link
Collaborator

Thanks for doing this Tim!

@tommbendall tommbendall deleted the terminator_plots branch September 2, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Pull requests or issues to relating to something not working case study Pull requests or issues relating to adding or amending a case study figure Pull requests or issues relating to a figure plotting script Pull requests or issues for adding a plotting script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants