hapi-server / uri-templates

Repository of tools for URI templates
Apache License 2.0
2 stars 0 forks source link

How to describe Plasma Wave Group's 100-day directories #11

Open jbfaden opened 2 years ago

jbfaden commented 2 years ago

The Radio and Plasma Wave Group at the University of Iowa likes to put files in 100-day directories:

https://pds-ppi.igpp.ucla.edu/data/CO-V_E_J_S_SS-RPWS-4-SUMM-KEY60S-V1.0/DATA/KEY_PARAMS/
https://pds-ppi.igpp.ucla.edu/data/CO-V_E_J_S_SS-RPWS-4-SUMM-KEY60S-V1.0/DATA/KEY_PARAMS/T$Y$x/RPWS_KEY__$Y$j_0.TAB

meaning any files from for year 2000 day of year 200-266 are to be found in T20002XX/. Presently you are forced to use $x, which will result in the unnecessary listing of three out of four directories.

Also there are 4-month blocks of data. I think this can be described:

https://space.physics.uiowa.edu/voyager/data/VGPW_0101/DATA/FULL1/T0005_08/ could be
https://space.physics.uiowa.edu/voyager/data/VGPW_0101/DATA/FULL1/T$y$(m)_$(m,delta=4)
jbfaden commented 10 months ago

This might be better: https://space.physics.uiowa.edu/voyager/data/VGPW_0101/DATA/FULL1/T$y$(m)_$(m;end;delta=1)

jbfaden commented 2 weeks ago

I made an Autoplot script to be used with the AutoplotServlet which demos where 2XX cannot be formatted:

https://cottagesystems.com/AutoplotServlet/ScriptGUIServlet?date=2005-10-11T19%3A00%3A00.000Z&format=%2Fproject%2Fcassini%2Fpds4%2Fcassini-rpws-wideband%2FT%24Y%24jXX%2FT%24Y%24j%2F&script=https%3A%2F%2Fgithub.com%2Fautoplot%2Fdev%2Fblob%2Fmaster%2Fdemos%2Ftools%2Fcalculators%2Fday_of_year.jy

The files for Cassini Wideband are split into 100-day folders: /project/cassini/pds4/cassini-rpws-wideband/T$Y$(j)XX/T$Y$j/ The $(j)XX would be 2XX for day 245.

jbfaden commented 1 week ago

I was thinking about doyinterval, to match hrinterval:

https://.../KEY_PARAMS/T$Y$(doyinterval;values=0,1,2,3;duration=100)/RPWS_KEY__$Y$j_0.TAB

I think that might be confusing, though, and it's bulky. Maybe:

https://.../KEY_PARAMS/T$Y$(j;div=100)XX/RPWS_KEY__$Y$j_0.TAB

and then div could be used with years as well.

Last to consider would be making some tag which is more specialized, but then doesn't clutter things that are working well already:

https://.../KEY_PARAMS/T$Y$(jdiv100)XX/RPWS_KEY__$Y$j_0.TAB

jbfaden commented 1 week ago

Another use for the div modifier would be with $N (nanoseconds, which is allocated but not yet allowed):

$Y$m$dT$H:$M:$S.$(N;div=1000)

would correctly describe microseconds.

jbfaden commented 1 week ago

If there's a new "div" modifier, then we also need to consider its effect on implicit lengths.

jbfaden commented 1 week ago

I put together an implementation (and prematurely updated the documentation in excitement) for a need last week and this is committed. I studied its consistency with other modifiers and I can see that shift and div might be different. I believe the direction you are "shifting" by is positive in the parse direction "2000-01-01" parsed with shift 1 is 2000-01-02, but the examples and documentation seem inconsistent when I read it today. See https://github.com/hapi-server/uri-templates/wiki/Specification#time-range-rules

jbfaden commented 1 week ago

See https://github.com/hapi-server/uri-templates/issues/30 about this shift inconsistency.

jbfaden commented 1 week ago

I went ahead and put in $N, since it is trivial to implement and is useful for documentation, and potentially with "div".