SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

Change input types, remove len_factor from calculated_fitted_velocities() #377

Closed billetd closed 5 months ago

billetd commented 5 months ago

Scope

Small PR to clean up the docstring in calculated_fitted_velocities(), and remove the len_factor' input which isn't used anywhere in the function (probably a holdover from this code was inplot_mapdata()'. The datatypes for mlats, mlons, and fit_coefficient were changed to arrays from lists, because the code doesn't actually work if you give it a list.

Approval

Number of approvals: 1

Test

import pydarn
import numpy as np

mapfile = 'path/to/mapfile'
SDarn_read = pydarn.SuperDARNRead(mapfile)
map_data = SDarn_read.read_map()

record = map_data[0]  # first record of the file
mlats = np.array([60,70,80])
mlons = np.array([-120,-120,-120])
fit_coefficient = record['N+2']
fit_order = record['fit.order']
lat_shift = record['lat.shft']
lon_shift = record['lon.shft']
lat_min = record['latmin']
hemisphere = pydarn.Hemisphere(record['hemisphere'])

mlats = np.array
velocity, azm = (pydarn.Maps.calculated_fitted_velocities(mlats, mlons, fit_coefficient, hemisphere, fit_order, lat_min))
carleyjmartin commented 5 months ago

You're correct that calculated_fitted_velocities doesn't need len_factor. But you'll need to remove it from the method call earlier too for the code to not break on line 249.