Skip to content

Commit 1896aa2

Browse files
authored
Merge pull request #120 from zmoon/spell
Fix some spelling and add codespell CI job
2 parents a759ee4 + f082e67 commit 1896aa2

File tree

15 files changed

+80
-71
lines changed

15 files changed

+80
-71
lines changed

.codespell-exclude

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"CNA",
2+
# scrip_file=d1.monet.scrip, check_N=20 ) )
3+
"SIZ", "Size distribution"
4+
"ALL", "All of the above retrievals (SIZ to FLX) in one file"

.github/workflows/lint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@ jobs:
1818
with:
1919
python-version: "3.8"
2020
- uses: pre-commit/action@v3.0.0
21+
22+
spell:
23+
name: codespell
24+
runs-on: ubuntu-latest
25+
if: github.repository == 'noaa-oar-arl/monet'
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: codespell-project/actions-codespell@v1
29+
with:
30+
exclude_file: .codespell-exclude

docs/tutorial/CMAQ_hi_volcano.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ eruption. First, import MONET and several helper functions for later.
1818
Now the data can be downloaded from the MONET github page in the
1919
MONET/data directory. We will assume you already have this downloaded
2020
and will proceed. Open the simulation. As of right now we still require
21-
that a seperate grdcro2d (grddot2d) file be loaded for the mass points
21+
that a separate grdcro2d (grddot2d) file be loaded for the mass points
2222
(dot points) using the ``grid`` kwarg.
2323

2424
.. code:: python
@@ -138,7 +138,7 @@ aggrigate species in the concentration file.
138138
139139
140140
Notice that this looks like the ncdump of the file except that there are
141-
seperate coordinates including the latitude and longitude and the time
141+
separate coordinates including the latitude and longitude and the time
142142
as numpy.datetime64 objects. Also included is the proj4 string, a pyresample area grid
143143
and default mapping tables to several different observational datasets.
144144

@@ -195,7 +195,7 @@ will add a map using the MONETAccessor and use the ``robust=True`` kwarg.
195195
Better but we can still do much more. There is low concentrations on
196196
most of this map making it hard to notice the extremely high values and
197197
the SO2 data is in ppmv and not ppbv as normally viewed as. Also, a
198-
logscale may be better fo this type of data as it goes from 0-20000 ppbv
198+
logscale may be better for this type of data as it goes from 0-20000 ppbv
199199
rather than a linear scale.
200200

201201
.. code:: python
@@ -208,7 +208,7 @@ rather than a linear scale.
208208
.. image:: CMAQ_hi_volcano_files/CMAQ_hi_volcano_11_3.png
209209

210210

211-
Now let’s us view serveral time slices at once. We will average in time
211+
Now let’s us view several time slices at once. We will average in time
212212
(every 8 hours) to give us 6 total subplots.
213213

214214
.. code:: python
@@ -246,7 +246,7 @@ It is often useful to be able to pair model data with observational
246246
data. MONET uses the pyresample library
247247
(http://pyresample.readthedocs.io/en/latest/) to do a nearest neighbor
248248
interpolation. First let us get the airnow data for the dates of the
249-
simulation. We will also rotate it from the raw AirNow long format (stacked variables) to a wide format (each variable is a seperate column)
249+
simulation. We will also rotate it from the raw AirNow long format (stacked variables) to a wide format (each variable is a separate column)
250250

251251

252252
.. code:: python
@@ -290,7 +290,7 @@ new column (model).
290290
291291
292292
Let’s look at the distributions to see if the two overlap to get a
293-
general scence of performance.
293+
general sense of performance.
294294

295295
.. code:: python
296296

docs/tutorial/NESDIS_VIIRS_AOD.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Notice that the dimensions changed from 1800x3600 to 720x1440.
100100
Open Multiple Days
101101
~~~~~~~~~~~~~~~~~~
102102

103-
If you want to open multiple days in a sinlge call you could use the
103+
If you want to open multiple days in a single call you could use the
104104
open\_mfdataset. Lets grab the first nine days of July 2018.
105105

106106
.. code-block:: python

docs/tutorial/aqs_pams.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Now we have all the imports we could need lets load some data. Most of
2828
the PAMS data is on daily data so lets add the kwarg daily=True to the
2929
call. We will also create this for the year 2015 and 2016. Some
3030
variables that may be valuable are the VOCS, ozone, NO2, NOX,
31-
temperature. For all of the measurments available please see
31+
temperature. For all of the measurements available please see
3232
https://aqs.epa.gov/aqsweb/airdata/download_files.html
3333

3434
.. code-block:: python

docs/tutorial/fv3chem_tutorial.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ distinguish aerosols which these readers do not process well.
6969

7070
fv3grib2nc4.py like nemsio2nc4.py tool is a command line tool created to
7171
convert the grib2 aerosol data to netcdf files. fv3grib2nc4.py will
72-
create seperate files for each of the three layer types; '1 hybrid
72+
create separate files for each of the three layer types; '1 hybrid
7373
layer', 'entire atmosphere', and 'surface'. These are the three layers
7474
that currently hold aerosol data. The tool is available at
7575
https://github.com/bbakernoaa/fv3grib2nc4
@@ -116,7 +116,7 @@ Using MONET
116116
Using MONET with FV3-Chem is much like using MONET with other model
117117
outputs. It tries to recognize where the files came from (nemsio, grib2,
118118
etc....) and then processes the data, renaming coordinates (lat lon to
119-
latitude and longitude) and processing varaibles like geopotential
119+
latitude and longitude) and processing variables like geopotential
120120
height and pressure if available. First lets import ``monet`` and
121121
``fv3chem`` from MONET
122122

