Skip to content

Handle timestamp HHMMSS using processqueue.py -p #96

@dnadeau-lanl

Description

@dnadeau-lanl

Use more than daily date for processing hourly files. Some files are received every hour, and are discarded from the process queue script and only the newest file is being procesed.

Relation to an issue

#38

Proposed enhancement

Process file within a day.

For example the following files are not correctly processed by dbprocessing.
The inspector extract the Day-of-Year (288) and convert into date for unixtime. Even if we pass the HHMMSS to unix_start_time and unix_stop_time they are discarded when running the process queue script to start processing.

 STP6_2020288230002_SENH_VC34.0
 STP6_2020288220002_SENH_VC34.0
 STP6_2020288210002_SENH_VC34.0

When running processqueue.py -p we get the following message and only the last file is retain.

https://github.com/spacepy/dbprocessing/blob/master/dbprocessing/dbprocessing.py#L368

  • Was not newest version in buildChildren

Proposed code

https://github.com/spacepy/dbprocessing/blob/master/dbprocessing/DButils.py#L683

dates = [file.utc_start_time, file.utc_stop_time]
latest = self.getFilesByProductTime(product_id, dates, newest_version=True)

https://github.com/spacepy/dbprocessing/blob/master/dbprocessing/dbprocessing.py#L296-L301

start_time = sq.utc_start_time
stop_time = sq.utc_stop_time

https://github.com/spacepy/dbprocessing/blob/master/dbprocessing/runMe.py#L294-L295
Comment out thise lines

#if isinstance(utc_file_date, datetime.datetime):
#    utc_file_date = utc_file_date.date()

Alternatives

They are currently no alternatives.

I tried using "RUN", "FILE" as output_timebase instead of "DAILY". Using the changes above, I am currently processing using output_timebase="FILE". I would like to use output_timebase="RUN" with no output_product.

OS, Python version, and dependency version information:

Version of dbprocessing

spacepy/master branch

Closure condition

This issue should be closed when:

  1. code can handle to files with same date but different timestamp (HHMMSS)
  2. tests are written and updated to handle these cases. Test will fail since they check only date in the format YYY-MM-DD without checking the timestamp (HHMMSS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or feature requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions