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

Change the unit of electron density from m-3 to cm-3 following model naming convention #1595

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
8 changes: 6 additions & 2 deletions src/conventional/ionosonde_ascii2ioda.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
varDict = {'criticalFrequency': ['criticalFrequency', "float", 'm s-1'],
'criticalFrequencyConfidence': ['criticalFrequencyConfidence', "float", 'fractional percent'],
'height': ['height', "float", "m"],
'electronDensity': ['electronDensity', "float", 'number / m^3'],
'electronDensityConfidence': ['electronDensityConfidence', "float", 'number / m^3']}
'electronDensity': ['electronDensity', "float", 'number cm-3'],
'electronDensityConfidence': ['electronDensityConfidence', "float", 'number cm-3']}

# these are the MetaData common to each input
locationKeyList = [("latitude", "float", "degrees_north"),
Expand Down Expand Up @@ -294,6 +294,10 @@ def populate_obsValue(line, local_data):
# Convert only freq, f_conf, density, and density_conf to float
height, freq, f_conf, density, density_conf = map(float, [height, freq, f_conf, density, density_conf])

# convert electronDensity values from number per m-3 to cm-3
density *= 1.e-6
density_conf *= 1.e-6

if all(x > 0 for x in [freq, f_conf, density, density_conf]):
local_data['height'] = np.append(local_data['height'], height)
local_data['criticalFrequency'] = np.append(local_data['criticalFrequency'], freq)
Expand Down
2 changes: 1 addition & 1 deletion test/testoutput/ionosonde_edp_20201003T203000Z.nc4
Git LFS file not shown