Ticket #282 (assigned Enhancement: null)

Opened 5 years ago

Last modified 4 years ago

Update Date Formatting Help with Python Examples in Functions Like "Sample Rasters by Field"

Reported by: bbest Owned by: jjr8
Priority: Low Milestone: Unscheduled
Component: Documentation Version:
Keywords: Cc:

Description

Because Python is much easier and more dynamic to format for date-time strings, especially with zero padding using C sprintf style, over Visual Basic, some useful examples might be shown for comparison in Sampling time series rasters and  MGET Sample Rasters Listed in Fields. For example, assuming t is a date field:

  • Python:
    "C:/MyFolder/sst_%d%00d" % (t[0],  t[7])
    
  • Visual Basic:
    "C:/MyFolder/sst_" & Cstr(DatePart("yyyy", t)) & Right("00" & Cstr(DatePart("y", t)), 3)
    

See  Python module time documentation for the indexing of the date object for year(0), month(1), day(2), hour(3), minute (4), second(5), weekday(6), julian day(7).

Change History

Changed 5 years ago by jjr8

  • priority changed from Medium to Low
  • status changed from new to assigned
  • milestone set to 0.7

I will update this example after MGET 0.6 is released.

Changed 4 years ago by jjr8

  • milestone changed from 0.7 to Unscheduled

Postponing to Unscheduled milestone. We will revisit this when next revisit the goals of upcoming releases.

In MGET 0.8, I hope to rewrite the sampling tools completely. That may obviate the need for these examples; I hope to build the Sample Time Series Rasters tool.

Note: See TracTickets for help on using tickets.