Skip to content

Commit

Permalink
finalised changes to convertflirVID to fix piping errors on windows m…
Browse files Browse the repository at this point in the history
…achines
  • Loading branch information
gtatters committed Nov 28, 2019
1 parent 0eaf481 commit 928c456
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions R/convertflirVID.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ convertflirVID<-function(imagefile, exiftoolpath="installed", perlpath="installe
if(verbose==TRUE) cat("\n\nthermalvid.raw file has been split into jpegls files in temp folder. \n")

# If CSQ files to be converted into png or avi:
if(verbose==TRUE) cat("\n\nConvert files with call to ffmpeg using:\n\n")
if(verbose==TRUE) cat("\n\nConvert files with ffmpeg using:\n\n")
ffmpegcall(filenameroot="temp/frame", filenamesuffix="%05d", filenameext="jpegls", incompresstype="jpegls", fr=fr, res.in=res.in, res.out=res.out,
outputcompresstype=outputcompresstype, outputfilenameroot=outputfilenameroot, outputfiletype=outputfiletype, outputfolder=outputfolder)
#
Expand All @@ -150,7 +150,7 @@ convertflirVID<-function(imagefile, exiftoolpath="installed", perlpath="installe
if(verbose==TRUE) cat("\n\nthermalvid.raw file has been split into tiff files in temp folder. \n")

# If SEQ files to be converted into png or avi:
if(verbose==TRUE) cat("\n\nConvert files with call to ffmpeg using:\n\n")
if(verbose==TRUE) cat("\n\nConvert files with ffmpeg using:\n\n")
ffmpegcall(filenameroot="temp/frame", filenamesuffix="%05d", filenameext="tiff", incompresstype="tiff", fr=fr, res.in=res.in, res.out=res.out,
outputcompresstype=outputcompresstype, outputfilenameroot=outputfilenameroot, outputfiletype=outputfiletype, outputfolder=outputfolder)

Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The version here on github is the current, development version. Archived source

# Current release notes

- 2019-11-26: Version 4.0.1 is on Github (development version) - trying to fix flawed ffmpeg call on windows machine. Need confirmation that this fixed issue [#8](https://github.com/gtatters/Thermimage/issues/8)
- 2019-11-26: Version 4.0.1 is on Github (development version) - fixed problems with system2 piping calls to ffmpeg on windows machines. See issue [#8](https://github.com/gtatters/Thermimage/issues/8). Added common perl script to package to facilitate splitting fff, tiff, jpegls filetypes. Minor changes to __convertflirVID()__ and __ffmpegcall()__ functions.



Expand Down
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ sources can be found:

# Current release notes

- 2019-11-26: Version 4.0.1 is on Github (development version) -
trying to fix flawed ffmpeg call on windows machine. Need
confirmation that this fixed issue
[\#8](https://github.com/gtatters/Thermimage/issues/8)
- 2019-11-26: Version 4.0.1 is on Github (development version) - fixed
problems with system2 piping calls to ffmpeg on windows machines.
See issue [\#8](https://github.com/gtatters/Thermimage/issues/8).
Added common perl script to package to facilitate splitting fff,
tiff, jpegls filetypes. Minor changes to **convertflirVID()** and
**ffmpegcall()** functions.

# Features

Expand Down Expand Up @@ -170,9 +172,9 @@ cbind(unlist(cams$Dates))
```

## [,1]
## FileModificationDateTime "2019-11-26 14:25:32"
## FileAccessDateTime "2019-11-26 14:54:34"
## FileInodeChangeDateTime "2019-11-26 14:25:34"
## FileModificationDateTime "2019-11-27 20:04:22"
## FileAccessDateTime "2019-11-27 20:06:42"
## FileInodeChangeDateTime "2019-11-27 20:04:24"
## ModifyDate "2013-05-09 16:22:23"
## CreateDate "2013-05-09 16:22:23"
## DateTimeOriginal "2013-05-09 22:22:23"
Expand Down Expand Up @@ -711,8 +713,6 @@ convertflirVID(f, exiftoolpath="installed", perlpath="installed",
##
## ffmpeg -r 30 -f image2 -vcodec jpegls -s 1024x768 -i 'temp/frame%05d.jpegls' -vcodec jpegls -s 1024x768 './output/SampleFLIRCSQ.csq.avi' -y

## [1] TRUE

Converted files are in an output subfolder

![Sample
Expand Down Expand Up @@ -839,12 +839,12 @@ head(d)
```

## Ta Ts Tg SE RH rho cloud A V L c n a
## 1 35.88910 41.82154 41.93718 499.8416 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 2 16.24406 24.18627 19.75659 290.2913 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 3 31.00881 34.93379 36.43372 448.3398 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 4 16.13722 19.28475 21.15027 414.3017 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 5 26.18323 30.90733 31.13449 409.1957 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 6 36.94496 42.32905 41.31751 361.3676 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 1 29.83508 34.71745 34.65431 398.2834 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 2 29.52257 34.47414 34.21054 387.4360 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 3 23.12197 28.53155 28.25916 424.5606 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 4 15.27961 21.02158 20.26957 412.3931 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 5 12.50621 19.44502 17.44626 408.2679 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 6 22.17507 28.76645 26.51623 358.7736 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## b m type shape
## 1 0.58 0.25 forced hcylinder
## 2 0.58 0.25 forced hcylinder
Expand Down Expand Up @@ -1087,25 +1087,25 @@ data frame. Using the dataframe, d we constructed
(qrad.A<-with(d, qrad(Ts, Ta, Tg, RH, E=0.96, rho, cloud, SE)))
```

## [1] 377.2824 171.8123 341.7213 314.2262 299.8818 250.9497 305.9210 309.1887
## [9] 264.1042 309.9676 350.3395 307.3023 295.3114 235.7704 272.3929 275.6230
## [17] 235.5016 335.3288 315.5704 269.9184
## [1] 288.6351 278.0294 310.3135 298.3135 288.6283 241.8984 286.7528 272.2267
## [9] 280.1279 310.5407 229.7514 302.6530 275.3711 309.0477 320.3752 309.0713
## [17] 253.3679 261.4201 337.5613 288.8128

``` r
(qconv.free.A<-with(d, qconv(Ts, Ta, V, L, c, n, a, b, m, type="free", shape)))
```

## [1] -25.08060 -36.42395 -14.99077 -11.45377 -18.93466 -22.20967 -19.24684
## [8] -16.54881 -11.71102 -34.62021 -16.74103 -23.07179 -19.90921 -22.87928
## [15] -19.44240 -12.91004 -20.58194 -20.11250 -19.12782 -12.22075
## [1] -19.70186 -20.05398 -22.45955 -24.29522 -30.83262 -28.76472 -24.80207
## [8] -25.97918 -21.05362 -22.76461 -17.03817 -20.31201 -26.52160 -16.86843
## [15] -29.63701 -17.51688 -14.67933 -24.85820 -21.45223 -22.99933

``` r
(qconv.forced.A<-with(d, qconv(Ts, Ta, V, L, c, n, a, b, m, type, shape)))
```

## [1] -59.84708 -81.92033 -39.79153 -32.46987 -48.14448 -54.25974 -49.59345
## [8] -43.74165 -32.90189 -78.03726 -43.77393 -57.11037 -49.98261 -56.69334
## [15] -49.15559 -35.65857 -52.10470 -51.03341 -48.79137 -34.13789
## [1] -49.55897 -50.27825 -55.32465 -59.30065 -71.92934 -67.48683 -60.10064
## [8] -62.32877 -51.79359 -55.63574 -44.16414 -51.23547 -62.96936 -44.07677
## [15] -69.39610 -45.44566 -39.15462 -59.96277 -52.99522 -56.18535

``` r
qtotal<-A*(qrad.A + qconv.forced.A) # Multiply by area to obtain heat exchange in Watts
Expand All @@ -1115,19 +1115,19 @@ head(d)
```

## Ta Ts Tg SE RH rho cloud A V L c n a
## 1 35.88910 41.82154 41.93718 499.8416 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 2 16.24406 24.18627 19.75659 290.2913 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 3 31.00881 34.93379 36.43372 448.3398 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 4 16.13722 19.28475 21.15027 414.3017 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 5 26.18323 30.90733 31.13449 409.1957 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 6 36.94496 42.32905 41.31751 361.3676 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 1 29.83508 34.71745 34.65431 398.2834 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 2 29.52257 34.47414 34.21054 387.4360 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 3 23.12197 28.53155 28.25916 424.5606 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 4 15.27961 21.02158 20.26957 412.3931 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 5 12.50621 19.44502 17.44626 408.2679 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## 6 22.17507 28.76645 26.51623 358.7736 0.5 0.1 0 0.4 1 0.1 0.174 0.618 1
## b m type shape qrad qconv qtotal
## 1 0.58 0.25 forced hcylinder 150.91295 -23.93883 126.97412
## 2 0.58 0.25 forced hcylinder 68.72494 -32.76813 35.95681
## 3 0.58 0.25 forced hcylinder 136.68851 -15.91661 120.77190
## 4 0.58 0.25 forced hcylinder 125.69049 -12.98795 112.70254
## 5 0.58 0.25 forced hcylinder 119.95271 -19.25779 100.69492
## 6 0.58 0.25 forced hcylinder 100.37988 -21.70390 78.67599
## 1 0.58 0.25 forced hcylinder 115.45406 -19.82359 95.63047
## 2 0.58 0.25 forced hcylinder 111.21178 -20.11130 91.10048
## 3 0.58 0.25 forced hcylinder 124.12542 -22.12986 101.99555
## 4 0.58 0.25 forced hcylinder 119.32539 -23.72026 95.60513
## 5 0.58 0.25 forced hcylinder 115.45132 -28.77174 86.67958
## 6 0.58 0.25 forced hcylinder 96.75937 -26.99473 69.76464

### Test the equations out for consistency

Expand Down

0 comments on commit 928c456

Please sign in to comment.