@@ -190,8 +190,8 @@ To open a single file
190190
191191
192192
Notice this object f has dimensions of (time,z,y,x) with 2d coordinates
193-
of latitude and longitude. You can get more infomation on single
194-
varaibles such as pm25 simply by printing the varaible.
193+
of latitude and longitude. You can get more information on single
194+
variables such as pm25 simply by printing the variable.
195195

196196
.. code-block:: python
197197
@@ -220,7 +220,7 @@ Quick Map Plotting
220220
~~~~~~~~~~~~~~~~~~
221221

222222
Now one of the main things that will need to be done is plotting on a
223-
map. This can be done quickly using the functionallity in MONET. In this
223+
map. This can be done quickly using the functionality in MONET. In this
224224
example we will plot the first layer PM2.5 at time 2018-07-01.
225225

226226
.. code-block:: python
@@ -277,7 +277,7 @@ set a minimum of 0 AOD and maximum of 0.5.
277277

278278

279279
Now we have all the control that xarray has built into their plotting
280-
routines. For example, lets have a descrete colorbar with 10 levels,
280+
routines. For example, lets have a discrete colorbar with 10 levels,
281281
``levels=10``, and let it determine the levels by throwing out the top
282282
and bottom 2% of values using the ``robust=True``
283283

docs/tutorial/improve_trends_kmeans.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data.
3636
‘,’ by default)
3737

3838
After downloading we can then read the data. Here we included the
39-
EPACode and State to add additional meta data stored on the EPA auxilary
39+
EPACode and State to add additional meta data stored on the EPA auxiliary
4040
files used in the EPA AQS and AirNow datasets in MONET. Let’s make a few
4141
imports from monet and some other libraries that will aid us later.
4242

docs/tutorial/loading.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AirNow is the near realtime dataset for air composition and meteorology measurem
2323

2424
"The U.S. EPA AirNow program is the national repository of real time air quality data and forecasts for the United States. AirNow is the vehicle for providing timely Air Quality Index (AQI) information to the public, media outlets, other federal agencies and their applications, and to the research community. The system is managed by the U.S. EPA’s Office of Air Quality Planning and Standards Outreach and Information Division, Information Transfer Group in Research Triangle Park (RTP), North Carolina. AirNow is currently hosted and operated at a contractor facility, known as the AirNow Data Management Center (DMC), which currently resides outside of RTP." - https://www.airnow.gov/index.cfm?action=ani.airnowUS
2525

26-
AirNow_ data can be dowloaded from the Amazon S3 server and aggregated using the
26+
AirNow_ data can be downloaded from the Amazon S3 server and aggregated using the
2727
monet.obs.airnow class. For example,lets say that we want to look at data from
2828
2018-05-01 to 2018-05-05.
2929

@@ -46,7 +46,7 @@ This provides a structured :py:class:`~pandas.DataFrame`.
4646
4747
df.head()
4848
49-
Some users may want to keep a local copy of the data and not have to retrive the data
49+
Some users may want to keep a local copy of the data and not have to retrieve the data
5050
each time they want to access the data. There is a simple kwarg that can be used to
5151
download the data, *download=True*. By default, *download* is set to False.
5252

@@ -93,8 +93,8 @@ MONET is able to use the EPA AQS data that is collected and reported on an hourl
9393
prepare reports for Congress as mandated by the Clean Air Act." - https://www.epa.gov/aqs
9494

9595
We will begin by loading hourly ozone concentrations from 2018. The EPA AQS data
96-
is seperated into yearly files and seperate files for hourly and daily data. The
97-
files are also seperated by which variable is measured. For instance, hourly ozone files
96+
is separated into yearly files and separate files for hourly and daily data. The
97+
files are also separated by which variable is measured. For instance, hourly ozone files
9898
for the entire year of 2018 are found in https://aqs.epa.gov/aqsweb/airdata/hourly_44201_2018.zip.
9999
We will first load a single variable and then add multiple later on.
100100

@@ -146,12 +146,12 @@ Let's load variables PM10 and OZONE using hourly data to get an idea of how to g
146146
147147
df = aqs.add_data(dates, param=['OZONE','PM10'])
148148
149-
Loading Specfic Network
150-
^^^^^^^^^^^^^^^^^^^^^^^
149+
Loading Specific Network
150+
^^^^^^^^^^^^^^^^^^^^^^^^
151151

152152
Sometimes you may want to load a specific network that is available in the AQS data
153153
files. For instance, lets load data from the Chemical Speciation Network (CSN; https://www3.epa.gov/ttnamti1/speciepg.html).
154-
As of writting this tutorial we will load the 2017 data as it is complete.
154+
As of writing this tutorial we will load the 2017 data as it is complete.
155155

156156
.. code:: python
157157
@@ -175,7 +175,7 @@ AERONET
175175

176176
"The AERONET (AErosol RObotic NETwork) project is a federation of ground-based
177177
remote sensing aerosol networks established by NASA and PHOTONS (PHOtométrie pour le Traitement Opérationnel de Normalisation Satellitaire; Univ. of Lille 1, CNES, and CNRS-INSU)
178-
and is greatly expanded by networks (e.g., RIMA, AeroSpan, AEROCAN, and CARSNET) and collaborators from national agencies, institutes, universities, individual scientists, and partners. Fo more than 25 years, the project has provided long-term, continuous and readily accessible public domain database of aerosol optical, microphysical and radiative properties for aerosol research and characterization, validation of satellite retrievals, and synergism with other databases. The network imposes standardization of instruments, calibration, processing and distribution.
178+
and is greatly expanded by networks (e.g., RIMA, AeroSpan, AEROCAN, and CARSNET) and collaborators from national agencies, institutes, universities, individual scientists, and partners. For more than 25 years, the project has provided long-term, continuous and readily accessible public domain database of aerosol optical, microphysical and radiative properties for aerosol research and characterization, validation of satellite retrievals, and synergism with other databases. The network imposes standardization of instruments, calibration, processing and distribution.
179179

180180
AERONET collaboration provides globally distributed observations of spectral aerosol optical depth (AOD), inversion products, and precipitable water in diverse aerosol regimes. Version 3 AOD data are computed for three data quality levels: Level 1.0 (unscreened), Level 1.5 (cloud-screened and quality controlled), and Level 2.0 (quality-assured). Inversions, precipitable water, and other AOD-dependent products are derived from these levels and may implement additional quality checks. " -https://aeronet.gsfc.nasa.gov
181181

@@ -206,7 +206,7 @@ Available Measurements
206206
:widths: 20, 20
207207

208208
"SIZ", "Size distribution"
209-
"RIN", "Refractive indicies (real and imaginary)"
209+
"RIN", "Refractive indices (real and imaginary)"
210210
"CAD", "Coincident AOT data with almucantar retrieval"
211211
"VOL", "Volume concentration, volume mean radius, effective radius and standard deviation"
212212
"TAB", "AOT absorption"
@@ -216,7 +216,7 @@ Available Measurements
216216
"FRC", "Radiative Forcing"
217217
"LID", "Lidar and Depolarization Ratios"
218218
"FLX", "Spectral flux"
219-
"ALL", "All of the above retrievals (SIZ to FLUX) in one file"
219+
"ALL", "All of the above retrievals (SIZ to FLX) in one file"
220220
"PFN*", "Phase function (available for only all points data format: AVG=10)"
221221

222222
Loading AOD and SDA

monet/met_funcs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def calc_Psi_H(zoL):
467467
Returns
468468
-------
469469
Psi_H : float
470-
adiabatic corrector factor fof heat transport (unitless).
470+
adiabatic corrector factor for heat transport (unitless).
471471
472472
References
473473
----------
@@ -479,7 +479,7 @@ def calc_Psi_H(zoL):
479479
zoL = np.asarray(zoL)
480480
Psi_H = np.zeros(zoL.shape)
481481

482-
# for stable and netural (zoL = 0 -> Psi_H = 0) conditions
482+
# for stable and neutral (zoL = 0 -> Psi_H = 0) conditions
483483
i = zoL >= 0.0
484484
a = 6.1
485485
b = 2.5
@@ -507,7 +507,7 @@ def calc_Psi_M(zoL):
507507
Returns
508508
-------
509509
Psi_M : float
510-
adiabatic corrector factor fof momentum transport (unitless).
510+
adiabatic corrector factor for momentum transport (unitless).
511511
512512
References
513513
----------
@@ -519,7 +519,7 @@ def calc_Psi_M(zoL):
519519
zoL = np.asarray(zoL)
520520

521521
Psi_M = np.zeros(zoL.shape)
522-
# for stable and netural (zoL = 0 -> Psi_M = 0) conditions
522+
# for stable and neutral (zoL = 0 -> Psi_M = 0) conditions
523523
i = zoL >= 0.0
524524
a = 6.1
525525
b = 2.5
@@ -608,7 +608,7 @@ def calc_u_star(u, z_u, L, d_0, z_0M):
608608
Cambridge: Cambridge University Press.
609609
"""
610610

611-
# Covert input scalars to numpy arrays
611+
# Convert input scalars to numpy arrays
612612
u, z_u, L, d_0, z_0M = map(np.asarray, (u, z_u, L, d_0, z_0M))
613613

614614
# calculate correction factors in other conditions

monet/monet_accessor.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def interp_constant_lon(self, lon=None, **kwargs):
835835
return _rename_latlon(out)
836836

837837
def nearest_ij(self, lat=None, lon=None, **kwargs):
838-
"""Uses pyresample to intepolate to find the i, j index of grid with respect to the given lat lon.
838+
"""Uses pyresample to interpolate to find the i, j index of grid with respect to the given lat lon.
839839
840840
Parameters
841841
----------
@@ -879,7 +879,7 @@ def nearest_ij(self, lat=None, lon=None, **kwargs):
879879
return x, y
880880

881881
def nearest_latlon(self, lat=None, lon=None, cleanup=True, esmf=False, **kwargs):
882-
"""Uses xesmf to intepolate to a given latitude and longitude. Note
882+
"""Uses xesmf to interpolate to a given latitude and longitude. Note
883883
that the conservative method is not available.
884884
885885
Parameters
@@ -1136,20 +1136,20 @@ def _tight_layout(self):
11361136

11371137
subplots_adjust(0, 0, 1, 1)
11381138

1139-
def _check_swath_def(self, defin):
1139+
def _check_swath_def(self, defn):
11401140
"""checks if it is a pyresample SwathDefinition or AreaDefinition.
11411141
11421142
Parameters
11431143
----------
1144-
defin : type
1144+
defn : pyresample.geometry.SwathDefinition or pyresample.geometry.AreaDefinition
11451145
11461146
Returns
11471147
-------
1148-
type
1148+
bool
11491149
"""
11501150
from pyresample.geometry import SwathDefinition
11511151

1152-
if isinstance(defin, SwathDefinition):
1152+
if isinstance(defn, SwathDefinition):
11531153
return True
11541154
else:
11551155
return False
@@ -1159,8 +1159,7 @@ def _get_CoordinateDefinition(self, data=None):
11591159
11601160
Returns
11611161
-------
1162-
pyreseample.geometry.CoordinateDefinition
1163-
1162+
pyresample.geometry.CoordinateDefinition
11641163
"""
11651164
from pyresample import geometry as geo
11661165

@@ -1473,7 +1472,7 @@ def _get_CoordinateDefinition(self, data=None):
14731472
14741473
Returns
14751474
-------
1476-
pyreseample.geometry.CoordinateDefinition
1475+
pyresample.geometry.CoordinateDefinition
14771476
"""
14781477
from pyresample import geometry as geo
14791478

@@ -1622,7 +1621,7 @@ def remap_nearest_unstructured(self, data):
16221621
return result
16231622

16241623
def nearest_ij(self, lat=None, lon=None, **kwargs):
1625-
"""Uses pyresample to intepolate to find the i, j index of grid with respect to the given lat lon.
1624+
"""Uses pyresample to interpolate to find the i, j index of grid with respect to the given lat lon.
16261625
16271626
Parameters
16281627
----------
@@ -1664,7 +1663,7 @@ def nearest_ij(self, lat=None, lon=None, **kwargs):
16641663
return x, y
16651664

16661665
def nearest_latlon(self, lat=None, lon=None, cleanup=True, esmf=False, **kwargs):
1667-
"""Uses xesmf to intepolate to a given latitude and longitude. Note
1666+
"""Uses xesmf to interpolate to a given latitude and longitude. Note
16681667
that the conservative method is not available.
16691668
16701669
Parameters

0 commit comments

Comments
 (0)