draw_pos_vel_PDF=4##4 # 0/1/2/3/4 = OFF/ON/ON with 1D profile/ON also with 1D dispersion profile/ON also with separate 1D vertical dispersion profiles
draw_star_pos_vel_PDF=4##4 # 0/1/2/3/4 = OFF/ON/ON with 1D profile/ON also with 1D dispersion profile/ON also with separate 1D vertical dispersion profiles
draw_rad_height_PDF=2##2 # 0/1/2/3 = OFF/ON/ON with 1D profile/ON with analytic ftn subtracted
draw_metal_PDF=0##0 # 0/1 = OFF/ON
draw_metal_PDF=1##1 # 0/1 = OFF/ON
draw_density_DF=2#2 # 0/1/2 = OFF/ON/ON with difference plot between 1st and 2nd datasets (when 2, dataset_num should be set to 2)
draw_radius_DF=1#1 # 0/1 = OFF/ON
draw_star_radius_DF=2#2 # 0/1/2 = OFF/ON/ON with SFR profile and K-S plot (when 2, this automatically turns on draw_radius_DF)
elifcodes[code]=='SWIFT':# "Metals" in SWIFT is 10-species field ([:,9] is the total metal fraction), so requires a change in _vector_fields in frontends/gadget/io.py: added ("Metals", 10)
returndata[PartType_Gas_to_use,"SmoothedElementAbundances"][:,9].in_units("")# in_units("") turned out to be crucial!; otherwise code_metallicity will be used and it will mess things up
# We are creating ("Gas", "Metallicity") here, different from ("Gas", "metallicity") which is auto-generated by yt but doesn't work properly
# Also creating smoothed field following an example in yt-project.org/docs/dev/cookbook/calculating_information.html; use hardcoded num_neighbors as in frontends/gadget/fields.py
# Alias doesn't work -- e.g. pf.field_info.alias(("gas", "metallicity"), fn[0]) -- probably because pf=GadgetDataset()?, not load()?; so I add and replace existing ("gas", "metallicity")