[Thread Prev][Thread Next][Index]

Re: No "DATE" field in ASCII table




Jerome King wrote:

Thanks Jon!

I have modified the insitu.pl file and I can now retrieve the "DATE" field.

However, it seems to only retrieve YYYY-MM-DD HH:00:00
Before I go change the code, I want to make sure this was designed this way on purpose of if I missed something somewhere and it should actually retrieve also MM:SS ?

I think the problem comes from this part of the code:

# Format and print the values to OUT
my @date_strings;
foreach my $hrs (@hours){
my $date = $t_origin_object->addDelta(0,0,0,$hrs,0,0);
my $date_string = $date->toFerretString;
if (length($date_string) < 12){
$date_string .= " 00:00:00";

I was thinking I would need to declare $min and $sec and write:
my $date = $t_origin_object->addDelta(0,0,0,$hrs,$min,$sec);


Thanks for your help!
Jerome.

Jerome,

You'll have to look at the version of insitu.pl that you're using. You can find the version at the top of the file.. Version 1.9 correctly adds minutes and seconds with the following code:

# Format and print the values to OUT
my @date_strings;
foreach my $hrs (@hours){
my $dec_mins = $hrs - int($hrs);
my $mins = int($dec_mins * 60);
my $dec_secs = ($dec_mins * 60) - $mins;
my $secs = int($dec_secs * 60);
my $date = $t_origin_object->addDelta(0,0,0,$hrs,$mins,$secs);
my $date_string = $date->toFerretString;
if (length($date_string) < 12){
$date_string .= " 00:00:00";
}
push(@date_strings,$date_string);
}


All the things you've been correcting should be in the next release of LAS due out in beta next week (God willing!).


-- Jon


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement