Skip to content

Commit

Permalink
primarily added date1 and date2 to daily_avg and subdaily
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinemlarson committed Dec 4, 2024
1 parent ea85276 commit c696ba2
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 145 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
env
gnss/*
rise_set_tracks.py
developer_notes.md
new.pyproject.toml
meson.build
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


added date1 and date2 as optional inputs to subdaily. These can be used instead of the doy1, doy2,
and year_end inputs.
## 3.10.6
December 3, 2024

added link to Fagundes et al.
I added date1 and date2 as optional inputs to subdaily. These can be used instead of the doy1, doy2,
and year_end inputs. for now both kinds are allowed though I will likely change that at some point.

I added date1 and date2 to daily_avg. You can narrow your use of data. It set to correct values (i.e. it
is truly a date in yyyymmdd format), it will override any -year1 and -year2 values.

## 3.10.5

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gnssrefl v3.10.5
# gnssrefl v3.10.6

gnssrefl is an open source software package for GNSS Interferometric Reflectometry (GNSS-IR).
When showing results created using gnssrefl, please use:
Expand All @@ -18,6 +18,9 @@ gnssrefl also has a DOI from zenodo.

The latest pypi version can be found here [![PyPI Version](https://img.shields.io/pypi/v/gnssrefl.svg)](https://pypi.python.org/pypi/gnssrefl)

Latest Feature - you can set beginning and end dates in <code>daily_avg</code> and <code>subdaily</code>. The parameters are
called date1 and date2. See the descriptions of these modules in the usual place.

Questions and bug reports for gnssrefl (but not the notebooks) **must** be submitted via the **Issues** button at
the [github repository](https://github.com/kristinemlarson/gnssrefl/issues). The notebooks were created by Earthscope
with NASA funding. I formally asked Earthscope about maintenance of the notebooks and received the following response from them:
Expand Down
130 changes: 0 additions & 130 deletions docs/pages/community.md

This file was deleted.

49 changes: 46 additions & 3 deletions gnssrefl/daily_avg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def fbias_daily_avg(station):


def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat,
howBig,ReqTracks,azim1,azim2,test,subdir,plot_limits):
howBig,ReqTracks,azim1,azim2,test,subdir,plot_limits,**kwargs):
"""
worker code for daily_avg_cl.py
Expand All @@ -114,10 +114,10 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat,
extension : str
folder extension - usually empty string
year1 : integer
year1 : int
first year
year2 : integer
year2 : int
last year
fr : integer
Expand Down Expand Up @@ -162,6 +162,27 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat,
observation times
"""
date1 = kwargs.get('date1',None)
date2 = kwargs.get('date2',None)
mjd1=None
mjd2=None
if date1 is not None:
try:
m = int(date1[4:6])
d = int(date1[6:8])
mjd1,duh = g.mjd(year1,m,d,0,0,0)
except:
date1 = None # illegal input
if date2 is not None:
try:
m = int(date2[4:6])
d = int(date2[6:8])
mjd2,duh = g.mjd(year2,m,d,0,0,0)
mjd2=mjd2 + 1
except:
# illegal input
date2 = None

print('Median Filter', howBig, ' Required number of tracks/day ', ReqTracks)
xdir = os.environ['REFL_CODE']
print('All RH retrievals - including bad ones - will be written to: ' )
Expand Down Expand Up @@ -211,8 +232,30 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat,
for f in all_files:
fname = direc + f
L = len(f)
keep_this_one1 = True
keep_this_one2 = True
# file names must have 7 characters in them ... and end in txt for that matter
if (L == 7):
mjd = g.ydoy2mjd(yr,int(f[0:3]))
if mjd1 is not None:
if (mjd >= mjd1):
keep_this_one1 = True
else:
keep_this_one1 = False
if mjd2 is not None:
if (mjd <= mjd2):
keep_this_one2 = True
else:
keep_this_one2 = False
if keep_this_one1 & keep_this_one2:
keepit = True
else:
keepit = False

#if not keepit:
# print('thrown out because it was not between your dates',f)

if (L == 7) & keepit:
NumFiles += 1
# check that it is a file and not a directory and that it has something/anything in it
try:
Expand Down
Loading

0 comments on commit c696ba2

Please sign in to comment.