;MeteorGIS is a free program for extracting images from the ones decoded by M2_LRPT_Decoder and create projected ones with the ability to add shapes on them.
;It is written in C# and use the Framework 4.5.
;version 1.31 (c) May 2016- August 2019 by Christophe MARCHAND "ZeTof" - http://www.zetofzone.com/. You can contact me at zetofzone@gmail.com but I don't have much time....
;This program use a free library for parsing shape files : Easy GIS .NET Desktop Edition from http://www.easygisdotnet.com/Products.aspx under LGPL license.
;Read carrefully the explanations in this file to understand how it works. I made my possible to be clear.
;You need a file "SGP4.dll" in the M2_LRPT_Decoder folder in order to proceed georeferencing.
;
;For automatic mode (default) put this line with the right path to this program in the "Tracking DDE Client" of SDRSharp. Must replace your actual line who launch M2_LRPT_Decoder.
;start_programm_Path<C:\Meteor\MeteorGIS\MeteorGIS.exe>
;
;Known bugs :
;	-Some imperfections in the composition images where the images are superposing. (I apply a soft transition between images and coul'nt find what's wrong...!)
;	-If you are at high latitudes (+/-) Could have some imperfections in the Northest (or Southest) part of the image in LatLon projection.
;	-I did'nt implemented all the verifications of the validity of the options contained in the Shapes categories of this ini file, so if there is a problem somewhere (a bad character or if you put alphabetical in place of number) the program will crash.
;			In this case reset it by deleting this file.
;
;As I could'nt try it for Southern hemisphere nor Western Longitude, please report any bug in my mail with the .jpg & the .jpg.gcp files from M2_LRPT-Decoder.
;
;From version 1.05 you have the possibility to have one ini file for each type of passe for settings the shapes.
;Their names must be (case sensitive) : IR.ini, RGB.ini, thermal.ini, RGBrainfall.ini & IRrainfall.ini. If they are not found, this one is used.
;
;In addition to this ini file, there are some command lines options :
;If you use it in automatic mode with SDRSharp & the plugin Meteor Demodulator, you normaly don't have to specify any option.
;"/nolive"		By default MeteorGIS will work in automatic mode. It can launch the decoder (M2_LRPT_Decoder.exe) after creating the right ini file for it.
;				If you specify this option, you have to make it by yourself, or for treat some old images.
;				If you didn't use this option (mean automatic mode) take care to not specify an input file (but folder instead)
;"/notle"		If you specify this option, the program will not try to download lastest avaible TLE. (Don't use unless you want to treat old .s file.)
;"/input:"		Specify an input file for treat it. Could be a folder, in this case it will search for the last file in this folder AND subfolders. Override the option below in the "Program" section.
;				File specified could be a jpg, a bmp (in this case give one of the 3 channels bmp name) or a .s file (Read the "About_.s.txt"). Jpg images are NOT post-treated (see "Treatment" section below).
;				Of course, you must have the .gcp file in relation with it (apart for .s file - it will be generated).
;"/outdir:"		Specify the output folder for treated files. If not exist, will be created. Override the option below in the "Program" section.
;				Take care as if you put the folder embraced in quotes (") for example if the path contain space, to NOT PUT a \ at the end !!!
;"/type:"		The type(s) of image(s) generated. Override the option below in the "Program" section.
;"/proj:"		The type of the projection (UTM or LatLon). Override the option below in the "Program" section.
;"/config:"		Specify an other ini file if you want to keep differents configuration. File must be in this program folder.
;"/compose:"	Specify one or more image(s) to be composed with the input one. Must be the entire path to the image(s).
;				If you specify more than one file separate them by a coma. (There is a maximum of 3 passes of Meteor in the same point, and this 2 times a day. So you normaly don't have to put more than 2 files here).
;"/composeauto"	The program will create all image(s) specified or found in input (only if doesn't yet exist) plus a composition of all passes within +/- 4 hours of the one specified as input (or last one if a folder is specified).
;				This option is used only if you use the /nolive option (manual mode). In case of live reception, this option is allways set.
;
;This is the default ini file for MeteorGIS.
;
;If for some reasons this program doesn't work anymore, try to delete this file, it will be regenerated.
;Notes :
;	This program ask M2_LRPT_Decoder to save files as BMP (one for each channel). So in time this is space consumming...
;	Color use the HTML format whithout the "#". You can find colors at http://www.colorpicker.com/
;	You can find totally free shapes at http://www.naturalearthdata.com/downloads/ The ones given with this program come from here.(You need 3 files for each shape : the .shp, .dbf & .shx)
;	Don't change anything at the left of the "=" signs !!!
;
;
;Here are the Program generals options :
[Program]
;	Default input directory. Could be overrided by the command line option "/input:".
;	You can specify a file with the command line option. If no file specified, the last created in this directory will be used.
;	Note : It will search the last(s) file(s) in this directory AND all it's subfolders.
;	Take care for automatic mode (live) that it should be the same or parent of the folder "pathToSaveDecodedImages" specified below in the "M2_LRPT_Decoder" section.
;	Must finish by a \
	inputDir=C:\Meteor\images\
;	Default output directory. Could be overrided by the command line option "/outdir:".
;	If empty, input directory will be used. It will be the one where it find the input file (as it search subfolders).
;	If specified must finish by a \
	outputDir=
;	Wich type of projection would you like ? UTM/LatLon
;	Could be overrided by the command line option "/proj:".
	projection=UTM
;	By default, wich kind of images would you like to proceed ? Could be overrided by the command line option "/type:".
;	Should be one or more of the following : Separate them by a coma. Please do not put space anywhere.
;	rgb, ir, thermal, ir_rain, rgb_rain
	defaultImageTypes=rgb,ir,thermal,ir_rain,rgb_rain
;	Do you want to generate thumbnail image ? yes/no
	generateThumbnail=yes
;	If yes, wich width in pixels ?
	thumbnailSize=300
;	Folder where to put thumbnails ?
;	If empty will use the same as the final image. (Note : Must exist, else will use the same as the final image)
	thumbnailDir=
;	Would you like the final image in jpg or bmp ? Bmp could create images more than 100Mb in composition !
;	Note : if you use a jpg file as input, this will always use jpg as output.
	saveType=jpg
;	If jpg above, jpg save quality for the final image : (0=>100) Big number is hungry in space !
	jpgQuality=50
;	Minimum height of the received image to be treated (in pixels). If the received image is less than this number, will skip this image.
	minimumHeight=1000
;	Put here the palette file for the thermal image. Image must be 255 pixels wide and at least 20 pixels high. Coldest left.
	thermalCLUT=CLUT.png
;	Put here the palette file for the rain image. Image must be 255 pixels wide and at least 20 pixels high. Rainiest left.
	rainCLUT=RAIN.png
;	Would you like to add a watermark on the final(s) image(s) ? yes/no
	watermark=yes
;	If yes, where to put it ?
;	This could be one of the following :
;	bottom_centered
;	top_centered
;	bottom_left
;	bottom_right
;	top_left
;	top_right
	watermarkPlace=top_centered
;	Color and size of the watermak :
	watermarkColor=AD880C
	watermarkSize=100
;	Watermark text could be placed here or placed on an external file (as this it could be generated from a batch program for example).
;	From a file ? yes/no
	watermarkFromFile=no
;	Put here either the text or the file name :
;	If you put the text here, there are severals options (This work for a file too) :
;		\r\n			new line.
;		%dtl%			date & time your local time.
;		%dtu%			date & time UTC.
;		%type%			type of the pass(RGB,IR,...).
	watermarkFileOrText=ZeTof\r\nMeteor M2 %type% %dtu% UTC
;	Would you like to draw a cross at your location ? yes/no
	drawLocation=yes
;	If yes, where ? : (of course could be negative)
	locationLatitude=33.2
	locationLongitude=130.4
;	Color, size and thickness of the cross :
	locationColor=CC3030
	locationSize=30
	locationThickness=6
;	Would you like to add a scale for the temperature in the thermal final images ? yes/no
	thermalScale=yes
;	If yes, from wich file ?
	thermalFile=therm_pal.jpg
;	Where to put it ?
;	This could be one of the following :
;	bottom_centered
;	top_centered
;	bottom_left
;	bottom_right
;	top_left
;	top_right
;	right_centered		As this you could put vertical image.
;	left_centered		As this you could put vertical image.
	thermalPlace=bottom_centered
;	Enable Logs ? (Not really interesting, but could help to find problems). If yes, think to delete them sometimes....
	logs=yes
;
;
;Here are the options for M2_LRPT_Decoder :
[M2_LRPT_Decoder]
;	Path to M2_LRPT_Decoder.exe :
;	Must finish by a \
	pathToM2_LRPT_Decoder=C:\Meteor\
;	Were to find the latest TLE for Meteor M2 :
;	Note the file must contain ONLY the Meteor M2 TLE.
;	The one given as default is from my friend Thibaut "Fouine". Thanks to him..
;	For Meteor M2
	tleURL=http://tle.radiofouine.net/Meteor-M2.php
;	For Meteor M2-2
;	tleURL=http://tle.radiofouine.net/Meteor-M2_2.php
;	LRPT logs option. Should be yes or no
	LRPTlog=no
;	mode option. Could be auto
	mode=auto
;	APID70 option. Should be yes or no
	APID70=yes
;	VCDU option. Should be yes or no
	VCDU=yes
;	Path were to save extracted images. Should be the same as "inputDir" of the "Program" options, or one of its subfolder.
;	Must finish by a \
	pathToSaveDecodedImages=C:\Meteor\images\M2\
	pathToSaveDecodedImagesM22=C:\Meteor\images\M22\r
;	Would you like to create subFolders in the above directory with the year and the month.
;	Mean will create a subfolder with the year, and another one with the month inside the year one.
	createDateIndexedFolder=yes
;	Path to Amigo SharedFolder : (Don't know if this is needed...)
;	Must finish by a \
	pathToAmigoSharedFolder=C:\Meteor\AMIGO\ShareFolder\
;	Your Amigo ID :
;	If you let it blank, it will try to retrieve the last used.
	AmigoID=
;	Options for the [GEO] part of M2_LRPT_Decoder.ini
;	Alpha is the camera angle & Delta is the shift along the line. For Delta, change of 1 represent 1km
	Alfa_M2=110.8
	Delta_M2=32
	Alfa_M22=110.0
	Delta_M22=-4.8
;	Tricky : Would you like to use the UTC time or the Meteor M2 onboard clock (UTC+3) for generating the dateStamp in the M2_LRPT_Processor.ini file ?
;	Nobody know (apart the developer of the M2_LRPT_Processor program) and you must do tests !!
;	I suggest to use "yes". But if you find a pass where UTC time is near 0h00 and the georeferencing of the image is bad, switch this option !
;	It will be used for the switching of the 123/125 days passes too.
	useMeteorTime=yes
;	Which type of pass ?
;	Meteor M2 is 123 and for now Meteor M2-2 is 456
	channels=123

;
;
;Here are the image treatments options :
;NOTE : THERE WILL BE NO TREATMENT AT ALL IF YOU USE A jpg FILE AS INPUT FILE !! USE bmp FILES IF YOU WANT TREATMENTS !!
[Treatment]
;	Treatment of the color lines : maximum height of the iteration to fill the inexistant lines : (one line represent 8px in height). THIS IS TIME CONSUMING !
;	For filling color hole, I take the nearest value of the inexistant color, and by comparaison with other colors, I could retrieve the missed color.
;	Farest we go, less is the reliability of the calcul.
;	As the algorithm is pretty good, this is always applied. If you really don't want it, put 0.
	maxIterationColorLines=5
;	Would you like to fill black lines in the image ? This is a little tricky and in some case could provoke strange result. yes/no
	fillBlackLines=yes
;	If yes : maximum height of the hole who will be filled : (one black line represent 8px in height)
	maxFillBlackLines=15
;	Would you like to sharpen images ? yes/no
	sharpen=yes
;	Would you like to try to recover the red colors on 125 passes ? yes/no
;	This could give strange results in some cases....
	rectifyRedColorOn125=yes
;	Would you like to save treated images (in jpg) for further treatment if you want to use some others program(s) (like LRPT_Image_Processor) ? yes/no
	saveTreated=no
;
;
;Here are the shapes options :
;Note : they will be drawed in the order you put them here.
;IMPORTANT : you need 3 files for each shape : the .shp, the .dbf and the .shx.
;For the options who are field from the .dbx, only the first part before the coma is use. You can put the entire name or only the first part.
[Shapes]
	;Number of shapes who will be added :
	shapesNumber=5
;
;For each shapes, there are it's own options. Must be "Shape" plus it's number. We begin by "[Shape0]" and so on... :
;The options inside are not the same for LINES shape files and POINTS shape files.
[Shape0]
	;Filename of the shape file : (here this is a LINES shape file - the coastlines)
	filename=ne_50m_coastline.shp
	;Color in HTML format without the # :
	color=5A690F
	;Thickness in pixels :
	thickness=3
[Shape1]
	;Filename of the shape file : (here this is a LINES shape file - the boundaries)
	filename=ne_50m_admin_0_boundary_lines_land.shp
	;Color in HTML format without the # :
	color=AB6503
	;Thickness in pixels :
	thickness=3
[Shape2]
	;Filename of the shape file : (here this is a LINES shape file - the coordinate lines)
	filename=ne_110m_graticules_10.shp
	;Color in HTML format without the # :
	color=888888
	;Thickness in pixels :
	thickness=3
[Shape3]
	;Filename of the shape file : (here this is a POINTS shape file - the population)
	filename=ne_50m_populated_places.shp
	;Specify if you want a circle or a triangle :
	form=circle
	;Names of the fields for the Latitude & Longitude (find them in the dbf file) :
	latitudeField=LATITUDE,N,19,11
	longitudeField=LONGITUDE,N,19,11
	;Specify the field who will be used for ruptures :
	;You can find this field in the dbf file.
	rupturesField=POP_MAX,N,9,0
	;Ruptures (separate them by a coma) :
	;In this example, these are the cities. We take them only if there are more than 1 000 000 people, and apply differents colors.
	ruptures=1000000,5000000,10000000
	;Colors in HTML format without the #. Separate them by a coma. There must be the same number of values as above for the ruptures :
	colors=6C8FE0,486EC7,2851B0
	;Size in pixels of the points. Same as above, separate them with a coma and should have the same number of values :
	sizes=15,18,21
	;Specify the field (from the dbf file) where to find the name of the point (city name in this case) :
	nameField=NAMEASCII,C,100
	;Specify when we draw the name of the point (city name in this case) :
	;This could have one of these 3 values :
	;always			In this case the name is always draw.
	;never			In this case the name is never draw.
	;fromfield		In this case the name is draw if and only if the "fromField" (see below) contain the "contain" text (see below).
	;Note that in this case, the point could be draw even if it's not in the rupture range (For example, we draw capital name (and point) even if there are less than 1 000 000 people).
	drawName=fromfield
	;In this example, we draw cities names only if the field "FEATURECLA,C,50" contain "Admin-0 capital" (case insensitive).
	;If the option is "never" or "always" you can let these options empty.
	fromField=FEATURECLA,C,50
	contain=Admin-0 capital
	;Is this field is strictly the "contain" text, or should it only contain it ? strict/contain
	;For example : if you put "strict" : if the field contain "Admin-0 capital region" it will not be used. If you put "contain" it will be used.
	containType=strict
[Shape4]
	;Filename of the shape file : (here this is a POINTS shape file - the elevations (mountains))
	filename=ne_10m_geography_regions_elevation_points.shp
	;Specify if you want a circle or a triangle :
	form=triangle
	;Names of the fields for the Latitude & Longitude (find them in the dbf file) :
	latitudeField=lat_y,N,25,9
	longitudeField=long_x,N,25,9
	;Specify the field who will be used for ruptures :
	;You can find this field in the dbf file.
	rupturesField=elevation,N,25,9
	;Ruptures (separate them by a coma) :
	;In this example, these are the mountains. We take them only if there altitude is superior at 1000m, and apply differents colors.
	ruptures=1000,3000
	;Colors in HTML format without the #. Separate them by a coma. There must be the same number of values as above for the ruptures :
	colors=aa8888,552222
	;Size in pixels of the points. Same as above, separate them with a coma and should have the same number of values :
	sizes=15,20
	;Specify the field (from the dbf file) where to find the name of the point (mountain name in this case) :
	nameField=name,C,254
	;Specify when we draw the name of the point (mountain name in this case) :
	;This could have one of these 3 values :
	;always			In this case the name is always draw.
	;never			In this case the name is never draw.
	;fromfield		In this case the name is draw if and only if the "fromField" (see below) contain the "contain" text (see below).
	;Note that in this case, the point could be draw even if it's not in the rupture range.
	drawName=fromfield
	;In this example, we draw mountains names only if the field "comment,C,50" contain "highest" (case insensitive).
	;If the option is "never" or "always" you can let these options empty.
	fromField=comment,C,50
	contain=highest
	;Is this field is strictly the "contain" text, or should it only contain it ? strict/contain
	;For example : if you put "strict" : if the field contain "highest world point" it will not be used. If you put "contain" it will be used.
	containType=contain
