Skip to content

Commit fa2496d

Browse files
committed
removefield for Symbol name
1 parent a12fcf7 commit fa2496d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/utils.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ function dropnames(namedtuple::NamedTuple, names::Tuple{Vararg{Symbol}})
100100
end
101101

102102
"""
103-
V = removefield(V::AbstractGeneralGrid,field_name::String)
103+
V = removefield(V::AbstractGeneralGrid,field_name::Symbol)
104104
105105
Removes the field with name `field_name` from the GeoData or CartData dataset
106106
107107
"""
108-
function removefield(V::AbstractGeneralGrid,field_name::String)
108+
function removefield(V::AbstractGeneralGrid,field_name::Symbol)
109109
fields_new = V.fields;
110-
fields_new = dropnames(fields_new, (Symbol(field_name),))
110+
fields_new = dropnames(fields_new, (field_name,))
111111

112112
if isa(V,GeoData)
113113
V = GeoData(V.lon.val,V.lat.val,V.depth.val,fields_new)
@@ -121,6 +121,16 @@ function removefield(V::AbstractGeneralGrid,field_name::String)
121121
end
122122

123123

124+
"""
125+
V = removefield(V::AbstractGeneralGrid,field_name::String)
126+
127+
Removes the field with name `field_name` from the GeoData or CartData dataset
128+
129+
"""
130+
function removefield(V::AbstractGeneralGrid,field_name::String)
131+
return removefield(V,Symbol(field_name))
132+
end
133+
124134

125135
"""
126136
cross_section_volume(Volume::AbstractGeneralGrid; dims=(100,100), Interpolate=false, Depth_level=nothing; Lat_level=nothing; Lon_level=nothing; Start=nothing, End=nothing, Depth_extent=nothing )

0 commit comments

Comments
 (0)